fair-esm2
Embed proteins with Meta AI's ESM-2 (`fair-esm` package).
Skill by flyme2bluemoon
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/flyme2bluemoon-fair-esm2
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/fair-esm2
What's inside
- Skill name
fair-esm2- Description
- Embed proteins with Meta AI's ESM-2 (`fair-esm` package). Use this skill when: (1) Extracting per-residue or per-sequence embeddings for downstream ML, (2) Masked-LM likelihood / mutation effect scoring, (3) Contact prediction from a sequence.
- License
- Apache-2.0
- Metadata
- category: biomodels · display-name: ESM-2
- Instructions
- 121 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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
```python
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
```python
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
```python
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`. Read
`compute_details({provider, mode:'read'})` for an environment with `fair-esm`
and a torch-hub weight cache, then:
```python
c = host.compute.create(provider)
job = c.submit_job(
intent="ESM-2 650M embeddings for 200 sequences — 1×GPU, ~2 min",
inputs=[
"seqs.fasta",
"embed_esm2.py",
],
# env activation is host-specific — put it IN the command string
# (e.g. "conda run -n <env> python3 embed_esm2.py"; see compute_details)
command="python3 embed_esm2.py",
outputs=["embeddings.pt"],
run_timeout_s=1800,
)
# the Job repr just printed itself (id, notes) — cell ends here; the kernel never waits on the job
```
Then call the `wait_for_notification` brain-tool. When the
`compute_done` notification arrives, act on its payload:
```python
save_artifacts(payload["output_files"]) # paths under hpc/<job_id>/
```
For the full record (`files`, `stdout_tail`, `notes`, …), re-enter the
kernel: `res = c.attach_job(job_id).result()` then `c.close(intent=...)`. See the
`remote-compute-ssh` / `remote-compute-modal` skill for the orchestration
details.
Inside `embed_esm2.py`, set `TORCH_HOME` to the provider's torch-hub cache
mount (path is in `compute_details`) so `esm.pretrained.*` resolves locally.
## 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`.From flyme2bluemoon/skills, Apache-2.0.
More from flyme2bluemoon/skills
- 0.529score
esmfold2
flyme2bluemoon
Biohub ESMFold2 / ESMFold2-Fast all-atom co-folding (Candido et al.
SkillBFreshness: BClaude Code +9 - 0.526score
indication-dossier
flyme2bluemoon
Generate a therapeutic indication dossier.
SkillBFreshness: BClaude Code +9 - 0.525score
diffdock
flyme2bluemoon
Predict small-molecule binding poses with DiffDock-L (Corso et al.
SkillBFreshness: BClaude Code +9 - 0.524score
ligandmpnn
flyme2bluemoon
Inverse-fold a backbone with ligand, nucleic-acid, and metal context using LigandMPNN (Dauparas et al.
SkillBFreshness: BClaude Code +9 - 0.524score
chai1
flyme2bluemoon
Structure prediction for protein, nucleic-acid, and small-molecule complexes with the Chai-1 foundation model (Chai Discovery 2024…
SkillBFreshness: BClaude Code +9 - 0.524score
evo2
flyme2bluemoon
Score, embed, and generate DNA sequences with Evo 2, a long-context genomic foundation model.
SkillBFreshness: BClaude Code +9 - 0.524score
codebase-design
flyme2bluemoon
Design or refactor module interfaces to hide complexity and improve testability.
SkillBFreshness: BClaude Code +9 - 0.524score
boltz
flyme2bluemoon
Structure prediction for protein, nucleic-acid, and small-molecule complexes with Boltz-2 (Passaro & Wohlwend et al.
SkillBFreshness: BClaude Code +9 - 0.524score
borzoi
flyme2bluemoon
Predict genome-wide functional tracks (RNA-seq, CAGE, DNase, ChIP) from DNA sequence with Borzoi.
SkillBFreshness: BClaude Code +9 - 0.524score
openfold3
flyme2bluemoon
Structure prediction using OpenFold3, an open-weights PyTorch reproduction of AlphaFold3 from the AlQuraishi Lab.
SkillBFreshness: BClaude Code +9 - 0.524score
proteinmpnn
flyme2bluemoon
Inverse-fold a protein backbone (PDB structure) into amino-acid sequence with ProteinMPNN (Dauparas et al.
SkillBFreshness: BClaude Code +9 - 0.524score
scgpt
flyme2bluemoon
Embed and annotate single-cell expression data with scGPT, a foundation model for single-cell biology.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 20, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/flyme2bluemoon/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from flyme2bluemoon
- 0.529score
esmfold2
flyme2bluemoon
Biohub ESMFold2 / ESMFold2-Fast all-atom co-folding (Candido et al.
SkillBFreshness: BClaude Code +9 - 0.526score
indication-dossier
flyme2bluemoon
Generate a therapeutic indication dossier.
SkillBFreshness: BClaude Code +9 - 0.525score
diffdock
flyme2bluemoon
Predict small-molecule binding poses with DiffDock-L (Corso et al.
SkillBFreshness: BClaude Code +9 - 0.524score
evo2
flyme2bluemoon
Score, embed, and generate DNA sequences with Evo 2, a long-context genomic foundation model.
SkillBFreshness: BClaude Code +9 - 0.524score
chai1
flyme2bluemoon
Structure prediction for protein, nucleic-acid, and small-molecule complexes with the Chai-1 foundation model (Chai Discovery 2024…
SkillBFreshness: BClaude Code +9 - 0.524score
borzoi
flyme2bluemoon
Predict genome-wide functional tracks (RNA-seq, CAGE, DNase, ChIP) from DNA sequence with Borzoi.
SkillBFreshness: BClaude Code +9
Cite this page
fair-esm2 skill. Agent Mart. https://agentmart.dev/skills/flyme2bluemoon-fair-esm2 (last updated 2026-10-24)