A flexible configuration system for Python projects
Project description
[Documentation] | [Installation] | [Quick Start]
Hypster
is a lightweight configuration system for AI & Machine Learning projects.
It offers minimal, intuitive pythonic syntax, supporting hierarchical and swappable configurations.
Installation
You can install Hypster using pip:
pip install hypster
Quick Start
Here's a simple example of how to use Hypster:
from hypster import HP, config
@config
def my_config(hp: HP):
chunking_strategy = hp.select(['paragraph', 'semantic', 'fixed'], default='paragraph')
llm_model = hp.select({'haiku': 'claude-3-haiku-20240307',
'sonnet': 'claude-3-5-sonnet-20240620',
'gpt-4o-mini': 'gpt-4o-mini'}, default='gpt-4o-mini')
llm_config = {'temperature': hp.number(0),
'max_tokens': hp.number(64)}
system_prompt = hp.text('You are a helpful assistant. Answer with one word only')
Now we can instantiate the configs with our values:
results = my_config(final_vars=["chunking_strategy", "llm_config", "llm_model"],
values={"llm_model" : "haiku", "llm_config.temperature" : 0.5})
Inspiration
Hypster draws inspiration from Meta's hydra and hydra-zen framework. The API design is influenced by Optuna's "define-by-run" API.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hypster-0.2.34.tar.gz
.
File metadata
- Download URL: hypster-0.2.34.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.13.0 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44470669e5de153de6cb0c52adad97945be6996e677f72cb9a1825ee481b584b |
|
MD5 | 5f131f53007f94d144a8a5f4d2e60c65 |
|
BLAKE2b-256 | 6c0b73a993d168702a11c8e2f87e3456f64572fba9919693c9d9b92e9ec1b06d |
File details
Details for the file hypster-0.2.34-py3-none-any.whl
.
File metadata
- Download URL: hypster-0.2.34-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.13.0 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcfc79e9fe046b3ad1e0d3c63f74b376299991939cce064b8f408dd745ab6f8e |
|
MD5 | 3ec87e4c6528b5938ea2ca4a45d655c1 |
|
BLAKE2b-256 | 83535ae46121bb6758d6813a64b632cdda812d59ebb832b3e6aec0ec21a0d613 |