Skip to main content

A flexible configuration system for Python projects

Project description

Hypster Logo

[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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypster-0.2.32.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

hypster-0.2.32-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file hypster-0.2.32.tar.gz.

File metadata

  • Download URL: hypster-0.2.32.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/23.6.0

File hashes

Hashes for hypster-0.2.32.tar.gz
Algorithm Hash digest
SHA256 ca2704a039ee202cbccbf8ffec1004b1eb6cf7c9f220b27069f5ab4513f34f63
MD5 5c597b99d64a680e489d581161bc0e04
BLAKE2b-256 f5d187336017974eeef15f2fa8e3f8b57bd5f4ad243799b5a44634b5f29aea5f

See more details on using hashes here.

File details

Details for the file hypster-0.2.32-py3-none-any.whl.

File metadata

  • Download URL: hypster-0.2.32-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Darwin/23.6.0

File hashes

Hashes for hypster-0.2.32-py3-none-any.whl
Algorithm Hash digest
SHA256 46b8df3c33f0a26bc73d2daf73fba50c486068659a99d16354b41365c89e4c63
MD5 8ebd8418a4f1ab80287790d4e921a2ba
BLAKE2b-256 f230588623b7eb2e12db84ba20a3df879b86eda6a2dc77fc99f6b152b0c3f5e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page