Prerequisites
- Python 3.11-3.13
- pip (or uv for development)
- A Modal account for serverless oracle inference, or a local GPU with sufficient VRAM
Installation
Install BAGEL from PyPI:Oracle setup
BAGEL uses boileroom to run oracle inference — the ML model predictions (structure folding, embeddings) that energy terms depend on. You have two options:Modal (serverless)
No GPU required. Models run on Modal’s serverless infrastructure. You need a Modal account with credits.Then pass
use_modal=True when creating oracles.Local GPU
Requires a GPU with sufficient VRAM (16 GB+ recommended). Install with:Then pass
use_modal=False when creating oracles.Your first design
Here is a minimal example that designs a 30-residue protein scaffold using simulated annealing. The design goal is a confident, globular structure with low surface hydrophobicity:- Start from a random 30-residue sequence
- Fold each candidate with ESMFold
- Evaluate pTM, pLDDT, hydrophobicity, and globularity
- Accept or reject mutations based on the Metropolis criterion
- Return the best system found after 500 steps
What’s next
Concepts
Understand the energy landscape, system hierarchy, and Monte Carlo optimization.
Energy Terms
Explore all built-in energy terms and their parameters.
Customization
Write your own energy terms, minimizers, mutation protocols, oracles, and callbacks.
Case Studies
See complete design workflows for binders, scaffolds, and enzyme variants.
