mcpbeat Sign in

Fair Esm2 Agent Skill

> Embed proteins with Meta AI's ESM-2 (`fair-esm` package). Use this skill ML, (2) Masked-LM likelihood / mutation effect scoring, (3) Contact prediction from a sequence.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
859
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/xuzhougeng/wisp-science --skill fair-esm2

The instruction itself

10 sections, as written by the author

fair-esm2 — ESM-2 (Meta AI)

ESM-2 code and weights are MIT (Meta AI, github.com/facebookresearch/esm).

> Package disambiguation. pip install fair-esm gives you import esm

> with esm.pretrained.* (ESM-1/2). Biohub's github.com/Biohub/esm fork

> (MIT) gives you from esm.models.esmfold2 import ESMFold2InputBuilder

> see the esmfold2 skill. Both share the esm namespace but are

> different libraries. This skill covers fair-esm (the Meta package).

Prerequisites

| Requirement | Minimum | Recommended |

| ----------- | ------- | ----------- |

| Python | 3.8+ | 3.11 |

| CUDA | 11.7+ | 12.x |

| GPU VRAM | 8 GB (8M), 16 GB (650M) | 24 GB+ (650M / 3B) |

How to run

Embeddings

import torch, esm

model, alphabet = esm.pretrained.esm2_t33_650M_UR50D()
model = model.eval().cuda()
bc = alphabet.get_batch_converter()

_, _, toks = bc([("ubq", "MQIFVKTLTGKTITLEVEPSDTIENVK")])
with torch.no_grad():
    out = model(toks.cuda(), repr_layers=[33])
emb = out["representations"][33]      # (1, L+2, 1280) — includes BOS/EOS
seq_emb = emb[0, 1:-1].mean(0)        # per-sequence mean

Masked-LM scoring

with torch.no_grad():
    out = model(toks.cuda(), repr_layers=[33])
logits = out["logits"][0, 1:-1]       # (L, |vocab|)
# WT marginal log-likelihood; for mutation scoring, mask the position and
# compare logit[mut] − logit[wt].

Contact prediction

with torch.no_grad():
    out = model(toks.cuda(), repr_layers=[33], return_contacts=True)
contacts = out["contacts"][0]         # (L, L)

Models

| Name | Layers | Dim | Params | Use |

| -------------------------- | ------ | ---- | ------ | -------------------------- |

| esm2_t6_8M_UR50D | 6 | 320 | 8 M | Fast smoke / tiny embeddings |

| esm2_t33_650M_UR50D | 33 | 1280 | 650 M | Default embedding model |

| esm2_t36_3B_UR50D | 36 | 2560 | 3 B | Best embeddings, 24 GB+ |

Output format

out["representations"][layer] is (B, L+2, D); slice [ :, 1:-1, : ] to

drop BOS/EOS. out["contacts"] (when return_contacts=True) is (B, L, L).

Remote compute

Needs ≥16 GB VRAM (650M model) and either pre-cached .pt checkpoints or

egress to dl.fbaipublicfiles.com. Use a selected and probed ssh:<alias>

context and load remote-compute-ssh. Confirm the fair-esm environment and

torch-hub cache, then submit a self-contained runner with run_in_context:

{
  "context_id": "ssh:gpu-box",
  "title": "ESM-2 embeddings for 200 sequences",
  "command": "source ~/miniforge3/etc/profile.d/conda.sh && conda activate fair-esm && TORCH_HOME=/srv/torch-cache python embed_esm2.py --input seqs.fasta --output /home/me/wisp-results/esm2/embeddings.pt",
  "timeout_secs": 1800,
  "input_paths": ["runs/embed_esm2.py", "data/seqs.fasta"],
  "output_specs": [
    {
      "glob": "ssh://gpu-box/home/me/wisp-results/esm2/embeddings.pt",
      "kind": "pytorch",
      "residency": "remote"
    }
  ]
}

Replace context, environment, cache, and output paths with discovered values.

For a large input already on the server, use its absolute path instead of

staging it. Call monitor_run once to wait, get_run once for a snapshot, or

cancel_run to stop.

Troubleshooting

| Symptom | Cause | Fix |

| --------------------------------------------- | ---------------------------------- | ------------------------------------- |

| ModuleNotFoundError: No module named 'esm.models' | You want Biohub's esm fork, not fair-esm | See esmfold2 skill; this skill uses esm.pretrained.* |

| Slow first call | Downloading weights via torch.hub | Set TORCH_HOME to a cached location |


Next: feed embeddings to a classifier. For structure prediction, use

esmfold2.

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take xuzhougeng/fair-esm2 from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference pip. Without those the skill loads but fails at the first command.