Library / SDK
kyegomez/Open-AF3 avatar
kyegomez/Open-AF3

Open-AF3 is an unfinished PyTorch reading of the AlphaFold 3 paper

Implementation of Alpha Fold 3 from the paper: "Accurate structure prediction of biomolecular interactions with AlphaFold3" in PyTorch

808 stars104 forksPythonMIT

At a glance

What is it?
The Open-AF3 repository implements the structure of the AlphaFold 3 paper in PyTorch, with a diffusion module that operates directly on atomic coordinates and a pairformer trunk, and its own todo list records that the input embedder, template module and MSA embedding are still to be written.
Who is it for?
Open-AF3 suits a reader who wants to understand how the AlphaFold 3 paper decomposes into modules, since the notes section walks the data flow in plain terms and the code is small enough to read in an afternoon.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The model is a pairformer plus a diffusion over coordinates

The core of the implementation is the AlphaFold 3 architecture, and the Notes section in the README describes the data flow in the author's own words. Within the trunk, MSA processing is de-emphasised in favour of a simpler MSA block of four blocks, and MSA processing feeds into a pair weighted averaging. The pairformer replaces the Evoformer and operates on a pair representation and a single representation, with 48 blocks. The pair and single representations, together with the input representation, are then passed to the diffusion module, which takes in three tensors and operates directly on raw atom coordinates. The training approach is the standard diffusion recipe, where the model is trained to receive noised atomic coordinates and predict the true coordinates. The network learns structure across a range of length scales, with the denoising task at low noise emphasising the large scale structure of the system, and at inference time random noise is sampled and then recurrently denoised to produce a final structure.

The diffusion module is the piece that is actually written

The GeneticDiffusion class is exposed from alphafold3.diffusion, and the README is candid about its status, saying it needs review but that it basically operates on atomic coordinates. The example creates the module with three channels and a training flag, feeds it random input coordinates of shape 10 by 100 by 100 by 3 alongside random ground truth coordinates of the same shape, and takes an output tensor and a loss.

python
import torch
from alphafold3.diffusion import GeneticDiffusion

# Create an instance of the GeneticDiffusionModuleBlock
model = GeneticDiffusion(channels=3, training=True)

# Generate random input coordinates
input_coords = torch.randn(10, 100, 100, 3)

# Generate random ground truth coordinates
ground_truth = torch.randn(10, 100, 100, 3)

# Pass the input coordinates and ground truth coordinates through the model
output_coords, loss = model(input_coords, ground_truth)

The architecture is AlphaFold 3, which predicts protein nuclear structures with thousands of residues, handles covalent modifications such as bonded ligands, glycosylation and modified protein residues, and takes polymer sequences, residue modifications and ligand SMILES as input, for structures below 1000 residues. The reason this repository is interesting is the decomposition into a trunk and a coordinate diffusion, which is the structural difference from the previous generation of the model.

The full model runs, but only on random tensors

There is a forward pass example for the whole AlphaFold3 class, and the constructor arguments show the architecture in numbers.

python
import torch 
from alphafold3 import AlphaFold3

# Create random tensors
x = torch.randn(1, 5, 5, 64)  # Shape: (batch_size, seq_len, seq_len, dim)
y = torch.randn(1, 5, 64)  # Shape: (batch_size, seq_len, dim)

# Initialize AlphaFold3 model
model = AlphaFold3(
    dim=64,
    seq_len=5,
    heads=8,
    dim_head=64,
    attn_dropout=0.0,
    ff_dropout=0.0,
    global_column_attn=False,
    pair_former_depth=48,
    num_diffusion_steps=1000,
    diffusion_depth=30,
)

The shapes are the point. The pair representation is batch by sequence by sequence by dim, the single representation is batch by sequence by dim, and the dim of 64 with 8 heads and 48 pairformer blocks and 1000 diffusion steps is a toy configuration rather than the published one. The forward pass therefore demonstrates that the modules compose and that tensors flow between them, and it says nothing about prediction quality, since the inputs are random noise.

The todo list is the honest status of the project

