Source profileQuality 72/100

xuzhougeng/wisp-science/skills/fair-esm2/SKILL.md

fair-esm2

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.

Source repository stars
560
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

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

Best for

  • 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.

Not for

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

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/xuzhougeng/wisp-science --skill "skills/fair-esm2"
Safe inspection promptEditorial

Inspect the Agent Skill "fair-esm2" from https://github.com/xuzhougeng/wisp-science/blob/95d2c13d1665d46a388b5bdc998dcce0d5ec2eee/skills/fair-esm2/SKILL.md at commit 95d2c13d1665d46a388b5bdc998dcce0d5ec2eee. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    How to run

    python with torch.nograd(): out = model(toks.cuda(), reprlayers=[33]) logits = out["logits"][0, 1:-1] (L, |vocab|)

    python with torch.nograd(): out = model(toks.cuda(), reprlayers=[33]) logits = out["logits"][0, 1:-1] (L, |vocab|)
  2. 02

    Prerequisites

    Review the “Prerequisites” section in the pinned source before continuing.

    Review and apply the “Prerequisites” source section.
  3. 03

    Embeddings

    Review the “Embeddings” section in the pinned source before continuing.

    Review and apply the “Embeddings” source section.
  4. 04

    Masked-LM scoring

    python with torch.nograd(): out = model(toks.cuda(), reprlayers=[33]) logits = out["logits"][0, 1:-1] (L, |vocab|)

    python with torch.nograd(): out = model(toks.cuda(), reprlayers=[33]) logits = out["logits"][0, 1:-1] (L, |vocab|)

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score72/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars560SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
xuzhougeng/wisp-science
Skill path
skills/fair-esm2/SKILL.md
Commit
95d2c13d1665d46a388b5bdc998dcce0d5ec2eee
License
AGPL-3.0
Collected
2026-07-28
Default branch
main
View the original SKILL.md

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

RequirementMinimumRecommended
Python3.8+3.11
CUDA11.7+12.x
GPU VRAM8 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

NameLayersDimParamsUse
esm2_t6_8M_UR50D63208 MFast smoke / tiny embeddings
esm2_t33_650M_UR50D331280650 MDefault embedding model
esm2_t36_3B_UR50D3625603 BBest 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

SymptomCauseFix
ModuleNotFoundError: No module named 'esm.models'You want Biohub's esm fork, not fair-esmSee esmfold2 skill; this skill uses esm.pretrained.*
Slow first callDownloading weights via torch.hubSet TORCH_HOME to a cached location

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