Event-driven agentic hyperparameter optimization framework
Project description
Hyperion
Hyperion is a modern hyperparameter optimization framework built for the agentic era. Unlike conventional libraries, it orchestrates and reasons about long-running, parallel experiments through an event-driven, agent-based architecture. Experiments are modeled as a dynamic exploration tree, enabling efficient branching, pruning, and adaptation across parallel runs while maintaining a transparent reasoning trace.
At its core, Hyperion is designed to be model-agnostic and support any training routine through a flexible interface: if you can wrap your training loop in Python, you can optimize it here. While still in early days, the aim is to make optimization composable, observable, and scalable—with faster results, less manual effort, and interpretable outcomes.
Key Features
- 🎯 Multiple Search Strategies: Random, Grid, Beam Search, Bayesian Optimization, Population-Based Training
- 🤖 Agent Integration: LLM-driven and rule-based agents for intelligent optimization
- 🌳 Lineage-Aware Trials: First-class support for branching search with trial ancestry tracking
- 📊 Full Observability: Complete event log with decision rationale and reproducible experiments
- 🚀 Progressive Scaling: From in-memory prototypes to distributed execution
- 🔧 Ergonomic API: High-level
tune()API with progressive disclosure to framework internals
Quick Start
Basic Optimization
from hyperion import tune, Float, Choice, ObjectiveResult
def objective(ctx, lr: float, batch_size: int) -> ObjectiveResult:
# Your training code here
score = train_model(lr=lr, batch_size=batch_size)
# Report progress during training
ctx.report(step=1, loss=0.5, accuracy=0.8)
# Check if we should stop early
if ctx.should_stop():
return ObjectiveResult(score=score)
return ObjectiveResult(score=score)
# Run optimization
result = tune(
objective=objective,
space={
"lr": Float(0.001, 0.1, log=True), # Log-scale sampling
"batch_size": Choice([32, 64, 128])
},
strategy="random",
max_trials=50,
max_concurrent=4,
show_progress=True, # Display live progress
show_summary=True, # Show final summary
)
print(f"Best params: {result['best']}")
Using Different Search Strategies
# Beam Search - Tree-based exploration with pruning
result = tune(
objective=objective,
space=space,
strategy="beam_search",
strategy_kwargs={
"K": 3, # Keep top 3 trials per depth
"width": 2, # Generate 2 children per parent
"max_depth": 4, # Maximum search tree depth
},
max_trials=100,
max_concurrent=4,
)
# Grid Search - Exhaustive search over discrete values
from hyperion import Int
result = tune(
objective=objective,
space={
"lr": Choice([0.001, 0.01, 0.1]),
"batch_size": Choice([32, 64]),
"layers": Int(2, 4),
},
strategy="grid",
max_concurrent=4,
)
# LLM Agent - AI-powered optimization (provider-agnostic)
result = tune(
objective=objective,
space=space,
strategy="llm_agent",
strategy_kwargs={
"llm": ..., # Provide any LLM via a simple callable (prompt: str) -> str
"max_history": 20,
},
max_trials=50,
max_concurrent=2,
)
With Persistent Storage
# Use SQLite to persist experiment data
result = tune(
objective=objective,
space=space,
strategy="random",
max_trials=100,
storage="sqlite:///experiments.db", # Save to database
)
# Results are automatically saved and can be analyzed later
Web UI
Hyperion includes a web dashboard for real-time experiment monitoring and visualization. The dashboard provides:
- Live Experiment Tracking: Monitor running experiments with real-time updates via WebSocket
- Interactive Lineage Graph: Visualize trial relationships and branching patterns
- Metrics Dashboard: Track performance metrics, compare trials, and identify trends
- Event Timeline: Audit trail of all decisions and actions with full context
Running the Dashboard
# Start both backend and frontend
mise run ui
# Or run them separately:
mise run ui-backend # FastAPI server on port 8000
mise run ui-frontend # React app on port 5173
The dashboard automatically connects to your SQLite database and provides both live monitoring (when running in-process) and historical analysis capabilities.
Architecture
Hyperion follows a layered architecture so you can use as much or as little of it as you like:
- Core Layer: Events, commands, controller, executors, and storage primitives
- Framework Layer: Experiments, policies, search spaces, and callbacks
- API Layer: High-level functions like
tune()andoptimize() - Interface Layer: CLI and optional web UI
This separation keeps the internals composable while letting you choose your level of control. Most users will start at the API and only drop down when necessary.
Documentation
- API Guide - Complete guide to using the high-level API
- Framework Guide - Advanced usage and customization
- Examples - Runnable example scripts for various use cases
Installation
From PyPI
# Install base package
pip install hyperion-opt
Note: The web UI (backend + React frontend) is currently developed and run from the repository. Installing from PyPI does not include the UI app itself; to run the dashboard, clone the repo and use the commands in the Web UI section below.
From Source
For development or to use the latest unreleased features:
# Clone the repository
git clone https://github.com/Subjective/hyperion.git
cd hyperion
# Install in editable mode with development dependencies
mise run install-dev
# Or using pip directly
pip install -e ".[dev]"
Development
This project uses:
- mise for environment management
- uv for fast package management
- ruff for linting and formatting
- pyright for type checking
- pytest for testing
Common development tasks:
mise run fix # Fix lint issues and format code
mise run check # Run all checks (lint, type-check, test)
mise run test # Run tests
mise run install-dev # Install with dev dependencies
License
This project is licensed under the MIT License.
Status
Hyperion is currently in active development. Expect breaking changes as the framework evolves. Contributions and feedback are welcome.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyperion_opt-0.1.0.tar.gz.
File metadata
- Download URL: hyperion_opt-0.1.0.tar.gz
- Upload date:
- Size: 5.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a3190dc2ab33c55be2245b520dd7b00ff78465ee54c1ccf6ba96503fe9f178a
|
|
| MD5 |
efb79d727de5f96332acd13edf597ab3
|
|
| BLAKE2b-256 |
fe37ca077383d71b8b64ddfd18d74128662cdcfc8a1e08f1b96d95f913a339ec
|
Provenance
The following attestation bundles were made for hyperion_opt-0.1.0.tar.gz:
Publisher:
publish.yml on Subjective/hyperion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_opt-0.1.0.tar.gz -
Subject digest:
2a3190dc2ab33c55be2245b520dd7b00ff78465ee54c1ccf6ba96503fe9f178a - Sigstore transparency entry: 472163609
- Sigstore integration time:
-
Permalink:
Subjective/hyperion@75dc159f22ef850a5504101a891432f33ba9b0cd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Subjective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75dc159f22ef850a5504101a891432f33ba9b0cd -
Trigger Event:
release
-
Statement type:
File details
Details for the file hyperion_opt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hyperion_opt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 72.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23bb6f71d95b2f64e25787af5d18418d3a3595394214fb36727f9d584a317ee7
|
|
| MD5 |
6596a1fbb7fe5dee62e4f2d4e20297b9
|
|
| BLAKE2b-256 |
afe5c29b59859318615c17432a812669f56eac8fb2a59b19061b12a604d20297
|
Provenance
The following attestation bundles were made for hyperion_opt-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Subjective/hyperion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_opt-0.1.0-py3-none-any.whl -
Subject digest:
23bb6f71d95b2f64e25787af5d18418d3a3595394214fb36727f9d584a317ee7 - Sigstore transparency entry: 472163689
- Sigstore integration time:
-
Permalink:
Subjective/hyperion@75dc159f22ef850a5504101a891432f33ba9b0cd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Subjective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75dc159f22ef850a5504101a891432f33ba9b0cd -
Trigger Event:
release
-
Statement type: