Lazy Configuration for Python
Laco is a Python-first configuration system. It is for engineers who want Hydra's config composition, CLI overrides, and multirun sweeps, but with real imports and IDE support instead of magic strings. Config files are ordinary .py files. Hydra-compatible YAML is the wire format. Type safety comes from lie-typing, a deliberate mismatch between the static and runtime type that makes nested composition safe under both pyright and mypy.
pip install laco
Static types vs. runtime values
Six constructs in Laco declare a static type for the IDE while producing a DictConfig at runtime.
| Construct | Static type | Runtime type | Use case |
|---|---|---|---|
L.call(T)(...) | T | DictConfig | Lazy class construction |
L.partial(T)(...) | T | DictConfig | Deferred partial application |
L.just(v) | type(v) | DictConfig | Wrap an existing value |
L.required[T]() | T | DictConfig | Mandatory placeholder |
L.slot(G) | G | DictConfig | Group placeholder in schema |
L.chosen(G) | G | DictConfig | In-body reference to chosen entry |
laco.instantiate(node) closes the gap. It returns the genuine T, both statically and at runtime.
Start here
New to Laco? Follow the docs in order:
- Getting Started: install and run a five-minute example.
- Tutorials: an 11-notebook series that builds from first steps to production patterns. The fastest way to learn by doing.
- Concepts: the why and how behind the design, for when you want to understand a mechanism rather than just use it.
- How-To: task-oriented recipes for specific problems.
- Examples & API Reference: annotated source walkthroughs and the full symbol reference for day-to-day work.
All sections
| Section | Contents |
|---|---|
| Getting Started | Install, five-minute example |
| Tutorials | 11 Jupyter notebooks, beginner → production |
| Concepts | Why and how Laco works |
| How-To | Task-oriented recipes |
| Examples | Annotated source walkthroughs |
| Integrations | Optional extension packages |
| vs Hydra-zen | Side-by-side comparison |
| Migration 0.x → 1.0 | Upgrade guide |
| API Reference | Every public symbol |