Two sections of the README describe what is missing, and they are the most useful thing in the document for anyone deciding whether to depend on this. Under Model Architecture, the first three items are to implement the input embedder from the AlphaFold 2 openfold implementation, to implement the template module from openfold, and to implement the MSA embedding from openfold. Then there are two items about the implementation itself: fixing residuals and making sure the pair representation and generated output reach the diffusion model, and implementing recycling to fix residuals. Under Training pipeline, the single item is to get all datasets pushed to Hugging Face. So the front of the model, the part that turns a sequence into an embedding and a template and an MSA, is not there, which is why the forward pass example uses random tensors. The repository is version 0.0.8 in pyproject.toml, the classifiers mark it as Development Status 4, Beta, and the licence is MIT.

The notes explain the parts that are easy to get wrong

Beyond the code, the Notes section is a reading guide, and some of the observations are about the design rather than the implementation. The diffusion module produces a distribution of answers, and for each answer the local structure will be sharply defined. Diffusion models are prone to hallucination, where the model may hallucinate plausible looking structures, and the countermeasure described is a cross distillation method that enriches the training data with AlphaFold multimer v2.3 predicted structures. The confidence head regresses the error in the output of the structure module during training, and the diffused predicted structure is used to permute the ground truth and ligands to compute metrics for the confidence head. The confidence head uses the pair representation to predict lddt and a predicted aligned error matrix as used in AlphaFold 2, plus a distance error matrix. Training uses a diffusion rollout procedure with a larger step size than normal, and early stopping uses a weighted average of the metrics. At inference, the top confidence sample is taken from 5 seed runs and 5 diffusion samples per model seed, 25 samples in total.

The limits the authors state about the approach itself

Two caveats in the notes are about the model rather than the code, and they are the ones a user should weigh. The first is that the key problem in protein structure prediction is that these methods predict static structures and not the dynamical behaviour, so a prediction tells you nothing about how a complex moves. The second is a point about sampling: multiple random seeds for either the diffusion head or the network do not produce an approximation of the solution ensemble, and the stated direction is to generate a large number of predictions and rank them, which is why inference currently takes 25 samples. There is also a measurement note, that interface accuracy is measured with an interface lddt calculated from distances between atoms across different chains, and a polymer lddt that considers differences from each atom of an entity to any carbon or carbon-1 polymer atom within a radius. The resources section points at the EvoFormer paper, the Pairformer paper, the AlphaFold 3 paper in Nature and the OpenFold repository, and the README states plainly that the contributors are not in any way related to or connected to Google or DeepMind.

Editorial conclusion

Open-AF3 suits a reader who wants to understand how the AlphaFold 3 paper decomposes into modules, since the notes section walks the data flow in plain terms and the code is small enough to read in an afternoon. It is the wrong tool for anyone who wants working structure prediction, because the todo list states plainly that the input embedder, the template module and the MSA embedding are not implemented, so the model cannot consume a real protein sequence yet, and the training pipeline item says the datasets still need to be pushed to Hugging Face. Before using it, read the Notes section end to end and treat the code as a worked explanation of the architecture rather than a runnable pipeline. The last push was on 2026-10-12 and the package version in pyproject.toml is 0.0.8.

Frequently asked questions

What is the Open-AF3 repository?

It is an open source PyTorch implementation of the AlphaFold 3 paper, Accurate structure prediction of biomolecular interactions with AlphaFold3, with a pairformer trunk and a diffusion module that operates directly on atomic coordinates. The README states the contributors are not in any way related to or connected to Google or DeepMind.

How do I install Open-AF3?

The install command given in the README is pip install alphafold3. The package name in pyproject.toml is alphafold3, the version is 0.0.8, the build backend is poetry-core, and the runtime dependencies are torch, zetascale and einops.

What parts of the AlphaFold 3 architecture are still missing from Open-AF3?

The todo list names three unimplemented pieces, the input embedder, the template module and the MSA embedding, all to be taken from the openfold implementation, plus residual fixes, ensuring the pair representation and generated output reach the diffusion model, and implementing recycling. The training pipeline item is to push all datasets to Hugging Face.

How does the Open-AF3 confidence head work?

The confidence head regresses the error in the output of the structure module during training, and the diffused predicted structure is used to permute the ground truth and ligands to compute the metrics. The head uses the pair representation to predict lddt, a predicted aligned error matrix, and a distance error matrix, and early stopping uses a weighted average of the metrics.

Official sources

  1. Issues
  2. kyegomez/Open-AF3 on GitHub
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kyegomez-open-af3.svg)](https://hysenlabs.com/projects/kyegomez-open-af3)

Was this useful?