Lightweight ML pipeline library: configs, data modules, training engine, artifacts, and optional integrations.
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file salt_ai-0.1.2.tar.gz.
File metadata
- Download URL: salt_ai-0.1.2.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.6 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c9b704fe5b26e12465e0be66dbd4fc3e86b6cad37ec23dd36d23b0cc76e2c9d
|
|
| MD5 |
d39b2ea60e34170fcbc2929fd5e4810d
|
|
| BLAKE2b-256 |
3946deae6817367d30f5713bbb87285e24602a8587cf6d70bad97943807f8c3d
|
File details
Details for the file salt_ai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: salt_ai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.6 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a535c19f0a2261e8738b56c6451cebdfddd82e7a68f58e53e80564362f443b83
|
|
| MD5 |
63ae84569dab9a75f5eb3e8273a0857c
|
|
| BLAKE2b-256 |
5c5adea80a21335636b922527cb83207cf61e16ac62b0c507db0712b41c7ce7b
|