skillfed

botorch

Bayesian Optimization in PyTorch

botorch v0.18.1 828.0K downloads/30d#4,955 on PyPI3,584
Permissive license MIT Active released

What it is and what it does

BoTorch is a Bayesian optimization library built on PyTorch that lets researchers and practitioners compose optimization algorithms from modular components: probabilistic models (especially Gaussian Processes via gpytorch), acquisition functions, and optimizers. It leverages PyTorch's autodifferentiation and GPU support to enable efficient Monte Carlo-based acquisition function optimization without restrictive modeling assumptions.

The library targets researchers and sophisticated practitioners doing active research on Bayesian optimization algorithms. BoTorch supports advanced probabilistic models including multi-task Gaussian Processes, deep kernel learning, and deep GPs, making it suitable for complex optimization problems that integrate with deep learning architectures.

Use it for:

  • Compose custom Bayesian optimization algorithms from probabilistic models, acquisition functions, and optimizers for research.
  • Optimize expensive black-box functions using Gaussian Process models with GPU acceleration for large-scale optimization.
  • Integrate Bayesian optimization into deep learning pipelines using PyTorch's autodifferentiation and GPU support.
  • Experiment with advanced probabilistic models like multi-task GPs or deep GPs for structured optimization problems.
  • Build acquisition function variants using the reparameterization trick without restrictive modeling assumptions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

BoTorch provides a modular, PyTorch-based framework for building Bayesian optimization algorithms with probabilistic models, acquisition functions, and optimizers.

Yes, if you are a researcher or sophisticated practitioner actively developing Bayesian optimization algorithms. The library is actively maintained, has low install friction, and offers a modular, extensible interface backed by PyTorch's performance and GPU support. No if you are an end-user seeking a simple optimization tool. The beta status and requirement for Python >= 3.11 and PyTorch >= 2.0.1 reflect active development.

Install

botorch on PyPI

pip

pip install botorch

uv

uv add botorch

poetry

poetry add botorch

Installing botorch

Before you install

Low friction install with a pure-Python wheel. Requires PyTorch >= 2.0.1 and gpytorch >= 1.14 as core dependencies. Actively maintained with recent releases; last commit 2026-08-14 and 3584 repository stars indicate ongoing development.

License in practice

MIT licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install botorch

import torch
from botorch.models import SingleTaskGP
from botorch.fit import fit_gpytorch_mll
from gpytorch.mlls import ExactMarginalLogLikelihood

train_X = torch.rand(10, 2, dtype=torch.double)
train_Y = torch.rand(10, 1, dtype=torch.double)
gp = SingleTaskGP(train_X=train_X, train_Y=train_Y)
mll = ExactMarginalLogLikelihood(gp.likelihood, gp)
fit_gpytorch_mll(mll)

Requires Python >= 3.11, PyTorch >= 2.0.1, and gpytorch >= 1.14. Double precision (torch.double) is highly recommended for Gaussian Process models.

Verify before relying

  • Whether the package's beta status (Development Status :: 4 - Beta) indicates API stability concerns for production use.
  • Performance characteristics when scaling to large datasets or high-dimensional optimization problems.
  • Integration patterns and whether direct use versus higher-level tools is appropriate for your use case.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 9 — typing_extensions, pyre_extensions, gpytorch, linear_operator, torch, scipy, multipledispatch, threadpoolctl, ninja
Maintenance actively maintained — 67 days since the last release
Last repo commit
First released
Downloads 827,975/month — #4,955 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: botorch-0.18.1-py3-none-any.whl

Keywords: Bayesian optimization, PyTorch

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering

Tags

bayesian optimization pytorchgaussian process optimizationacquisition function optimizationmonte carlo bayesian optimizationhyperparameter tuning frameworkprobabilistic model optimizationgpytorch bayesian optimization
bayesian-optimizationgaussian-processespytorch-based

More Scientific/Engineering packages

Further reading