MCPcopy Index your code
hub / github.com/blackrock/HOLA

github.com/blackrock/HOLA @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,214 symbols 4,946 edges 91 files 323 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

HOLA

Hyperparameter Optimization, Lightweight Asynchronous. A Python library for black-box optimization, backed by a Rust engine for speed.

We provide a simple ask/tell interface that works the same way whether the engine runs in your Python process or on a remote server. Define a parameter space, choose an objective, and let HOLA suggest trials.

Installation

Pre-built wheels are available for Linux, macOS, and Windows (Python 3.10+).

pip install hola-opt --extra-index-url https://blackrock.github.io/HOLA/simple/

To build from source instead, see the Getting Started guide.

Quick Start

This example minimizes the one-dimensional Forrester function, a standard benchmark with a known minimum of approximately -6.03 near x = 0.757.

from hola_opt import Study, Space, Real, Minimize
import math

study = Study(
    space=Space(x=Real(0.0, 1.0)),
    objectives=[Minimize("value")],
    strategy="sobol",
    seed=42,
)

def forrester(params):
    x = params["x"]
    term = 6 * x - 2
    return {"value": term ** 2 * math.sin(term / 2)}

study.run(forrester, n_trials=50)

best = study.top_k(1)[0]
print(f"Best value: {best.score_vector['value']:.4f}")
print(f"At x = {best.params['x']:.4f}")

Space(x=Real(0.0, 1.0)) defines a single continuous parameter. Minimize("value") tells HOLA to minimize the "value" field returned by the objective function. study.run(forrester, n_trials=50) automates 50 ask/tell iterations. study.top_k(1) returns a one-element list; element [0] is the best CompletedTrial. Its .score_vector maps each objective group to its scalarized score (here the single "value" objective), alongside .params and .metrics.

Going Distributed

For multi-machine or language-agnostic deployments, HOLA provides a CLI server and worker. Start a server from a YAML study configuration, then point workers at it.

# Terminal 1: start the server
hola serve config.yaml --port 8000

# Terminal 2: run a worker
hola worker --server http://localhost:8000 --exec "python train.py"

The worker sets HOLA_SERVER, HOLA_TRIAL_ID, and HOLA_PARAMS environment variables, then runs your command. Your script reads its parameters from HOLA_PARAMS and calls POST /api/tell on the server to report results. See the CLI guide for details.

From Python, Study.connect() speaks the same REST protocol without the CLI.

study = Study.connect("http://localhost:8000")
trial = study.ask()
study.tell(trial.trial_id, {"loss": 0.42})

Dashboard

The dashboard/ directory contains a zero-install browser UI for monitoring live studies or exploring saved checkpoints. Open dashboard/index.html, enter a server URL, and see convergence plots, Pareto scatter, parallel coordinates, and a sortable trial table, all updated in real time via SSE.

Documentation

Guide Description
Getting Started Installation, first optimization, verification
Python Guide Full Python API: spaces, objectives, strategies, Study, Study.connect()
CLI & Distributed YAML config, hola serve, hola worker, multi-machine setup
REST API Endpoint reference with request/response schemas
Concepts Architecture, strategies, scalarization, the unit hypercube
Dashboard Real-time visualization and checkpoint analysis

Development

# Run all Rust tests
cargo test --workspace --all-features

# Build and test Python bindings
cd hola-py && uv sync --dev && uv run maturin develop && cd ..
hola-py/.venv/bin/python -m pytest hola-py/tests/ -v

# Lint
cargo clippy --workspace --all-features -- -D warnings
uv run --project hola-py ruff check .

License

Licensed under Apache 2.0.

Extension points exported contracts — how you extend this code

SampleSpace (Interface)
Defines the structure and validity rules for a hyperparameter search space. Every optimization problem starts with a `S [11 …
opt_engine/src/traits.rs
StandardizedSpace (Interface)
Optional extension of [`SampleSpace`] that provides a bijection to the unit hypercube `[0, 1]^n`. Strategies like [`Ran [11 …
opt_engine/src/traits.rs
Strategy (Interface)
A search algorithm that proposes candidate configurations and learns from results. The two associated types wire the st [4 …
opt_engine/src/traits.rs
Scale (Interface)
A bijective transformation between a linear internal space and the user-facing actual space. `forward` maps internal → [3 …
opt_engine/src/scales.rs
RefittableStrategy (Interface)
Extension trait for strategies that can refit their internal distribution from historical trial data. This is separate [2 …
opt_engine/src/traits.rs

Core symbols most depended-on inside this repo

push
called by 262
opt_engine/src/leaderboard.rs
iter
called by 125
opt_engine/src/leaderboard.rs
clone
called by 112
hola/src/hola_engine.rs
ask
called by 90
hola/src/hola_engine.rs
ask
called by 74
hola-py/src/lib.rs
len
called by 68
opt_engine/src/leaderboard.rs
get
called by 65
opt_engine/src/leaderboard.rs
tell
called by 64
hola/src/hola_engine.rs

Shape

Function 786
Method 312
Class 98
Enum 12
Interface 5
Route 1

Languages

Rust67%
Python28%
TypeScript5%

Modules by API surface

opt_engine/src/leaderboard.rs150 symbols
hola/src/hola_engine.rs146 symbols
opt_engine/src/strategies/gmm.rs71 symbols
dashboard/app.js59 symbols
hola/tests/integration/hola_engine.rs56 symbols
hola-py/tests/test_hola.py56 symbols
opt_engine/src/persistence.rs48 symbols
hola/src/server.rs42 symbols
hola-py/src/lib.rs38 symbols
hola/tests/integration/server.rs36 symbols
hola-py/tests/test_study_advanced.py35 symbols
hola-py/tests/test_server.py34 symbols

For agents

$ claude mcp add HOLA \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact