Skip to main content

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

  1. Install deps from the lockfile: uv sync (add extras with uv add <pkg>uv lockuv sync).
  2. 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)
  3. 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)
  4. Edit interactively: uv run examples/train.py edit my_exp opens 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 in new, try and fork commands.
  • 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

stryx-0.1.0.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stryx-0.1.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

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

Hashes for stryx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06592e4c3b302f14b239517a594a0841ae98fb15ffc71811c8fff49ebf1cff07
MD5 c41251c7080e3cce8c0cf11ac649765a
BLAKE2b-256 ed7207b0ab37b319be35110d658944b66c06beb4e9a8f7c910245196fe26ae10

See more details on using hashes here.

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

Hashes for stryx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eddd183231dd567375214a2c0139a497b7e44c4f3e03224efc72ced041853537
MD5 78655d3b188c6f8425ed147291a8c7a9
BLAKE2b-256 fabea7f6636a7d54477295cf56db9c4512c2bf2a35862961f6b4f5dbf808c943

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page