Skip to main content
This guide will get you from zero to your first BAGEL protein design run.

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:
For local GPU execution of protein models (instead of Modal):

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.
See the boileroom getting started guide for details on backend configuration.

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:
This script will:
  1. Start from a random 30-residue sequence
  2. Fold each candidate with ESMFold
  3. Evaluate pTM, pLDDT, hydrophobicity, and globularity
  4. Accept or reject mutations based on the Metropolis criterion
  5. Return the best system found after 500 steps
Output files are saved to a timestamped directory alongside your script, including energy traces, sequences (FASTA), and predicted structures (CIF).

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.