ml-collections
ML Collections is a library of Python collections designed for ML usecases.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- 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 · maintenance · safety
permissive license (permissive) — Permissive license (Apache Software License per OSI approval) means you can use, modify, and distribute this package with minimal legal restrictions.
last release 2025-04-17 (484 days) · last repo commit 2026-07-07 · 1,039 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,197,822 downloads/mo, #3,218 on PyPI
Alternatives
Verify before relying
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)- Performance characteristics when working with deeply nested or very large ConfigDict structures.
- Compatibility with popular ML frameworks (PyTorch, TensorFlow, JAX) beyond basic configuration storage.
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 on this page. Verify before relying on it.
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
ml-collections on PyPI
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.
Requires Python 3.10 or later.
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)
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesabsl-pyPyYAML |
| Maintenance | Actively maintained 484 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,197,822 / month, #3,218 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: ml_collections-1.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “typed config dictionaries”
- ml-collectionsProvides dict-like configuration data structures with dot-notation…
- pyhoconParses HOCON (Human-Optimized Config Object Notation) configuration…
- daciteConverts dictionaries into dataclass instances with support for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also itypes · constantdict · super-collections · yacs · fiddle · jaraco.collections · json-ref-dict · immutables · frozendict · python-box