Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Pythonic config generation for Hydra (hydra-zen). Eliminates hand-written YAML by generating structured dataclass configs directly from Python objects and functions. Provides make_config, builds, zen, store, and launch utilities for configurable, reproducible, and scalable workflows. Use for typed experiment configuration, Hydra boilerplate reduction, and Python-first ML workflow design.
.claude/skills/mkurman-hydra-zen/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 47% | 0% |
hydra-zen is a Python-first layer on top of Hydra that removes most Hydra-specific boilerplate and eliminates hand-written YAML configs. It dynamically generates structured dataclass configs from functions, classes, and call signatures, then integrates them into Hydra workflows. Use this skill when you want typed, composable, reproducible experiment configuration without maintaining large YAML trees.
This skill should be used when:
bashpip install hydra-zen
builds() — Generate Configs from Callablespythonfrom hydra_zen import builds from torch.optim import AdamW AdamWConf = builds(AdamW, lr=1e-3, weight_decay=1e-2) # AdamWConf is a dataclass config that Hydra can instantiate
You can create configs for:
instantiate() — Materialize from Configpythonfrom hydra_zen import builds, instantiate from torch.optim import AdamW AdamWConf = builds(AdamW, lr=1e-3, weight_decay=1e-2) optimizer = instantiate(AdamWConf)
make_config() — Typed Ad Hoc Configspythonfrom hydra_zen import make_config TrainConfig = make_config( learning_rate=1e-3, batch_size=64, max_epochs=20, model_name="resnet50", ) cfg = TrainConfig() print(cfg.learning_rate)
Useful when you just need a typed config object without defining a full dataclass manually.
store() — Register Configs with Hydrapythonfrom hydra_zen import store, builds from torch.optim import AdamW, SGD store(group="optimizer")( builds(AdamW, lr=1e-3), name="adamw" ) store(group="optimizer")( builds(SGD, lr=0.1, momentum=0.9), name="sgd" )
This gives you Hydra config-group behavior without maintaining YAML files.
zen() — Wrap Task Functionspythonfrom hydra_zen import zen def train(model, optimizer, epochs: int = 10): print(model, optimizer, epochs) train_task = zen(train) train_task(model="resnet50", optimizer="adamw", epochs=20)
zen() helps bridge normal Python functions and Hydra-configurable execution.
pythonfrom hydra_zen import builds, store, zen from torch.optim import AdamW from torchvision.models import resnet50 ModelConf = builds(resnet50, pretrained=False, num_classes=10) OptimConf = builds(AdamW, lr=1e-3) store(group="model", name="resnet50")(ModelConf) store(group="optimizer", name="adamw")(OptimConf) @zen def train(model, optimizer, epochs=10): print("Model:", model) print("Optimizer:", optimizer) print("Epochs:", epochs) if __name__ == "__main__": train.hydra_main( config_name=None, version_base="1.3", )
launch() — Programmatic Hydra Runspythonfrom hydra_zen import builds, launch def train(lr: float, batch_size: int): return {"lr": lr, "batch_size": batch_size} Conf = builds(train, lr=1e-3, batch_size=64) job = launch(Conf) print(job.return_value)
Useful for notebook workflows, testing, and programmatic sweep orchestration.
pythonfrom hydra_zen import builds, instantiate from torch.optim import AdamW from torchvision.models import resnet18 ModelConf = builds(resnet18, num_classes=100) OptimConf = builds(AdamW, lr=1e-4) ExperimentConf = builds( dict, model=ModelConf, optimizer=OptimConf, seed=42, hydra_convert="all", ) exp = instantiate(ExperimentConf) print(exp["seed"])
pythonfrom hydra_zen import builds, store, zen from pytorch_lightning import Trainer TrainerConf = builds( Trainer, max_epochs=50, accelerator="auto", devices=1, ) store(group="trainer", name="default")(TrainerConf) @zen def run_training(trainer, model, datamodule): trainer.fit(model, datamodule)
This works especially well for:
builds() over handwritten YAML for Python-heavy projects.store() to recreate Hydra config groups with less maintenance.zen() to wrap normal task functions into config-driven workflows.launch() in tests/notebooks when CLI Hydra feels heavy.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 14,141 | 9,466 | -33% | 1 | 1 | 0% | 2,832 | 3,257 | +15% | 0 | 0 | — |
case-02 | fail→pass | 10,636 | 4,780 | -55% | 1 | 1 | 0% | 1,860 | 2,367 | +27% | 0 | 0 | — |
case-03 | fail→pass | 13,981 | 7,162 | -49% | 1 | 1 | 0% | 2,566 | 2,763 | +8% | 0 | 0 | — |
case-04 | pass→pass | 9,247 | 3,018 | -67% | 1 | 1 | 0% | 1,563 | 1,946 | +25% | 0 | 0 | — |
case-05 | fail→pass | 11,278 | 3,898 | -65% | 1 | 1 | 0% | 2,077 | 2,114 | +2% | 0 | 0 | — |
case-06 | pass→pass | 4,073 | 1,609 | -60% | 1 | 1 | 0% | 549 | 1,658 | +202% | 0 | 0 | — |
case-07 | fail→pass | 7,600 | 2,982 | -61% | 1 | 1 | 0% | 1,364 | 2,004 | +47% | 0 | 0 | — |
case-08 | pass→pass | 3,948 | 3,216 | -19% | 1 | 1 | 0% | 674 | 2,062 | +206% | 0 | 0 | — |
case-09 | pass→pass | 6,050 | 2,526 | -58% | 1 | 1 | 0% | 954 | 1,895 | +99% | 0 | 0 | — |
case-10 | fail→pass | 8,436 | 3,612 | -57% | 1 | 1 | 0% | 1,472 | 2,117 | +44% | 0 | 0 | — |
case-11 | fail→pass | 7,467 | 5,829 | -22% | 1 | 1 | 0% | 1,042 | 2,592 | +149% | 0 | 0 | — |
case-12 | pass→pass | 6,543 | 2,136 | -67% | 1 | 1 | 0% | 1,081 | 1,844 | +71% | 0 | 0 | — |
case-13 | pass→pass | 5,603 | 3,346 | -40% | 1 | 1 | 0% | 903 | 2,000 | +121% | 0 | 0 | — |
case-14 | pass→pass | 8,720 | 2,300 | -74% | 1 | 1 | 0% | 1,455 | 1,868 | +28% | 0 | 0 | — |
case-15 | pass→pass | 7,082 | 3,574 | -50% | 1 | 1 | 0% | 1,132 | 2,113 | +87% | 0 | 0 | — |
case-16 | pass→pass | 8,272 | 3,951 | -52% | 1 | 1 | 0% | 1,429 | 2,135 | +49% | 0 | 0 | — |
case-17 | pass→pass | 13,634 | 4,355 | -68% | 1 | 1 | 0% | 2,417 | 2,283 | -6% | 0 | 0 | — |
case-18 | pass→pass | 10,760 | 5,250 | -51% | 1 | 1 | 0% | 1,869 | 2,426 | +30% | 0 | 0 | — |
case-19 | pass→pass | 3,828 | 3,927 | +3% | 1 | 1 | 0% | 610 | 2,083 | +241% | 0 | 0 | — |
case-20 | pass→pass | 3,121 | 2,235 | -28% | 1 | 1 | 0% | 502 | 1,832 | +265% | 0 | 0 | — |
case-21 | pass→pass | 3,042 | 4,029 | +32% | 1 | 1 | 0% | 554 | 2,189 | +295% | 0 | 0 | — |
case-22 | pass→pass | 6,725 | 3,548 | -47% | 1 | 1 | 0% | 1,105 | 2,044 | +85% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.