Skip to main content

agenticml-py

Python SDK for the AgenticML experiment-tracking platform — metrics, config, code snapshots, artifacts, media, and system metrics.

⚠️ Pre-alpha. The public API is not yet stable. Pin exact versions if you depend on this.

📦 Note on naming: install as agenticml-py, import as agenticml.

Install

pip install agenticml-py

# Optional extras
pip install "agenticml-py[system]"   # CPU/RAM/disk system metrics
pip install "agenticml-py[gpu]"      # NVIDIA GPU metrics
pip install "agenticml-py[media]"    # Image logging from numpy/PIL

Quickstart

import agenticml

agenticml.init(
    project="demo",
    name="exp1",
    config={"learning_rate": 0.01, "epochs": 10},
    tags=["baseline"],
)

for step in range(10):
    agenticml.log({"loss": 1 / (step + 1), "accuracy": step / 10}, step=step)

agenticml.summary["best_loss"] = 0.1
agenticml.finish()

What you get

  • Module-level API: init / log / finish / config / summary / log_artifact. One active run per process, like wandb. A Run class is also exported for multi-run cases and as a context manager.
  • Auto-incrementing step with optional commit=False to merge metrics from multiple sources at the same step.
  • Runtime source snapshots: project code actually imported and project files actually opened for reading. Content-addressed: re-runs only upload bytes the server doesn't have. 10 MB/file and 100 MB total caps by default.
  • Artifacts with auto-versioning: agenticml.log_artifact(path, name, type, metadata).
  • Media: agenticml.Image(data, caption) accepts paths, bytes, PIL.Image, or numpy arrays.
  • System metrics: psutil (CPU/RAM/disk) and pynvml (GPU) sampled in the background and logged as _system/....
  • Resume: init(id=..., resume="allow"|"must").
  • Offline mode: AGENTICML_MODE=offline writes a journal locally; agenticml sync replays it.
  • Distributed-aware: standard rank env vars detected; non-rank-0 ranks become silent no-ops.

Configuration

Env var Default Purpose
AGENTICML_HOST https://api.agenticml.xyz Server base URL
AGENTICML_API_KEY (none) Sent in the x-api-key header
AGENTICML_MODE online online, offline, or disabled
AGENTICML_OFFLINE_DIR ~/.agenticml/offline Where offline journals are written

Source tracking

Runtime-used tracking is enabled by default. AgenticML observes source modules and input files while the run is active, then creates and uploads a SHA-256 manifest during finish().

agenticml.init(
    project="demo",
    name="training",
    track_source="runtime",             # default
    source_roots=["../shared_templates"],
    extra_files=["settings.yaml"],
)
File category Default behavior
Entrypoint and project-local imported Python modules Tracked automatically
Project-local configs, templates, and other regular files opened for reading Tracked automatically
Files below a configured source_roots directory that are imported or read Tracked automatically
Files passed through extra_files or track_files() Tracked explicitly
Virtual environments, site-packages, dist-packages, and __pypackages__ Always excluded; package versions are captured separately
Packaging products (*.egg*, *.dist-info, wheels, build/, dist/) Always excluded as generated installation artifacts
Other third-party packages outside the allowed roots Excluded
Write-only/generated outputs Excluded; use log_artifact() or track_files()
.git, virtual environments, caches, node_modules, ignored paths Excluded
Files over the configured per-file or total size limits Excluded and reported as skipped

track_source="repo" retains the earlier full-repository walk with static AST import discovery. track_source=True is a compatibility alias for "runtime"; False disables source tracking. .gitignore and .agenticmlignore apply to automatic discovery in runtime and repository modes; an explicit extra_files/track_files() path overrides those patterns.

Resource reads before agenticml.init() cannot be observed, so pass those files through extra_files. Imported modules already present in sys.modules are still detected. Snapshot contents are read at finish(); files deleted before then are listed as missing rather than uploaded.

See Runtime source tracking for lifecycle, safety, migration, and troubleshooting details.

Offline mode

AGENTICML_MODE=offline python train.py
# ...later, from a machine with network access:
agenticml sync --host https://api.agenticml.xyz --api-key $AGENTICML_API_KEY

Development

git clone https://github.com/agenticML/agenticml.git
cd agenticml
pip install -e ".[dev]"
pytest

Releasing

Releases are published to PyPI via GitHub Actions on tags matching v*:

# bump version in pyproject.toml and src/agenticml/__init__.py
git commit -am "release: v0.0.3"
git tag v0.0.3
git push --tags

License

MIT — see LICENSE.

Release files for agenticml-py 0.0.4

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

Source distribution (sdist)

Source distribution for agenticml-py 0.0.4
File Size Uploaded
agenticml_py-0.0.4.tar.gz 38.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agenticml-py 0.0.4
File Interpreter ABI Platform
agenticml_py-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 71.1 kB

Release files / agenticml_py-0.0.4.tar.gz

Download URL agenticml_py-0.0.4.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e8a28c507771962a7efe991a644e530b15d42650550b9c500687c69e93f7b3d7
BLAKE2b-256 checksum
How to use checksums
6cf1998b9cb06ad7b4dff7fff66eb753367e24c93db54741a31b3360a64e0828
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 Sep 16, 2026.

Transparency log

Release files / agenticml_py-0.0.4-py3-none-any.whl

Download URL agenticml_py-0.0.4-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56b86e288ed9b02892acac1a0cc673ffb5396f0f12b546f38a990f05f578fb0d
BLAKE2b-256 checksum
How to use checksums
93a1649df97c1328eab0e9c230f9295d47e9fd67c7f9536cac28754938f8cfdf
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 Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.5

2 release files

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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