Conflag 🔥🏁
Conflag is a data language. It's perfect for application configuration, once those configurations grow beyond a few command line flags or a 5-line JSON file.
Example use cases for Conflag:
- Service deployment -- eg. replacing json/yaml for Kubernetes or nginx configs
- Continuous integration -- eg. replacing yaml for Github Actions
- ML experiments -- eg. replacing code for repeatable and replicable experiment parameters)
- Developer tooling -- eg. replacing JSON for VS Code or Sublime text configs
Write your data declaratively, but with table-stakes like references, comments, and multiple files.
Any valid JSON file is already a valid Conflag file, so migration is easy, and the syntax is clear and easy to read. Get started in minutes and leave JSON behind.
Getting started
Rust with Serde:
cargo add conflag --features serde
Python:
git clone https://github.com/bethebunny/conflag
cd conflag
cargo build --release --features python
cp target/release/libconflag.so conflag.so
Meet the language
Write a config file: object.cfg
Read into Rust struct with Serde
Read from Python
>>>
>>> =
>>>
>>>
>>>
More language details
A more complex example
The following config will load to a list of model hyperparameter configs, running a parameter sweep over values for a dropout parameter.
It demonstrates a few features, such as
- the builtin
ifandmapfunctions - anonymous scopes -- the output is an array, rather than an object, and see how the arange function creates an anonymous scope
- patching -- notice how we can easily make variants of
model_paramswith fine-grained adjustments
.