Open-source · MIT licensed · Python ≥ 3.11

Bayesian optimization you can read, run and extend

OpenBO is a Python library for research and teaching. It goes from a Gaussian process written in plain NumPy to transfer, continual, multi-objective and meta-learned BO. The servers are built for studies where a person evaluates each design.

$ git clone https://github.com/yichiliao/openbo.git && cd openbo && uv sync
Try it: Bayesian optimization in 1D
true objective (hidden from BO) GP mean ±2 std expected improvement

Each click evaluates the point that maximizes expected improvement (dashed orange line), refits the GP and recomputes the acquisition. This is the loop every OpenBO optimizer runs. More demos →

Why OpenBO

Most BO libraries are built for production use. OpenBO is built so people can see how each method works, compare methods fairly and use them in user studies.

Readable from scratch

A NumPy Gaussian process with RBF and Matérn-5/2 kernels, analytic EI and an ask/tell optimizer, benchmarked against a BoTorch version of the same loop. Five teaching notebooks walk from a hand-written BO loop to TAF, ConBO and NAF.

Transfer and meta-learning

Reuse what earlier tasks or earlier users taught you: TAF, TAF+, TAF-MOBO for several objectives, continual BO with a population model, and acquisition functions meta-trained with reinforcement learning, including NAF+, which reads each user's objective weights and falls back to EI for users unlike the training ones.

Several objectives

Learn a Pareto front with correlated objectives: multi-output GPs and the expected increase in Pareto hypervolume, with a BoTorch qLogNEHVI baseline.

Humans in the loop

Every optimizer but NAF+ has a WebSocket server. Your study app, game or device evaluates the designs, and OpenBO decides what to try next.

Reproducible benchmarks

Synthetic test functions, task families and archived benchmark campaigns, including 5-seed reproductions of the TAF+ and ConBO papers' simulations. Each archive has the script that reproduces it.

One interface

Each optimizer is an ask/tell class with suggest() and observe(). Scripts, benchmarks and servers all wrap the same classes.

A first run

Objectives take points in [0, 1]^d as an (n, d) array and return (n,) values to maximize.

python
from openbo.optimizers.bo_scratch import run_bo_scratch
from openbo.test_functions.registry import get_function_spec

spec = get_function_spec("branin")  # y = -Branin(x), x in [0, 1]^2
result = run_bo_scratch(spec.objective, bounds=[(0.0, 1.0)] * spec.dim,
                        n_init=5, n_iter=20, seed=0)
print(result.best_y_history[-1], spec.optimum)  # about -0.400 vs -0.398

Installation, conventions and server setup →

Results you can reproduce

Archived benchmark campaigns ship with the repository, with plots, trajectories and the scripts that produced them.

Median log10 simple regret over 30 evaluations on 100 Branin tasks for MetaBO's neural AF, TAF-ME-50, TAF-R-50, EI and random search.
NAF (MetaBO) on 100 unseen Branin tasks, against TAF, EI and random search.
Final Pareto fronts on OKA2 for CEIPV-SLF, CEIPV-MT, IEIPV, BoTorch qLogNEHVI and random search.
Pareto fronts found on OKA2 by the multi-objective methods.
Four panels, one per user range, showing log10 hypervolume regret over 20 evaluations for TAF+, TAF without decay, BO, random search, TAF-EHVI, qLogNEHVI, TAF-EIPV and IEIPV.
TAF-MOBO on the TAF+ simulation users: with earlier users as sources, TAF-EIPV covers the Pareto front fastest from its first design on.

All benchmark results →

Cite OpenBO

If OpenBO helps your research, please cite the library and the paper behind each method you use.

bibtex
@software{liao2026openbo,
  author    = {Yi-Chi Liao and Mark Colley and George Mo and Chih-Hao Hsu and Kuan-Lin Lee},
  title     = {{OpenBO}: An Open-Source Library for Bayesian Optimization},
  year      = {2026},
  publisher = {GitHub},
  url       = {https://github.com/yichiliao/openbo}
}

Papers implemented in OpenBO →

Also in Rust

OpenBO-Rust, contributed by Mark Colley, is a native Rust port of OpenBO: a library and an openbo command-line tool with no Python or PyTorch dependency, serving the same JSON ask/tell WebSocket sessions.

It is a separate project, maintained in its own repository and derived from an earlier OpenBO version, so some features of the Python library may be missing or behave differently, and its results are not numerically identical. Methods added to OpenBO since, such as NAF+, are not in it yet. The documentation and benchmark results on this site are for the Python version.

OpenBO-Rust on GitHub, with install instructions →