$npx -y skills add adaptyvbio/protein-design-skills --skill esmESM protein language models for embeddings, sequence scoring, structure prediction, and binder design. Use this skill when: (1) Computing pseudo-log-likelihood (PLL) or mutation-effect scores, (2) Getting protein embeddings for clustering or filtering, (3) Predicting complex stru
| 1 | # ESM Protein Language Models |
| 2 | |
| 3 | The ESM line is maintained at [github.com/Biohub/esm](https://github.com/Biohub/esm) |
| 4 | (Chan Zuckerberg Biohub, MIT license; the older `evolutionaryscale/esm` URL |
| 5 | redirects here). The current generation ships three artifacts: **ESM C** (language |
| 6 | model), **ESMFold2** (structure prediction), and **ESM Atlas** (a map of predicted |
| 7 | structures). Weights are on [huggingface.co/biohub](https://huggingface.co/biohub); |
| 8 | the hosted API is at `biohub.ai`. |
| 9 | |
| 10 | This skill covers ESM C, ESMFold2, and legacy ESM2. ESM3 is not covered because its |
| 11 | open weights are non-commercial. |
| 12 | |
| 13 | ## Which model to use |
| 14 | |
| 15 | | Task | Model | |
| 16 | |------|-------| |
| 17 | | Embeddings, PLL, mutation scoring | ESM C (ESMC-6B), or ESM2 for a lighter run | |
| 18 | | Complex structure prediction | ESMFold2 | |
| 19 | | High-throughput single-sequence folding | ESMFold2 fast mode | |
| 20 | | Binder design | ESMFold2 inversion (see below), or the `mosaic` / `bindcraft` skills | |
| 21 | | Variant effect / zero-shot scoring | ESM C or ESM2 | |
| 22 | |
| 23 | ## Prerequisites |
| 24 | |
| 25 | | Requirement | Minimum | Recommended | |
| 26 | |-------------|---------|-------------| |
| 27 | | Python | 3.10+ | 3.11 | |
| 28 | | PyTorch | 2.0+ | Latest | |
| 29 | | CUDA | 12.0+ | 12.1+ | |
| 30 | | GPU VRAM | 24GB (ESM2 / small ESMC) | 80GB (ESMC-6B, ESMFold2) | |
| 31 | |
| 32 | ## ESM C: embeddings and scoring |
| 33 | |
| 34 | ESM C is the successor to ESM2. It improves long-range structural understanding as |
| 35 | model scale grows and is the default choice for embeddings, pseudo-log-likelihood, |
| 36 | and mutation-effect scoring. |
| 37 | |
| 38 | ### Python (Hugging Face) |
| 39 | ```python |
| 40 | from transformers import AutoModelForMaskedLM, AutoTokenizer |
| 41 | import torch |
| 42 | |
| 43 | model_id = "biohub/ESMC-6B" |
| 44 | tok = AutoTokenizer.from_pretrained(model_id) |
| 45 | model = AutoModelForMaskedLM.from_pretrained( |
| 46 | model_id, output_hidden_states=True, torch_dtype=torch.bfloat16 |
| 47 | ).eval().cuda() |
| 48 | |
| 49 | batch = tok(["MKTAYIAKQRQISFVK..."], return_tensors="pt").to("cuda") |
| 50 | with torch.no_grad(): |
| 51 | out = model(**batch) |
| 52 | |
| 53 | logits = out.logits # for PLL / mutation scoring |
| 54 | embeddings = out.hidden_states[-1] # per-residue representations |
| 55 | ``` |
| 56 | |
| 57 | Install the package with `pip install esm@git+https://github.com/Biohub/esm.git@main`. |
| 58 | |
| 59 | ### Hosted API |
| 60 | ```python |
| 61 | from esm.sdk import esmc_client |
| 62 | from esm.sdk.api import ESMProtein, LogitsConfig |
| 63 | |
| 64 | model = esmc_client(model="esmc-600m-2024-12", url="https://biohub.ai", token="<API token>") |
| 65 | tensor = model.encode(ESMProtein(sequence="MKTAYIAKQRQISFVK...")) |
| 66 | out = model.logits(tensor, LogitsConfig(sequence=True, return_embeddings=True)) |
| 67 | ``` |
| 68 | |
| 69 | ESMC-6B has open weights; `esmc-600m` is the smaller API model. For mutation |
| 70 | scoring and fine-tuning, see the `esmc_mutation_scoring` and `esmc_finetune` |
| 71 | notebooks under [cookbook/tutorials](https://github.com/Biohub/esm/tree/main/cookbook/tutorials). |
| 72 | |
| 73 | ## ESMFold2: complex structure prediction |
| 74 | |
| 75 | ESMFold2 is built on ESMC-6B with a diffusion structure head. Unlike the original |
| 76 | ESMFold, it predicts complexes (protein, DNA, ligand, and modified residues), takes |
| 77 | an optional MSA, and has a single-sequence fast mode for high-throughput screening. |
| 78 | It is validated for protein-protein interaction design and leads DockQ pass-rate on |
| 79 | Foldbench protein-protein and antibody-antigen complexes. |
| 80 | |
| 81 | ### Modal (biomodals) |
| 82 | ```bash |
| 83 | printf '>protein|A\nMKTAYIAKQRQISFVK...\n' > target.faa |
| 84 | uv run --with modal modal run modal_esmfold2.py --input-faa target.faa |
| 85 | ``` |
| 86 | |
| 87 | The FASTA header tags `protein|`, `dna|`, `rna|`, and `ligand|` (SMILES) let you fold |
| 88 | complexes. GPU defaults to A100-40GB (set with `MODAL_GPU`). |
| 89 | |
| 90 | ### Python (local weights) |
| 91 | ```python |
| 92 | from transformers.models.esmfold2.modeling_esmfold2 import ESMFold2Model |
| 93 | from esm.models.esmfold2 import ProteinInput, StructurePredictionInput, ESMFold2InputBuilder |
| 94 | |
| 95 | model = ESMFold2Model.from_pretrained("biohub/ESMFold2").cuda().eval() |
| 96 | spi = StructurePredictionInput(sequences=[ProteinInput(id="A", sequence="BINDER_SEQ")]) |
| 97 | result = ESMFold2InputBuilder().fold(model, spi, num_loops=20, num_sampling_steps=100) |
| 98 | # result.plddt, result.ptm, result.iptm, result.complex.to_mmcif() |
| 99 | ``` |
| 100 | |
| 101 | For single-sequence high-throughput folding, the fast variant is the SDK model string |
| 102 | `esmfold2-fast-2026-05` (HF repo `biohub/ESM |