Metadata-Version: 2.5
Name: jaxforge
Version: 0.2.0
Summary: Model-agnostic natural language engineering workbench for JAX and Flax
Project-URL: Homepage, https://github.com/wkambale/jaxforge
Project-URL: Documentation, https://wkambale.github.io/jaxforge
Project-URL: Repository, https://github.com/wkambale/jaxforge
Project-URL: Issues, https://github.com/wkambale/jaxforge/issues
Project-URL: Changelog, https://github.com/wkambale/jaxforge/blob/main/CHANGELOG.md
Author-email: Wesley Kambale <spartanwk@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Wesley Kambale
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai-agent,equinox,flax,jax,llm,machine-learning,neural-networks
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: flax>=0.9.0
Requires-Dist: jax>=0.4.25
Requires-Dist: numpy>=1.24.0
Requires-Dist: optax>=0.2.0
Requires-Dist: orbax-checkpoint>=0.6.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: mypy>=1.9.0; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Provides-Extra: docker
Requires-Dist: docker>=7.0.0; extra == 'docker'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Provides-Extra: e2b
Requires-Dist: e2b-code-interpreter>=1.0.0; extra == 'e2b'
Provides-Extra: equinox
Requires-Dist: equinox>=0.11.0; extra == 'equinox'
Provides-Extra: google
Requires-Dist: google-genai>=1.0.0; extra == 'google'
Provides-Extra: gpu
Requires-Dist: jax[cuda12]; extra == 'gpu'
Provides-Extra: grain
Requires-Dist: grain>=0.2.0; extra == 'grain'
Provides-Extra: litellm
Requires-Dist: litellm>=1.50.0; extra == 'litellm'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0.0; extra == 'mcp'
Provides-Extra: modal
Requires-Dist: modal>=0.64.0; extra == 'modal'
Provides-Extra: openai
Requires-Dist: openai>=1.50.0; extra == 'openai'
Provides-Extra: safetensors
Requires-Dist: safetensors>=0.4.0; extra == 'safetensors'
Provides-Extra: tpu
Requires-Dist: jax[tpu]; extra == 'tpu'
Provides-Extra: viz
Requires-Dist: matplotlib>=3.8; extra == 'viz'
Description-Content-Type: text/markdown

<div align="center">
  <h1>Jax Forge</h1>
  <p><b>Model-agnostic natural language engineering workbench for JAX and Flax</b></p>

  [![PyPI version](https://img.shields.io/pypi/v/jaxforge.svg)](https://pypi.org/project/jaxforge/0.2.0/)
  [![Python Versions](https://img.shields.io/pypi/pyversions/jaxforge.svg)](https://pypi.org/project/jaxforge/0.2.0/)
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
  [![CI](https://github.com/wkambale/jaxforge/actions/workflows/ci.yml/badge.svg)](https://github.com/wkambale/jaxforge/actions/workflows/ci.yml)
</div>

`jaxforge` (product name **Jax Forge**, formerly `jax-gemini`) enables machine learning engineers and researchers to preview, validate, build, train, explore, and export JAX and Flax workflows from natural language across any frontier or local LLM provider.

Unlike blind code-execution wrappers, `jaxforge` supports an inspect-first gate (`preview()`, `dry_run=True`, or `approve=` callbacks), privacy-preserving `DatasetProfile` summaries, unified diff edits, metric-guided tree-search exploration (`explore()`), isolated execution backends, and standalone Python package exports.

## Core features

- **Inspect-first preview and approval**: Generate and AST-validate code with `jf.preview()` or `dry_run=True` to inspect source code, unified diffs, and shape estimates before running compute.
- **Multi-provider LLM routing**: Use Google Gemini, OpenAI, Anthropic Claude, OpenRouter, LiteLLM, or local Ollama and vLLM servers through `provider` or `model_name` prefixes (such as `anthropic:claude-sonnet-4-5`, `openai:gpt-5`, or `ollama:qwen2.5-coder:32b`) with fast/primary routing.
- **Production JAX workflows**: Supports Flax NNX and Equinox modeling, Optax schedules, `jax.sharding` device meshes, Grain streaming datasets, Orbax and Safetensors checkpoints, and `jax.eval_shape` checks.
- **Pluggable sandbox isolation**: Enforces AST allowlists, `WeakKeyDictionary` module proxies, and confined file I/O across `thread`, `subprocess` (with memory/CPU limits), `docker`, `e2b`, and `modal` backends.
- **Branching exploration and project export**: Compare candidate strategies with `jf.explore()` and materialize clean standalone Python packages via `jf.export_project()`, the `jaxforge` CLI, or the MCP server.

## Quickstart

### Installation

Install `jaxforge` from [PyPI](https://pypi.org/project/jaxforge/0.2.0/):

```bash
pip install jaxforge
```

Optional extras install provider SDKs, modeling frameworks, sandboxes, or plotting:

```bash
pip install "jaxforge[google,openai,anthropic,viz]"
pip install "jaxforge[equinox,grain,safetensors]"
pip install "jaxforge[docker,e2b,modal,mcp]"
```

Configure an API key for your chosen provider (or point `base_url` at a local Ollama or vLLM endpoint):

```bash
export GEMINI_API_KEY="your-key"      # or OPENAI_API_KEY / ANTHROPIC_API_KEY
```

### Preview, approve, train, and export

```python
import jaxforge as jf
import numpy as np

# Switch providers freely: "gemini-3.1-pro", "openai:gpt-5", "anthropic:claude-sonnet-4-5", "ollama:llama3"
jf.config.set({"model_name": "anthropic:claude-sonnet-4-5"})

# Preview code and validation status before running anything
plan = jf.preview("Build a 4-layer MLP for 28x28 digit classification")
print(plan.code)

# Execute after review, or use build/modify/train with interactive approval
model = jf.build("Build a 4-layer MLP for digit classification")
model = jf.modify("Add dropout with rate 0.2 between hidden layers")

X_train = np.random.randn(100, 28, 28, 1).astype(np.float32)
y_train = np.random.randint(0, 10, size=(100,))

# Explore multiple candidate training runs against validation accuracy
experiment = jf.explore(
    "Train classifier with cosine learning-rate decay",
    dataset=(X_train, y_train),
    metric="accuracy",
    candidates=3,
)
print("Best accuracy:", experiment.best_candidate.score)

# Export generated modules into a standalone installable repository
jf.export_project("./exported_classifier", package_name="digit_classifier")
```

### CLI and MCP server

```bash
jaxforge info
jaxforge devices
jaxforge preview "Build a Flax NNX residual classifier" --export ./out_pkg
jaxforge mcp
```

See [examples/](examples/) for end-to-end Python scripts and notebooks.

## Documentation

Full hosted documentation is published at [wkambale.github.io/jaxforge](https://wkambale.github.io/jaxforge):

- [Quickstart guide](docs/quickstart.md): Installation, provider configuration, preview gates, training, and project export.
- [API reference](docs/api-reference.md): Public functions, `GeneratedPlan`, execution backends, CLI, and contrib helpers.
- [Architecture internals](docs/architecture.md): Multi-provider routing, AST validation, sandbox backends, and memory.
- [Security protocol](docs/security.md): AST rules, import scoping, runtime proxies, path confinement, and timeout enforcement.

## License and contributing

Read the [contribution guidelines](CONTRIBUTING.md) before opening issues or pull requests. Distributed under the MIT License; see [LICENSE](LICENSE) for full terms.
