Skip to main content

localml

CI

A local ML experimentation platform demo that runs entirely on an Apple Silicon workstation. It demonstrates the core architecture of a production ML platform at local scale: a Python SDK, framework adapters, experiment tracking, a model registry, artifact storage, evaluation jobs, and local model serving.

Status: early scaffold. Most components are stubs with coherent interfaces. See ROADMAP.md for what's planned and docs/design.md for the full software design document.

What's here

localml/
├── src/localml/          # Python SDK (`import localml as ml`)
│   ├── adapters/         # torch / jax / mlx / huggingface framework adapters
│   ├── client.py         # HTTPX client for the control plane
│   ├── config.py         # ~/.localml/config.toml handling
│   ├── exceptions.py     # typed SDK errors
│   ├── run.py            # run context manager
│   ├── types.py          # Run / ModelVersion / EvaluationJob / Deployment
│   └── cli.py            # Typer CLI
├── services/
│   ├── api/              # FastAPI control plane
│   ├── worker/           # Redis-backed evaluation worker
│   └── mlflow/           # MLflow tracking + registry image
├── docs/                 # Zensical documentation site and design document
├── docker-compose.yml    # Local stack: api, worker, postgres, redis, minio, mlflow, serving
└── tests/

Architecture (at a glance)

flowchart LR
    User[SDK / CLI / Notebook] --> API[FastAPI control plane]
    API --> MLflow[MLflow<br/>tracking + registry]
    API --> DB[(Postgres<br/>metadata)]
    API --> Store[(MinIO<br/>artifacts)]
    API --> Queue[Redis<br/>job queue]
    API --> Serving[Local inference<br/>Ollama / MLX]
    Queue --> Worker[Worker]
    Worker --> Store
    Worker --> DB

The control plane (Postgres) is the source of truth for platform metadata. MLflow holds experiment tracking state, MinIO holds artifacts, and Redis holds transient job state.

Quick start

1. Bring up the stack

cp .env.example .env
docker compose up -d

This starts Postgres, Redis, MinIO, MLflow, the FastAPI control plane, the worker, and a local serving runtime.

Service URL
Control plane http://localhost:8000
API docs http://localhost:8000/docs
MLflow UI http://localhost:5000
MinIO console http://localhost:9001

2. Install the SDK

uv sync           # or: pip install -e .

3. Run the example workflow

import localml as ml

ml.configure(api_url="http://localhost:8000", token="local-dev-token")

with ml.start_run(project="local-demo", config={"model": "tiny-llm"}) as run:
    ml.log_params({"batch_size": 4, "quantization": "4bit"})
    ml.log_metrics({"baseline_accuracy": 0.82})

    version = ml.huggingface.log_pretrained(
        name="tiny-assistant",
        model_dir="./models/tiny-assistant",
        metadata={"task": "chat", "runtime": "mlx"},
    )

    eval_job = ml.evaluate(
        model=version,
        dataset="datasets/eval.jsonl",
        metrics=["exact_match", "latency_p95"],
    )
    eval_job.wait()

    deployment = ml.deploy(model=version, target="local")
    print(deployment.predict({"prompt": "Explain model registries simply."}))

CLI

localml --help
localml projects list
localml runs get <run_id>

Development

Uses uv for Python and dependency management; uv.lock is canonical and CI runs with UV_FROZEN=true.

uv sync
pre-commit install

uv run pytest               # tests with coverage
uv run ruff check           # lint
uv run ruff format --check  # format check
uv run ty check src/        # type check
uv run zensical serve       # live-preview the docs

Docs are authored in docs/ and built with Zensical; docs.yml deploys them to GitHub Pages on every push to main.

Model lifecycle

created → candidate → staging → production → deprecated → archived
       ↘ failed (from candidate/staging)  ↘ archived (terminal)

License

MIT. See LICENSE.

Metadata

Release files for localml 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localml 0.1.0
File Size Uploaded
localml-0.1.0.tar.gz 266.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for localml 0.1.0
File Interpreter ABI Platform
localml-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 284.7 kB

Release files / localml-0.1.0.tar.gz

Download URL localml-0.1.0.tar.gz
Size 266.8 kB
Tags Source
SHA-256 checksum
How to use checksums
985eea6f42bdedc88af654b662fbcd85a47232cd60a7151ddac0f19e15d78ede
BLAKE2b-256 checksum
How to use checksums
cccdab1095f7d01f1b1e3e052d9b7dc0d56b07f78da17fe00a199d81e72069cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.

Transparency log

Release files / localml-0.1.0-py3-none-any.whl

Download URL localml-0.1.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66c07723a5a52c84faae6838381d076c075e7187a3b353e94101f6c1834a0a59
BLAKE2b-256 checksum
How to use checksums
70acec764c039cb231925d145e2c881e9e1727251d5754653b691be69a4696c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page