Overview
BoFire—Bayesian Optimization Framework Intended for Real Experiments—is a Python toolkit for defining experimental search spaces and selecting subsequent experiments. Its README identifies reaction, formulation, digital twin and closed-loop optimization as intended application areas. It supports both single- and multi-objective Bayesian optimization, with BoTorch providing the underlying Bayesian optimization foundation. It is a framework for constructing optimization workflows rather than a standalone predictive model.
A problem is represented through input features, output features, objectives and optional constraints collected in a Domain. The documented variable types include continuous, discrete and categorical parameters. Objectives are defined separately from outputs, allowing minimization, maximization or movement toward a target. Experimental records combine candidate input values with measured or evaluated outputs; strategies consume those records and return proposed candidate settings. The README illustrates this workflow with SoboStrategy, qLogEI and an iterative tell/ask loop around Himmelblau's function.
Chemistry-specific support includes molecular encodings and kernels, with the README attributing the implemented molecular kernels to GAUCHE. Serializable definitions of problems, strategies and surrogates support integration into RESTful workflows. An additional LLMStrategy proposes candidates using a problem description and previous experiments as language-model context.
The example evaluates a mathematical function; executing physical experiments and supplying their results remain separate workflow steps. Optional dependency groups distinguish optimization, cheminformatics and LLM functionality. The project's versioning policy allows breaking public API changes in BIGRELEASE and MAJOR releases, so integrations should be checked against the selected release.
Key Features
- Represents mixed continuous, discrete and categorical parameter spaces, with objectives defined separately from output features.
- Supports single- and multi-objective Bayesian optimization, including minimization, maximization and target-oriented objectives.
- Provides specific and generic constraints, black-box output constraints, constrained sampling and constraint-respecting experimental designs.
- Includes chemical encodings and molecular kernels for optimization involving molecular species.
- Serializes problem definitions, optimization strategies and surrogates for use in RESTful integrations.
- Offers `LLMStrategy` for proposing candidates from a written problem description and prior experiments, alongside the documented `tell`/`ask` optimization workflow.
Use Cases
- Intended evaluation: formulate a reaction optimization campaign with continuous operating conditions and categorical choices, then assess proposed candidates against recorded experimental outcomes.
- Intended evaluation: explore constrained formulation designs and compare single-objective versus multi-objective strategies for the chosen measured properties.
- Intended evaluation: assess molecular encodings and kernels for candidate selection over molecular species using a representative experimental dataset.
- Intended evaluation: integrate serialized optimization definitions into a closed-loop service that passes measured results to a strategy and retrieves subsequent candidates.
How to Use
- Consult the installation guide and choose dependencies for the intended workflow. The README distinguishes basic Bayesian optimization from optional cheminformatics and LLM functionality; verify requirements for the release you select.
- Follow the README example to define input features and bounds, output features and objectives. Combine these in a
Domain, adding constraints appropriate to your problem. - Prepare initial candidates and obtain their measured or simulated outputs. Keep input and output identifiers consistent so the resulting experimental records match the domain definition.
- Select an optimization strategy. The example uses
SoboStrategywithqLogEI; provide existing experiments throughtell, retrieve candidates throughask, evaluate them externally and return their results. - For service integration, read the data models and functionals guide. Evaluate serialization and the optimization loop on representative data before connecting it to a laboratory workflow.