Metadata-Version: 2.4
Name: aquin
Version: 0.6.4
Summary: Stream live training metrics, run model diffs, and inspect datasets — all from your training script. Run a full local inspection server with aquin.inspect().
Project-URL: Homepage, https://aquin.app
Project-URL: Documentation, https://aquin.app/docs
License: MIT
Requires-Python: >=3.10
Requires-Dist: requests>=2.28
Requires-Dist: websocket-client>=1.6
Provides-Extra: inspect
Requires-Dist: fastapi>=0.110; extra == 'inspect'
Requires-Dist: httpx>=0.24; extra == 'inspect'
Requires-Dist: numpy>=1.24; extra == 'inspect'
Requires-Dist: openai>=1.0; extra == 'inspect'
Requires-Dist: pandas>=2.0; extra == 'inspect'
Requires-Dist: peft>=0.7; extra == 'inspect'
Requires-Dist: presidio-analyzer>=2.2; extra == 'inspect'
Requires-Dist: presidio-anonymizer>=2.2; extra == 'inspect'
Requires-Dist: python-dotenv>=1.0; extra == 'inspect'
Requires-Dist: python-multipart>=0.0.9; extra == 'inspect'
Requires-Dist: safetensors>=0.4; extra == 'inspect'
Requires-Dist: spacy>=3.6; extra == 'inspect'
Requires-Dist: torch>=2.0; extra == 'inspect'
Requires-Dist: transformer-lens>=1.8; extra == 'inspect'
Requires-Dist: transformers>=4.35; extra == 'inspect'
Requires-Dist: umap-learn>=0.5; extra == 'inspect'
Requires-Dist: uvicorn>=0.29; extra == 'inspect'
Provides-Extra: ml
Requires-Dist: peft>=0.7; extra == 'ml'
Requires-Dist: torch>=2.0; extra == 'ml'
Requires-Dist: transformers>=4.35; extra == 'ml'
Provides-Extra: serve
Requires-Dist: fastapi>=0.110; extra == 'serve'
Requires-Dist: torch>=2.0; extra == 'serve'
Requires-Dist: transformers>=4.35; extra == 'serve'
Requires-Dist: uvicorn>=0.29; extra == 'serve'
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == 'torch'
Description-Content-Type: text/markdown

# aquin

Python SDK for [Aquin](https://aquin.app) — stream live training metrics, run model diffs, and inspect datasets directly from your training script.

## Install

```bash
pip install aquin
```

If you need PyTorch helpers (activation tracking etc.):

```bash
pip install "aquin[torch]"
```

## Usage

### Training session

```python
import aquin

session = aquin.attach(model, optimizer, api_key="aq-...")

for step in range(num_steps):
    loss = train_step()
    session.step(loss, epoch=epoch, batch=batch, total_batches=len(dataloader))

session.stop()
```

Open [aquin.app/app](https://aquin.app/app) → Training tab → connect with your API key to watch metrics stream in live.

### Model diff

Compare a fine-tuned checkpoint against its base model:

```python
diff = aquin.ModelDiff(
    base="meta-llama/Llama-3.2-1B",
    ft_path="./my-checkpoint.pt",
    api_key="aq-...",
)
result = diff.run(prompts=["Tell me about X", "Explain Y"])
```

### SAE feature diff

Inspect which SAE features changed most between base and fine-tuned:

```python
sae = aquin.SAEDiff(
    base="meta-llama/Llama-3.2-1B",
    ft_path="./my-checkpoint.pt",
    api_key="aq-...",
)
result = sae.run(prompts=["Tell me about X"])
```

### Dataset inspection

Scan a dataset for PII, toxicity, bias, synthetic content, and compliance:

```python
ds = aquin.DataSession(
    dataset_path="./training_data.jsonl",
    api_key="aq-...",
)
results = ds.inspect()
```

Supports `.jsonl`, `.json`, `.csv`, and `.tsv`.

## API key

Get your key at [aquin.app](https://aquin.app).

## Links

- [Dashboard](https://aquin.app/app)
- [Docs](https://aquin.app/docs)