Skip to main content

Stryx

Stryx is a typed configuration compiler and experiment manager for Machine Learning. It provides a lightweight, composable approach to experiment tracking and configuration, using Pydantic for validation and YAML for persistence.

Key Features

  • Type-First: Configurations are defined as Pydantic models, providing IDE support and validation.
  • Configs as Source: Experiment configurations are compiled into static YAML "configs" that include metadata and lineage.
  • Minimal Surface: A single decorator (@stryx.cli) adds powerful CLI capabilities to any script.
  • Reproducibility: Defaults are code-driven, overrides are explicit, and every run is recorded with a manifest (git state, logs, absolute paths).
  • Lifecycle Management: Automatic recording of status, results, and system metadata for every execution.

Installation

pip install stryx

Quick Start

Define your configuration schema and decorate your entry point:

# train.py
from pydantic import BaseModel
import stryx

class Config(BaseModel):
    lr: float = 1e-4
    epochs: int = 10

@stryx.cli(schema=Config)
def main(cfg: Config):
    print(f"Training with lr={cfg.lr}, epochs={cfg.epochs}")

if __name__ == "__main__":
    main()

CLI Usage

Your script now has a structured CLI.

1. Running Experiments (run)

Execute an experiment. If you provide overrides, Stryx automatically creates a "scratch" config to track the variant.

# Run with defaults
python train.py run

# Run with overrides (creates a scratch config)
python train.py run lr=1e-3 epochs=50

# Run a specific named config
python train.py run my_exp

2. Config Management (configs)

Manage your experiment templates (recipes).

# Initialize a new config from defaults
python train.py configs init my_exp lr=1e-3

# Fork an existing config
python train.py configs fork my_exp better_exp lr=2e-4

# List all saved configs
python train.py configs list

# Inspect a config with source annotations
python train.py configs show my_exp

# Print the JSON schema for VS Code validation
python train.py configs schema --json

3. Run Management (runs)

Inspect and compare execution history.

# List all runs
python train.py runs list

# Show detailed info for a specific run
python train.py runs show run_20260101_120000

# Diff two runs to see what changed
python train.py runs diff run_A run_B

CLI Reference

Top-level Commands

Command Description
run [config] [ov...] Execute an experiment (alias for runs exec).
configs Subcommands for managing configuration files.
runs Subcommands for managing execution history.

Configs Subcommands (configs ...)

Command Description
init [name] [ov...] Create a fresh config file from defaults.
fork <src> <name> [ov...] Fork an existing config with modifications.
list List all saved configs and scratches.
show [name] [ov...] Display config with source annotations.
diff <A> [B] Compare two configs (or A vs defaults).
schema Show the configuration schema (use --json for files).

Runs Subcommands (runs ...)

Command Description
exec [config] [ov...] Execute an experiment.
list List execution history and statuses.
show <run_id> Show configuration and metadata for a run.
diff <id_A> <id_B> Compare configuration between two runs.

Global Options

  • --runs-dir: Override directory for run logs and manifests (default: runs/).
  • --configs-dir: Override directory for config storage (default: configs/).

Metadata

Release files for stryx 0.1.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 stryx 0.1.4
File Size Uploaded
stryx-0.1.4.tar.gz 24.9 kB Details

Built distribution (wheel)

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

Total release size: 54.6 kB

Release files / stryx-0.1.4.tar.gz

Download URL stryx-0.1.4.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
63b97e8d394bb4e16438a4fc714e8b4ca559ebbb71669fd3627fb6c8ceab9383
BLAKE2b-256 checksum
How to use checksums
1853af3093be0d900b3d5fdd49d7d9464a3c213877cfac6487e17bd9f73636db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / stryx-0.1.4-py3-none-any.whl

Download URL stryx-0.1.4-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0da397f75fe05edd8b30796f9a8a269e396ce8409a8871898ac48b2748df0daf
BLAKE2b-256 checksum
How to use checksums
7ef6362dd87fd565a2061ebd1b08439404fcdd678483ef0536a6ce887ef5a2b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

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