draccus (dataclass-based configuration library)
draccus(dataclass 配置库)AdvancedA fork of pyrallis that defines configs as dataclasses and fills them in from the command line and config files.
draccus is a Python configuration library that David Hall (GitHub user dlwh) forked from pyrallis, released under the MIT license. You write your configuration as dataclasses and decorate the main function with @draccus.wrap(); at runtime it reads values from command-line arguments, a config file (YAML by default, JSON also supported), or both, and passes in a populated config object, with nested fields addressed in dot notation. Compared with pyrallis, it adds features such as switching between alternative sub-configs through a type field and pulling other files into a config with !include. Embodied-AI newcomers usually meet it in LeRobot and OpenVLA: when lerobot-train picks a policy with --policy.type=act, that's this mechanism at work, and LeRobot wraps it in its own parser that also lets --policy.path load a pretrained config from the Hugging Face Hub. OpenVLA's training and fine-tuning scripts use @draccus.wrap() directly, and training selects a preset config with --vla.type.
ExampleRunning lerobot-train --policy.type=act --dataset.repo_id=lerobot/aloha_mobile_cabinet has draccus fill those two values into the policy and dataset fields of the training config and leave everything else at its default.
- Related
- Hydra (Meta configuration framework) · tyro (type-safe CLI and config generation for Python) · LeRobot · OpenVLA · Hyperparameter
- Sources
- dlwh/draccus (GitHub)
LeRobot src/lerobot/configs/parser.py (GitHub)
OpenVLA vla-scripts/train.py (GitHub) - As of
- 2026-10