Typed configuration compiler for ML experiments
Project description
Stryx — Typed configuration compiler for ML experiments
Stryx sits between Sacred and Hydra: lightweight and composable like Sacred, without Hydra’s indirection. You define configs as Pydantic models, get a CLI for free, and manage reusable recipes in plain YAML. The goal is clean, type-safe experiment configs that are easy to share, inspect, and reproduce—no hidden magic.
Guiding principles
- Type-first: configs are Pydantic models with IDE/type checker support.
- Recipes as source: YAML recipes live in
configs/, carry schema + provenance in__stryx__, and stay human-readable. - Minimal surface: a single decorator powers run/new/show/list/edit; no global state or daemon.
- Reproducibility: defaults come from code, overrides are explicit, and recipes record lineage (
--from, overrides). - Non-goals: logging/metrics/backends (use W&B, MLflow, etc. alongside Stryx).
Quick start
- Install deps from the lockfile:
uv sync(add extras withuv add <pkg>→uv lock→uv sync). - Experiment with defaults or overrides (auto-saves to scratch):
uv run examples/train.py try(runs defaults)uv run examples/train.py try train.steps=500(runs variant)
- Manage recipes (strict reproducibility):
uv run examples/train.py new my_exp optim.lr=1e-4(create new recipe)uv run examples/train.py fork my_exp my_fork(branch existing recipe)uv run examples/train.py list(shows canonicals and scratches in a smart table)uv run examples/train.py diff my_exp defaults(compare recipes)uv run examples/train.py run my_exp(runs exactly what is saved, no overrides)uv run examples/train.py show my_exp(inspect values)uv run examples/train.py schema(inspect schema)
- Edit interactively:
uv run examples/train.py edit my_expopens the TUI editor.
CLI at a glance
@stryx.cli(schema=Config, recipes_dir="configs")wraps your entrypoint and adds commands: run (strict), new (create), try (scratchpad), fork (branch), show, list, edit, schema, diff.- Overrides (
train.steps=1000) are supported innew,tryandforkcommands. - Recipes include a
__stryx__block with schema, timestamp, lineage, and overrides for traceability.
Why not Hydra?
- Config sprawl: hierarchical
conf/trees and defaults lists bloat quickly and are hard to audit or refactor. Steep learning curve causes repeated values throughout config files. - Opaque resolution: OmegaConf/interpolation and custom resolvers add non-obvious runtime behavior that often breaks silently.
- Weak typing: YAML is the source of truth, so you lose IDE hints and static validation; errors land at runtime.
- Fragile composition: merging configs from multiple groups can produce surprising overrides; provenance is unclear. Learning curve is unnecessarily steep.
- Heavy indirection: plugins/launchers/sweep/global state layers for simple “run with overrides” workflows add cognitive load.
Stryx advantages
- Single source of truth: configs are Pydantic models with type hints, validation, and IDE completion.
- Plain recipes: YAML recipes stay small, readable, and include
__stryx__metadata for schema + lineage. - Predictable overrides: dot-path CLI overrides map directly to model fields; provenance is shown by
show. - Minimal surface: one decorator, a handful of commands; no global state, plugins, or hidden mutation.
- Repro-friendly: defaults come from code, recipes are immutable snapshots, and sequential naming is lock-safe.
- Execution Tracking: Automatically captures stdout, stderr, exceptions, and exit status in runs//manifest.yaml. Distributed-aware and safe.
- Interop-first: pair with your logging/observability stack instead of being locked into one.
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 stryx-0.1.0.tar.gz.
File metadata
- Download URL: stryx-0.1.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06592e4c3b302f14b239517a594a0841ae98fb15ffc71811c8fff49ebf1cff07
|
|
| MD5 |
c41251c7080e3cce8c0cf11ac649765a
|
|
| BLAKE2b-256 |
ed7207b0ab37b319be35110d658944b66c06beb4e9a8f7c910245196fe26ae10
|
File details
Details for the file stryx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stryx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eddd183231dd567375214a2c0139a497b7e44c4f3e03224efc72ced041853537
|
|
| MD5 |
78655d3b188c6f8425ed147291a8c7a9
|
|
| BLAKE2b-256 |
fabea7f6636a7d54477295cf56db9c4512c2bf2a35862961f6b4f5dbf808c943
|