SaltAI
SaltAI is a lightweight local-first ML pipeline library for reproducible experiments. It helps organize training runs, metrics, manifests, events, artifacts and checkpoints without forcing users to deploy a heavy MLOps platform.
About the library
SaltAI is designed to standardize the most common parts of ML and DL experiments.
The library gives you a simple run lifecycle, where each experiment has its own configuration, output directory, manifest, event log and optional checkpoints.
The main workflow looks like this:
config -> Runner -> Trainer -> metrics -> manifest -> events -> checkpoints -> resume
The project is focused on a library-first approach. You can use the core package locally, while cloud and external MLOps integrations can be added later as optional extensions.
Core features
-
RunnerRuns the experiment body, creates the run directory, validates config, writes
manifest.json, records events and collects returned metrics. -
TrainerProvides a minimal framework-agnostic training and evaluation loop. It works with user-defined model adapters, data modules and metrics.
-
Run manifestEvery run produces a
manifest.jsonfile with the run status, config hash, metrics, artifacts, checkpoints and resume information. -
EventsStructured events can be written to
events.jsonl. This includes run, stage, epoch, step, metric and checkpoint events. -
ArtifactsLocal artifacts can be stored through the artifact store. For example, SaltAI can store the event log as a run artifact.
-
CheckpointsSaltAI supports checkpoint saving through:
latestbest
-
ResumeA run can be resumed from a saved checkpoint:
runner.run(cfg, body=body, resume_from="latest")
Installation
1. Installation for local development
To install the library locally, clone the repository and install the package in editable mode:
git clone https://github.com/D1ffic00lt/salt-ai.git
cd salt-ai
git checkout dev
python -m pip install -e .
2. Requirements
SaltAI currently supports Python versions:
>=3.10,<3.13
The core library has no heavy ML framework dependency. You can connect your own model, data module and metrics through small protocol-like interfaces.
Quickstart
The minimal run can be written like this:
from saltai import Runner
class Model(object):
def __init__(self):
self.w = 1.0
def state_dict(self):
return {"w": self.w}
def load_state_dict(self, state):
self.w = float(state["w"])
cfg = {
"run": {"id": "quickstart"},
"seed": 42,
"paths": {"root": "runs"},
}
runner = Runner(
record_events=True,
store_artifacts=True,
enable_checkpoints=True,
)
def body(ctx):
model = Model()
model.w = 2.0
ctx.io.save_latest(model, step=1)
return {
"loss": 0.1,
"accuracy": 1.0,
}
result = runner.run(cfg, body=body)
print(result.status)
print(result.metrics.values)
print(result.manifest_path)
After running this script, SaltAI creates a directory like this:
runs/
└── quickstart
├── manifest.json
├── events.jsonl
├── artifacts
└── checkpoints
Resume from checkpoint
SaltAI can restore checkpoint payload before running the experiment body.
from saltai import Runner
class Model(object):
def __init__(self):
self.w = 0.0
def state_dict(self):
return {"w": self.w}
def load_state_dict(self, state):
self.w = float(state["w"])
cfg = {
"run": {"id": "quickstart"},
"seed": 42,
"paths": {"root": "runs"},
}
runner = Runner(
record_events=True,
store_artifacts=True,
enable_checkpoints=True,
)
def body(ctx):
assert ctx.io.resume_ref is not None
assert ctx.io.resume_payload is not None
model = Model()
model.load_state_dict(ctx.io.resume_payload["state"])
return {
"loaded": True,
"w": model.w,
}
result = runner.run(
cfg,
body=body,
resume_from="latest",
)
print(result.metrics.values)
Full local example
The repository contains a complete local example with a tiny model, data module, metrics, training, evaluation, checkpoints, manifest and events.
python examples/full_local_run.py
The example demonstrates:
Runner.runTrainer.fitTrainer.evaluate- metric collection
ctx.io.save_latestctx.io.save_bestmanifest.jsonevents.jsonl- checkpoint files
Public API
The main objects are available from the top-level package:
from saltai import (
Runner,
Trainer,
RunContext,
RunIO,
RunId,
RunResult,
ArtifactRef,
Checkpointable,
DataModule,
ModelAdapter,
Metric,
MetricPoint,
MetricSummary,
Logger,
)
Running tests
The project uses unittest.
python -m unittest discover tests
If you use Poetry:
poetry install
poetry run python -m unittest discover -s tests -p "test*.py" -v
Metadata
Release files for salt-ai 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| salt_ai-0.1.3.tar.gz | 37.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| salt_ai-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.5 kB
Release files / salt_ai-0.1.3.tar.gz
| Download URL | salt_ai-0.1.3.tar.gz |
|---|---|
| Size | 37.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
311ccbe2d8292b5c6006d37e100af86baa4dc2600bc42ecef951b5244e96d4e1
|
|
BLAKE2b-256 checksum How to use checksums |
e803c16dc1c7b27f4341ae2b09acec6beb61d24755ea36e1e57b5d72b47f68a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.6 Darwin/25.2.0
|
Release files / salt_ai-0.1.3-py3-none-any.whl
| Download URL | salt_ai-0.1.3-py3-none-any.whl |
|---|---|
| Size | 53.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae35f1b2f2c7f459fad42f74f436f8096cb1c362766ea8521ab8890ad0e44ab3
|
|
BLAKE2b-256 checksum How to use checksums |
16b65c555a603c44f7a71702868811c1e1ecb16b78b1354d95f785f199f4c503
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.6 Darwin/25.2.0
|
Security for salt-ai 0.1.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.