Metadata-Version: 2.4
Name: g2n-enterprise
Version: 1.7.0
Summary: A platform to optimize AND run PyTorch models: license-gated compiler (enhanced planner, persistent cache, multi-accelerator routing), a quantum circuit simulator with batched parameter sweeps, plus a model registry and inference server, on top of open-core g2n.
Author: g2n
License: Proprietary
Project-URL: Homepage, https://g2n.example.com
Keywords: pytorch,triton,compiler,gpu,npu,inference,serving,model-server,license,quantum,quantum-simulator
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0
Provides-Extra: runtime
Requires-Dist: torch>=2.11.0; extra == "runtime"
Requires-Dist: g2n>=0.4; extra == "runtime"
Requires-Dist: triton>=3.6; extra == "runtime"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"

# g2n — optimize and run PyTorch models

g2n is a PyTorch platform with two halves:

- **Optimize** — a `torch.compile` backend that makes your existing models
  faster and lighter: custom fusion passes, Triton kernels, a persistent
  compile cache, and (on Enterprise) full autotuning.
- **Run** — a serving layer that turns those models into a production
  inference node: model registry, HTTP server, dynamic batching, quantization,
  CUDA-graph replay, and VRAM management for small GPUs.

It also ships a **quantum circuit simulator** (`g2n.quantum`) — a classical
statevector simulator built on torch, for developing and testing quantum
algorithms. It is a simulator, not quantum hardware, and never claims otherwise.

```python
import torch, g2n_enterprise as g2n

g2n.activate("G2N-XXXX-XXXX-XXXX")        # once per machine; cached offline

# Optimize: drop-in
model = g2n.compile(my_model)              # or torch.compile(m, backend="g2n")

# Run: registry -> HTTP inference node on :8900
g2n.register_model("clf", "torchscript:/models/clf.pt",
                   precision="int8w",      # weight-only int8: ~4x less weight memory
                   cuda_graph=True, max_batch=16)
g2n.serve()                                # GET/POST http://host:8900/v1/...
```

## Install

```bash
pip install g2n-enterprise[runtime]   # full: torch + triton + open-core g2n
pip install g2n                       # open-core only (free, Community tier)
```

Python ≥ 3.10. Everything degrades gracefully: no GPU → CPU paths; no license →
Community tier; a compile failure → your unmodified model. Your code never
breaks because of g2n.

## Tiers

| | Community (free) | Pro ($49/mo) | Enterprise ($499/mo) |
|---|:--:|:--:|:--:|
| Hybrid fusion + JIT codegen | ✓ | ✓ | ✓ |
| Enhanced buffer planner (memory fusion) | | ✓ | ✓ |
| Persistent compile cache | | ✓ | ✓ |
| Model registry + inference server | | ✓ | ✓ |
| Quantum simulator: unlimited qubits + fusion | ≤24 qubits | ✓ | ✓ |
| Dynamic request batching | | | ✓ |
| Batched quantum parameter sweeps | | | ✓ |
| Multi-accelerator routing + max-autotune | | | ✓ |
| Validated model-zoo configs, priority support | | | ✓ |

Buy at [g2n.dev](https://g2n.dev) · seats: Pro 5, Enterprise 25 · 14-day Pro
trial on request (sales@g2n.dev).

## Documentation

| Doc | What it answers |
|---|---|
| [Overview](docs/OVERVIEW.md) | What g2n is, how the pieces fit, what it is NOT |
| [Getting started](docs/GETTING-STARTED.md) | Install → activate → first compile → first serve |
| [Optimize](docs/OPTIMIZE.md) | The compiler: what each tier unlocks, cache, autotune |
| [Serving](docs/SERVING.md) | The inference node: precision/quantization, batching, HTTP API |
| [Quantum](docs/QUANTUM.md) | The circuit simulator |
| [Licensing](docs/LICENSING.md) | Keys, activation, seats, offline use, renewal |
| [License server](docs/LICENSE-SERVER.md) | Self-hosting / vendor operations + HTTP API |

## Honest numbers, always

g2n never ships fabricated benchmarks. Every published number is measured by a
script in `benchmarks/` on named hardware, and the tooling to measure on
**your** hardware is built in:

```python
import g2n_enterprise as g2n
from g2n_enterprise.serve.reference import example_inputs
g2n.benchmark("mlp", example_inputs(batch=32), rounds=200)
# -> eager vs optimized median latency + peak VRAM, on THIS box
```

Speedups depend on your model and GPU. Measure before you trust — that
includes our numbers.
