--- id: ml-collections version: "1.1.0" license: unclear license_treatment: permissive maintenance: active --- # ml-collections — ML Collections is a library of Python collections designed for ML usecases. License: permissive · Maintenance: active · Downloads: 2.2M/mo ## What it is and what it does ML Collections provides ConfigDict and FrozenConfigDict—specialized dictionary classes designed for ML workflows. ConfigDict lets you access nested configuration values using dot notation (cfg.learning_rate) instead of bracket syntax, with built-in type checking to catch spelling mistakes and type mismatches. FrozenConfigDict is an immutable, hashable variant useful for passing configs as function arguments or storing them in sets. Both support lazy evaluation through FieldReferences, allowing one field to depend on another and recompute automatically when the source changes. The library depends on absl-py and PyYAML to handle logging and YAML serialization. It's widely used in ML research and production to centralize experiment hyperparameters, model settings, and training configurations in a single, strongly-typed object that's easier to reason about than plain dictionaries. Use it for: - Store and manage experiment hyperparameters with type safety to prevent configuration errors. - Create immutable, hashable configuration snapshots for reproducible ML experiments using FrozenConfigDict. - Define dependent configuration fields using lazy evaluation so changing a base value automatically updates derived values. - Serialize and deserialize experiment configs to YAML for easy version control and sharing across teams. - Prevent typos in nested config access by using dot notation with locking to catch misspelled field names early. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides dict-like configuration data structures with dot-notation access, type safety, and lazy evaluation for ML experiment and model configuration. Yes. ML Collections fills a genuine gap in Python ML tooling by providing type-safe, dot-accessible configuration objects with lazy evaluation. Low install friction, active maintenance, permissive license, and no known vulnerabilities make it a straightforward choice for any ML project that needs structured configuration management beyond plain dicts. ## Install pip install ml-collections uv add ml-collections poetry add ml-collections ## Installing ml-collections Before you install: Low friction install with only two lightweight runtime dependencies (absl-py and PyYAML). Active maintenance with recent releases; last commit 2026-07-07 and latest release 2025-04-17 indicate ongoing support. License in practice: Permissive license (Apache Software License per OSI approval) means you can use, modify, and distribute this package with minimal legal restrictions. Quickstart: pip install ml-collections from ml_collections import config_dict cfg = config_dict.ConfigDict() cfg.learning_rate = 12.6 cfg.nested = config_dict.ConfigDict() cfg.nested.string_field = 'tom' print(cfg.learning_rate) Requires Python 3.10 or later. Verify before relying: - Performance characteristics when working with deeply nested or very large ConfigDict structures. - Compatibility with popular ML frameworks (PyTorch, TensorFlow, JAX) beyond basic configuration storage. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags configuration management python, dict with dot notation access, typed config dictionaries, ml experiment configuration, lazy evaluation config, immutable frozen config, nested configuration objects, ml-config, experiment-management, type-safe-dicts [View on SkillFed](https://skillfed.io/packages/ml-collections) · [View on PyPI](https://pypi.org/project/ml-collections/)