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
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.
Methods
Each method follows a published paper, with deviations recorded in the repository's design notes; TAF-MOBO is OpenBO's own.
Standard BO
GP with expected improvement, from scratch in NumPy or with BoTorch.
Read more → TransferTAF
Transfer acquisition function: source-task GPs guide search on a new task.
Read more → TransferSeveral objectivesTAF+
Transfer across users with several objectives and a decaying population prior.
Read more → ContinualContinual BO (ConBO)
A population model, a Bayesian neural network, that keeps learning as users arrive one after another.
Read more → Meta-learnedNAF (MetaBO)
A neural acquisition function trained with reinforcement learning on a family of tasks.
Read more → Meta-learnedWeighted objectivesNAF+
A neural acquisition function that reads each user's objective weights, with a novelty detector that falls back to EI.
Read more → Several objectivesMulti-objective BO
Correlated multi-output GPs and the expected increase in Pareto hypervolume.
Read more → TransferSeveral objectivesTAF-MOBO
Transfer acquisition function for multi-objective BO: earlier users' models guide the search for a new user's Pareto front.
Read more →A first run
Objectives take points in [0, 1]^d as an (n, d) array and return (n,) values to maximize.
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.398import numpy as np
from openbo.optimizers.bo_scratch import ScratchConfig, ScratchSequentialOptimizer
def run_trial(x):
"""Your experiment: (n, d) points in [0, 1]^d -> (n,) values to maximize."""
return -np.sum((x - 0.3) ** 2, axis=1)
opt = ScratchSequentialOptimizer(ScratchConfig(bounds=[(0.0, 1.0)] * 2, n_init=3, seed=0))
opt.bootstrap(run_trial) # random initial designs
for _ in range(10):
x = opt.suggest() # shape (1, 2)
opt.observe(x, run_trial(x))
print(opt.result().best_y_history[-1])# Random search vs. BoTorch BO on Branin, then a log-regret plot
uv run python scripts/run_benchmark.py --method random --function branin
uv run python scripts/run_benchmark.py --method bo_botorch --function branin
uv run python scripts/plot_results.py --methods random bo_botorch --function braninimport asyncio, json
import websockets
async def main():
async with websockets.connect("ws://127.0.0.1:8765") as ws:
await ws.send(json.dumps({"type": "start", "n_init": 2, "n_iter": 8, "seed": 0}))
msg = json.loads(await ws.recv())
while msg["type"] != "done":
x = msg["x"] # the next design
y = -((x[0] - 0.25) ** 2 + (x[1] - 0.75) ** 2) # your evaluation
await ws.send(json.dumps({"type": "observe", "x": x, "y": y}))
msg = json.loads(await ws.recv())
print(msg["best_x"], msg["best_value"])
asyncio.run(main())Results you can reproduce
Archived benchmark campaigns ship with the repository, with plots, trajectories and the scripts that produced them.



Cite OpenBO
If OpenBO helps your research, please cite the library and the paper behind each method you use.
@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}
}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.