👋Welcome

Hypster is a lightweight framework for defining configurations functions to optimize ML & AI workflows.

Key Features

  • 🐍 Pythonic API: Intuitive & minimal syntax that feels natural to Python developers

  • 🪆 Hierarchical Configurations: Support for nested and swappable configurations

  • 📐 Type Safety: Built-in type hints and validation using Pydantic

  • 📦 Portability: Easy serialization and loading of configurations

  • 🧪 Experiment Ready: Built-in support for hyperparameter optimization

  • 🎮 Interactive UI: Jupyter widgets integration for interactive parameter selection

Show your support by giving us a star! ⭐

How Does it work?

1

Install Hypster

pip install hypster
2

Define a configuration space

from hypster import config, HP


@config
def llm_config(hp: HP):
    model_name = hp.select(["gpt-4o-mini", "gpt-4o"])
    temperature = hp.number(0.0, min=0.0, max=1.0)
3

Instantiate your configuration

results = my_config(values={"model" : "gpt-4o", "temperature" : 1.0})
4

Define an execution function

def generate(prompt: str, model_name: str, temperature: float) -> str:
    model = llm.get_model(model_name)
    response = model.prompt(prompt, temperature=temperature)
    return response
5

Execute!

generate(prompt="What is Hypster?", **results)

Discover Hypster

Why Use Hypster?

In modern AI/ML development, we often need to handle multiple configurations across different scenarios. This is essential because:

  1. We don't know in advance which hyperparameters will best optimize our performance metrics and satisfy our constraints.

  2. We need to support multiple "modes" for different scenarios. For example:

    1. Local vs. Remote Environments, Development vs. Production Settings

    2. Different App Configurations for specific use-cases and populations

Hypster takes care of these challenges by providing a simple way to define configuration spaces and instantiate them into concrete workflows. This enables you to easily manage and optimize multiple configurations in your codebase.

Additional Reading

Last updated

Was this helpful?