botorch
Bayesian Optimization in PyTorch
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.11, PyTorch >= 2.0.1, and gpytorch >= 1.14.
- Double precision (torch.double) is highly recommended for Gaussian Process models.
- Low friction install with a pure-Python wheel.
License · maintenance · safety
MIT (permissive) — MIT licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.
last release 2026-06-08 (67 days) · last repo commit 2026-08-14 · 3,584 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 827,975 downloads/mo, #4,955 on PyPI
Alternatives
Verify before relying
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)- 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.
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 on it.
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
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.
Requires Python >= 3.11, PyTorch >= 2.0.1, and gpytorch >= 1.14. Double precision (torch.double) is highly recommended for Gaussian Process models.
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)
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 packagestyping_extensionspyre_extensionsgpytorchlinear_operatortorchscipymultipledispatchthreadpoolctlninja |
| 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 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering |
Evidence: botorch-0.18.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “bayesian optimization pytorch”
- botorchBoTorch provides a modular, PyTorch-based framework for building…
- optunaOptuna is a hyperparameter optimization framework that automates the…
- pyro-pplPyro is a deep probabilistic programming library built on PyTorch…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also ax-platform · bayesian-optimization · gpytorch · pyro-ppl · hyperopt · pymc3 · pyro-api · optuna-integration · tensorflow-probability · scikit-optimize