Skip to main content

mllogs

Local experiment tracking and model registry for machine learning.

Why mllogs?

mllogs is built for developers who want structured experiment tracking without running a separate tracking server or external service. It provides a simple local workflow for tracking experiments, runs, parameters, metrics, artifacts, and model versions using SQLite and the filesystem.

Use it when your training code has outgrown ad hoc dictionaries, folders, and filenames, but you do not need the infrastructure of a larger ML platform.

Installation

pip install mllogs

Quickstart

Track an experiment

Train several models with different hyperparameter configurations and track their results.

from mllogs import MLLogs
from sklearn.datasets import load_diabetes
from sklearn.linear_model import Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split

# Prepare data
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42
)

# Create experiment
mll = MLLogs()
experiment = mll.create_experiment("ridge-tuning")

best_mse = float("inf")
best_model_ref = None

# Track different configurations
for alpha in [0.1, 1.0, 10.0]:
    mll.start_run(experiment.name)

    model = Ridge(alpha=alpha)
    model.fit(X_train, y_train)

    predictions = model.predict(X_test)
    mse = mean_squared_error(y_test, predictions)

    mll.log_param("alpha", alpha)
    mll.log_metric("mse", mse)

    mll.save_artifact("predictions", predictions, "npy")
    model_ref = mll.save_artifact("model", model, "joblib")

    mll.complete_run()

    if mse < best_mse:
        best_mse = mse
        best_model_ref = model_ref

Each configuration creates a separate run within the same experiment, preserving its parameters, metrics, and trained model.

Query experiments and runs

Retrieve experiments and inspect previously recorded runs.

mll.query.list_experiments()
runs = mll.query.list_runs(experiment.name)

run = runs[0]
mll.query.get_run(run.id)
mll.query.get_params(run.id)
mll.query.get_metrics(run.id)
mll.query.get_tags(run.id)

Load saved artifacts

Load a previously trained model from its associated run.

mll.query.list_artifacts(run.id)

predictions = mll.query.load_artifact(run.id, "predictions")
model = mll.query.load_artifact(run.id, "model")

Supported artifact formats

mllogs supports saving and loading artifacts in the following formats:

Format Common use cases
JSON (.json) Dictionaries, configurations, metadata
CSV (.csv) Predictions, tabular data
Parquet (.parquet) DataFrames, larger datasets
Pickle (.pkl) Serialized Python objects, models
NumPy (.npy) Arrays, embeddings
Joblib (.joblib) Trained models, Python objects

Specify the format when saving an artifact:

mll.save_artifact("predictions", predictions, "csv")
mll.save_artifact("model", model, "joblib")

Artifacts are associated with individual runs and can be loaded via mll.query.load_artifact().

Note: Only load Pickle or Joblib from trusted sources, since deserialization can execute arbitrary code.

Register models

Register the best-performing model artifact as a versioned model artifact.

mll.registry.create_version("diabetes-ridge", best_model_ref)

latest = mll.registry.get_latest_version("diabetes-ridge")

create_version automatically registers the model if it does not already exist. Subsequent versions can reference new model artifacts without overwriting previous versions.

Retrieve a specific model version:

version = mll.registry.get_version(
    model_name="diabetes-ridge",
    version=1,
)

Features

  • Create experiments to organize related machine learning runs
  • Start, complete, and fail runs
  • Log parameters, metrics, and tags
  • Persist run metadata to a local SQLite database
  • Save and load artifacts using local file storage
  • Query experiments, runs, and logged data
  • Register models and create versioned references to persisted model artifacts

Development

Install from source with development dependencies:

pip install -e ".[dev]"

Run the test suite:

pytest

License

MIT

Metadata

Release files for mllogs 0.8.1

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

Source distribution (sdist)

Source distribution for mllogs 0.8.1
File Size Uploaded
mllogs-0.8.1.tar.gz 14.1 kB Details

Built distribution (wheel)

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

Total release size: 30.9 kB

Release files / mllogs-0.8.1.tar.gz

Download URL mllogs-0.8.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
92062bb18e92b02a866ef9f40554847e28420804810025d5d0e258ea6db1ec76
BLAKE2b-256 checksum
How to use checksums
6ea37a300688b1614ee1013953877fd5764ffe1275af81049740ecc9c60f7498
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Release files / mllogs-0.8.1-py3-none-any.whl

Download URL mllogs-0.8.1-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fd53a44e2bbd38ca621075865edd4957f271d340902c4e52bc1b5026771ae14
BLAKE2b-256 checksum
How to use checksums
4d9491fd6b257413199ba9df7d84ef97fd928c25ed47ba863d34abe1adc94c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.0

2 release files

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

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