This guide covers building AlphaFast from source for development or non-containerized deployment.
Note: Building from source is only supported on Linux. macOS and Windows are not supported.
- Python >= 3.12
- CUDA 12.6 (toolkit and compatible driver >= 560.28.03)
- C++20 compiler: gcc/g++ >= 10 (for pybind11 C++ extensions)
- CMake >= 3.28
- git
- UV package manager
curl -LsSf https://astral.sh/uv/install.sh | shgit clone https://github.com/RomeroLab/alphafast.git
cd alphafastUV reads pyproject.toml and uv.lock to install all Python dependencies and compile the C++ extensions:
uv sync --frozen --all-groupsThis step:
- Creates a virtual environment
- Installs all Python dependencies (JAX, NumPy, RDKit, etc.)
- Compiles the C++ pybind11 extension via scikit-build-core and CMake
The chemical components database is a set of pickled data files required before running inference:
uv run build_dataThis command is provided as a script entry point defined in pyproject.toml and uses the cifpp and dssp C++ libraries built during the previous step.
Download pre-built binaries:
# MMseqs2 with GPU support
wget https://mmseqs.com/latest/mmseqs-linux-gpu.tar.gz
tar xzf mmseqs-linux-gpu.tar.gz
cp mmseqs/bin/mmseqs ~/.local/bin/
# Foldseek with GPU support (optional, for foldseek template modes)
wget https://mmseqs.com/foldseek/foldseek-linux-gpu.tar.gz
tar xzf foldseek-linux-gpu.tar.gz
cp foldseek/bin/foldseek ~/.local/bin/Ensure ~/.local/bin is in your PATH, or pass the binary paths explicitly with --mmseqs_binary_path and --foldseek_binary_path.
AlphaFast uses scikit-build-core as its build backend, which invokes CMake to compile C++ pybind11 extensions. This should be the same as AlphaFold 3's build system. The relevant files:
pyproject.toml: Declares build dependencies (scikit_build_core,pybind11,cmake,ninja,numpy) and project metadata.CMakeLists.txt: Defines the C++ build. UsesFetchContentto download and build abseil-cpp, pybind11, pybind11_abseil, libcifpp, and dssp. Compiles all.ccfiles undersrc/alphafold3/into a singlecpppybind11 module.src/alphafold3/cpp.cc: The pybind11 entry point that exposes C++ functions to Python.
The C++20 standard is required (CMAKE_CXX_STANDARD 20).
To build the Docker image locally:
docker build -f docker/Dockerfile -t romerolabduke/alphafast .The Dockerfile:
- Starts from
nvidia/cuda:12.6.3-base-ubuntu24.04 - Installs system dependencies (Python 3.12, gcc, g++, git)
- Installs UV and creates a virtual environment
- Downloads MMseqs2-GPU and Foldseek binaries
- Installs Python dependencies via
uv sync - Builds the chemical components database via
uv run build_data - Sets
XLA_FLAGSandXLA_CLIENT_MEM_FRACTIONenvironment variables
Model weights (af3.bin.zst) must be obtained separately from Google DeepMind. Request access via this form. Place the file in your --weights_dir / --model_dir directory. The weights are subject to the AlphaFold 3 Model Parameters Terms of Use.