Metadata-Version: 2.5
Name: fabryka
Version: 0.3.0
Summary: Fabryka SaaS experiment tracking SDK and self-hosted tracking server
Author: Fabryka Labs
License: MIT
Keywords: experiment-tracking,llm,machine-learning,training
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: corpus
Requires-Dist: pyarrow>=15; extra == 'corpus'
Provides-Extra: eval
Requires-Dist: lm-eval==0.4.13; extra == 'eval'
Provides-Extra: postgres
Requires-Dist: psycopg[binary]>=3.2; extra == 'postgres'
Provides-Extra: r2
Requires-Dist: boto3>=1.35; extra == 'r2'
Provides-Extra: server
Requires-Dist: argon2-cffi>=23.1; extra == 'server'
Requires-Dist: datasets<5,>=4; extra == 'server'
Requires-Dist: fastapi>=0.115; extra == 'server'
Requires-Dist: huggingface-hub<2,>=1.0; extra == 'server'
Requires-Dist: numpy>=1.24; extra == 'server'
Requires-Dist: pydantic-settings>=2.5; extra == 'server'
Requires-Dist: python-multipart>=0.0.12; extra == 'server'
Requires-Dist: safetensors>=0.4; extra == 'server'
Requires-Dist: sqlalchemy>=2.0; extra == 'server'
Requires-Dist: tiktoken<1,>=0.9; extra == 'server'
Requires-Dist: torch>=2.4; extra == 'server'
Requires-Dist: uvicorn>=0.30; extra == 'server'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.24; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# Fabryka SDK

The official Python client for the hosted Fabryka tracking API.

```bash
pip install fabryka
```

The SDK sends runs, metrics, logs and artifacts to your configured Fabryka API.
It does **not** start a dashboard, run a server, create a local database, or
provision GPUs.

## Configure

Create an API key in your Fabryka account and set:

```bash
export FABRYKA_API_URL=https://track.fabryka.ai
export FABRYKA_API_KEY=your_api_key
```

## Track a run

```python
from fabryka import run

run.init(
    project="sub150run",
    name="lfm-32m",
    experiment="architecture-ablation",
    config={"parameters": 32_793_472, "tokens": 1_000_000_000},
)

for step in range(1000):
    run.log({"train/loss": loss, "throughput/tokens_sec": tokens_per_second}, step=step)

run.log_text("checkpoint saved")
run.artifact("runs/checkpoint-step-001000.pt")
run.finish()
```

Events are persisted in a local spool before upload. Temporary network
failures therefore do not lose metrics; pending events are retried by the
client. Set `FABRYKA_SPOOL_DIR` to choose a different spool location.

The package exposes `RunClient` for multiple API clients or dependency
injection:

```python
from fabryka import RunClient

client = RunClient(api_url="https://track.fabryka.ai", api_key="...")
client.init(project="demo", name="run-1")
client.log({"loss": 1.2}, step=0)
client.finish()
```

The self-hosted API and dashboard live in the source repository, but are not
included in this client distribution.

## Neptune-style compatibility

Common Neptune calls can use the Fabryka adapter:

```python
from fabryka.neptune import init_run

run = init_run(project="sub150run", api_token="...", name="baseline")
run["train/loss"].append(2.1, step=0)
run["model/parameters"] = 32_793_472
run["checkpoints/latest"].upload("runs/latest.pt")
run.stop()
```

The adapter sends data to Fabryka and does not install or contact Neptune.
