BoTorch is a library for Bayesian optimization built on PyTorch. It provides a modular and extensible interface for composing Bayesian optimization primitives including probabilistic models, acquisition functions, and optimizers. The library harnesses PyTorch's auto-differentiation, GPU support through device-agnostic code, and dynamic computation graphs. It implements Monte Carlo-based acquisition functions via the reparameterization trick, enabling straightforward implementation of new ideas without restrictive modeling assumptions. The tool integrates seamlessly with deep and convolutional architectures in PyTorch and offers first-class support for state-of-the-art probabilistic models from GPyTorch, including multi-task Gaussian Processes, deep kernel learning, deep GPs, and approximate inference.
BoTorch targets researchers and sophisticated practitioners actively working on Bayesian optimization and AI. The README explicitly recommends it as a low-level API for implementing new algorithms, with the higher-level Ax platform recommended for end-users not conducting research on Bayesian optimization itself. The modular design allows researchers to experiment with novel acquisition functions and model compositions without being constrained by the assumptions of existing frameworks.
The project maintains active development with multiple installation pathways reflecting its beta status. Users can install the latest release via pip, install directly from the main branch for bleeding-edge features, or set up an editable development installation for contributing. The tool requires Python 3.11 or later, PyTorch 2.0.1 or later, and dependencies including GPyTorch, linear_operator, Pyro, and scipy. The project stopped publishing official Anaconda packages to the PyTorch channel but remains available through conda-forge.