{"id":"49d580a5-1a53-4575-bd80-2d950367c382","shortId":"5GrnDC","kind":"skill","title":"esm","tagline":"ESM2 protein language model for embeddings and sequence scoring. Use this skill when: (1) Computing pseudo-log-likelihood (PLL) scores, (2) Getting protein embeddings for clustering, (3) Filtering designs by sequence plausibility, (4) Zero-shot variant effect prediction, (5) Anal","description":"# ESM2 Protein Language Model\n\n## Prerequisites\n\n| Requirement | Minimum | Recommended |\n|-------------|---------|-------------|\n| Python | 3.8+ | 3.10 |\n| PyTorch | 1.10+ | 2.0+ |\n| CUDA | 11.0+ | 11.7+ |\n| GPU VRAM | 8GB | 24GB (A10G) |\n| RAM | 16GB | 32GB |\n\n## How to run\n\n> **First time?** See [Installation Guide](../../docs/installation.md) to set up Modal and biomodals.\n\n### Option 1: Modal\n```bash\ncd biomodals\nmodal run modal_esm2_predict_masked.py \\\n  --input-faa sequences.fasta \\\n  --out-dir embeddings/\n```\n\n**GPU**: A10G (24GB) | **Timeout**: 300s default\n\n### Option 2: Python API (recommended)\n```python\nimport torch\nimport esm\n\n# Load model\nmodel, alphabet = esm.pretrained.esm2_t33_650M_UR50D()\nbatch_converter = alphabet.get_batch_converter()\nmodel = model.eval().cuda()\n\n# Process sequences\ndata = [(\"seq1\", \"MKTAYIAKQRQISFVK...\")]\nbatch_labels, batch_strs, batch_tokens = batch_converter(data)\n\nwith torch.no_grad():\n    results = model(batch_tokens.cuda(), repr_layers=[33])\n\n# Get embeddings\nembeddings = results[\"representations\"][33]\n```\n\n## Key parameters\n\n### ESM2 Models\n\n| Model | Parameters | Speed | Quality |\n|-------|------------|-------|---------|\n| esm2_t6_8M | 8M | Fastest | Fast screening |\n| esm2_t12_35M | 35M | Fast | Good |\n| esm2_t33_650M | 650M | Medium | Better |\n| esm2_t36_3B | 3B | Slow | Best |\n\n## Output format\n\n```\nembeddings/\n├── embeddings.npy       # (N, 1280) array\n├── pll_scores.csv       # PLL for each sequence\n└── metadata.json        # Sequence info\n```\n\n## Sample output\n\n### Successful run\n```\n$ modal run modal_esm2_predict_masked.py --input-faa designs.fasta\n[INFO] Loading ESM2-650M model...\n[INFO] Processing 100 sequences...\n[INFO] Computing pseudo-log-likelihood...\n\nembeddings/pll_scores.csv:\nsequence_id,pll,pll_normalized,length\ndesign_0,-0.82,0.15,78\ndesign_1,-0.95,0.08,85\ndesign_2,-1.23,-0.12,72\n...\n\nSummary:\n  Mean PLL: -0.91\n  Sequences with PLL > 0: 42/100 (42%)\n```\n\n**What good output looks like:**\n- PLL_normalized: > 0.0 (more natural-like)\n- Embeddings shape: (N, 1280) for 650M model\n- Higher PLL = more natural sequence\n\n## Decision tree\n\n```\nShould I use ESM2?\n│\n├─ What do you need?\n│  ├─ Sequence plausibility score → ESM2 PLL ✓\n│  ├─ Embeddings for clustering → ESM2 ✓\n│  ├─ Variant effect prediction → ESM2 ✓\n│  └─ Structure prediction → Use ESMFold\n│\n├─ What model size?\n│  ├─ Fast screening → esm2_t12_35M\n│  ├─ Standard use → esm2_t33_650M ✓\n│  └─ Best quality → esm2_t36_3B\n│\n└─ Use case?\n   ├─ QC filtering → PLL > 0.0 threshold\n   ├─ Diversity analysis → Mean-pooled embeddings\n   └─ Mutation scanning → Per-position log-odds\n```\n\n## PLL interpretation\n\n| Normalized PLL | Interpretation |\n|----------------|----------------|\n| > 0.2 | Very natural sequence |\n| 0.0 - 0.2 | Good, natural-like |\n| -0.5 - 0.0 | Acceptable |\n| < -0.5 | May be unnatural |\n\n## Typical performance\n\n| Campaign Size | Time (A10G) | Cost (Modal) | Notes |\n|---------------|-------------|--------------|-------|\n| 100 sequences | 5-10 min | ~$1 | Quick screen |\n| 1000 sequences | 30-60 min | ~$5 | Standard |\n| 5000 sequences | 2-3h | ~$20 | Large batch |\n\n**Throughput**: ~100-200 sequences/minute with 650M model.\n\n---\n\n## Verify\n\n```bash\nwc -l embeddings/pll_scores.csv  # Should match input + 1 (header)\n```\n\n---\n\n## Troubleshooting\n\n**OOM errors**: Use smaller model or batch sequences\n**Slow processing**: Use esm2_t12_35M for speed\n**Low PLL scores**: May indicate unusual/designed sequences\n\n### Error interpretation\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `RuntimeError: CUDA out of memory` | Sequence too long or large batch | Reduce batch size |\n| `KeyError: representation` | Wrong layer requested | Use layer 33 for 650M model |\n| `ValueError: sequence` | Invalid amino acid | Check for non-standard AAs |\n\n---\n\n**Next**: Structure prediction with `chai` or `boltz` → `protein-qc` for filtering.","tags":["esm","protein","design","skills","adaptyvbio","agent-skills","claude-code","protein-design","protein-engineering"],"capabilities":["skill","source-adaptyvbio","skill-esm","topic-agent-skills","topic-claude-code","topic-protein-design","topic-protein-engineering"],"categories":["protein-design-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/adaptyvbio/protein-design-skills/esm","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add adaptyvbio/protein-design-skills","source_repo":"https://github.com/adaptyvbio/protein-design-skills","install_from":"skills.sh"}},"qualityScore":"0.513","qualityRationale":"deterministic score 0.51 from registry signals: · indexed on github topic:agent-skills · 126 github stars · SKILL.md body (3,896 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-02T12:54:48.599Z","embedding":null,"createdAt":"2026-04-18T22:10:07.574Z","updatedAt":"2026-05-02T12:54:48.599Z","lastSeenAt":"2026-05-02T12:54:48.599Z","tsv":"'-0.12':258 '-0.5':375,378 '-0.82':247 '-0.91':263 '-0.95':252 '-1.23':257 '-10':394 '-200':416 '-3':409 '-60':402 '/../docs/installation.md':77 '0':246,267 '0.0':277,344,369,376 '0.08':253 '0.15':248 '0.2':365,370 '1':15,85,251,396,429 '1.10':56 '100':230,391,415 '1000':399 '11.0':59 '11.7':60 '1280':201,285 '16gb':67 '2':23,108,256,408 '2.0':57 '20':411 '24gb':64,103 '3':29 '3.10':54 '3.8':53 '30':401 '300s':105 '32gb':68 '33':156,162,481 '35m':180,181,328,445 '3b':192,193,338 '4':35 '42':269 '42/100':268 '5':42,393,404 '5000':406 '650m':124,186,187,226,287,333,419,483 '72':259 '78':249 '85':254 '8gb':63 '8m':173,174 'a10g':65,102,387 'aa':495 'accept':377 'acid':489 'alphabet':120 'alphabet.get':128 'amino':488 'anal':43 'analysi':347 'api':110 'array':202 'bash':87,422 'batch':126,129,139,141,143,145,413,438,470,472 'batch_tokens.cuda':153 'best':195,334 'better':189 'biomod':83,89 'boltz':502 'campaign':384 'case':340 'caus':458 'cd':88 'chai':500 'check':490 'cluster':28,311 'comput':16,233 'convert':127,130,146 'cost':388 'cuda':58,133,461 'data':136,147 'decis':294 'default':106 'design':31,245,250,255 'designs.fasta':221 'dir':99 'divers':346 'effect':40,314 'embed':7,26,100,158,159,198,282,309,351 'embeddings.npy':199 'embeddings/pll_scores.csv':238,425 'error':433,455,457 'esm':1,116 'esm.pretrained':121 'esm2':2,44,122,165,171,178,184,190,225,299,307,312,316,326,331,336,443 'esm2-650m':224 'esmfold':320 'faa':95,220 'fast':176,182,324 'fastest':175 'filter':30,342,507 'first':72 'fix':459 'format':197 'get':24,157 'good':183,271,371 'gpu':61,101 'grad':150 'guid':76 'h':410 'header':430 'higher':289 'id':240 'import':113,115 'indic':452 'info':210,222,228,232 'input':94,219,428 'input-faa':93,218 'instal':75 'interpret':361,364,456 'invalid':487 'key':163 'keyerror':474 'l':424 'label':140 'languag':4,46 'larg':412,469 'layer':155,477,480 'length':244 'like':274,281,374 'likelihood':20,237 'load':117,223 'log':19,236,358 'log-odd':357 'long':467 'look':273 'low':448 'match':427 'may':379,451 'mean':261,349 'mean-pool':348 'medium':188 'memori':464 'metadata.json':208 'min':395,403 'minimum':50 'mktayiakqrqisfvk':138 'modal':81,86,90,215,389 'modal_esm2_predict_masked.py':92,217 'model':5,47,118,119,131,152,166,167,227,288,322,420,436,484 'model.eval':132 'mutat':352 'n':200,284 'natur':280,292,367,373 'natural-lik':279,372 'need':303 'next':496 'non':493 'non-standard':492 'normal':243,276,362 'note':390 'odd':359 'oom':432 'option':84,107 'out-dir':97 'output':196,212,272 'paramet':164,168 'per':355 'per-posit':354 'perform':383 'plausibl':34,305 'pll':21,204,241,242,262,266,275,290,308,343,360,363,449 'pll_scores.csv':203 'pool':350 'posit':356 'predict':41,315,318,498 'prerequisit':48 'process':134,229,441 'protein':3,25,45,504 'protein-qc':503 'pseudo':18,235 'pseudo-log-likelihood':17,234 'python':52,109,112 'pytorch':55 'qc':341,505 'qualiti':170,335 'quick':397 'ram':66 'recommend':51,111 'reduc':471 'repr':154 'represent':161,475 'request':478 'requir':49 'result':151,160 'run':71,91,214,216 'runtimeerror':460 'sampl':211 'scan':353 'score':10,22,306,450 'screen':177,325,398 'see':74 'seq1':137 'sequenc':9,33,135,207,209,231,239,264,293,304,368,392,400,407,439,454,465,486 'sequences.fasta':96 'sequences/minute':417 'set':79 'shape':283 'shot':38 'size':323,385,473 'skill':13 'skill-esm' 'slow':194,440 'smaller':435 'source-adaptyvbio' 'speed':169,447 'standard':329,405,494 'strs':142 'structur':317,497 'success':213 'summari':260 't12':179,327,444 't33':123,185,332 't36':191,337 't6':172 'threshold':345 'throughput':414 'time':73,386 'timeout':104 'token':144 'topic-agent-skills' 'topic-claude-code' 'topic-protein-design' 'topic-protein-engineering' 'torch':114 'torch.no':149 'tree':295 'troubleshoot':431 'typic':382 'unnatur':381 'unusual/designed':453 'ur50d':125 'use':11,298,319,330,339,434,442,479 'valueerror':485 'variant':39,313 'verifi':421 'vram':62 'wc':423 'wrong':476 'zero':37 'zero-shot':36","prices":[{"id":"9fe6f696-8b8f-4cab-bc85-06bb8a2f0afd","listingId":"49d580a5-1a53-4575-bd80-2d950367c382","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"adaptyvbio","category":"protein-design-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:10:07.574Z"}],"sources":[{"listingId":"49d580a5-1a53-4575-bd80-2d950367c382","source":"github","sourceId":"adaptyvbio/protein-design-skills/esm","sourceUrl":"https://github.com/adaptyvbio/protein-design-skills/tree/main/skills/esm","isPrimary":false,"firstSeenAt":"2026-04-18T22:10:07.574Z","lastSeenAt":"2026-05-02T12:54:48.599Z"}],"details":{"listingId":"49d580a5-1a53-4575-bd80-2d950367c382","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"adaptyvbio","slug":"esm","github":{"repo":"adaptyvbio/protein-design-skills","stars":126,"topics":["agent-skills","claude-code","protein-design","protein-engineering"],"license":"mit","html_url":"https://github.com/adaptyvbio/protein-design-skills","pushed_at":"2026-01-19T13:06:29Z","description":"Claude Code skills for protein design","skill_md_sha":"3e38e0f6efb1ba60a7743e8aef7d832eb4912495","skill_md_path":"skills/esm/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/adaptyvbio/protein-design-skills/tree/main/skills/esm"},"layout":"multi","source":"github","category":"protein-design-skills","frontmatter":{"name":"esm","license":"MIT","description":"ESM2 protein language model for embeddings and sequence scoring. Use this skill when: (1) Computing pseudo-log-likelihood (PLL) scores, (2) Getting protein embeddings for clustering, (3) Filtering designs by sequence plausibility, (4) Zero-shot variant effect prediction, (5) Analyzing sequence-function relationships.  For structure prediction, use chai or boltz. For QC thresholds, use protein-qc."},"skills_sh_url":"https://skills.sh/adaptyvbio/protein-design-skills/esm"},"updatedAt":"2026-05-02T12:54:48.599Z"}}