AGENT SKILL

model-embeddings

Load ESM/ESM-2/MSA Transformer models, tokenize protein inputs, compute representations or contacts, and build bulk FASTA embedding extraction commands.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
model-embeddings
license
MIT
metadata
{ "disco-role": "operating" }
description
Load ESM/ESM-2/MSA Transformer models, tokenize protein inputs, compute representations or contacts, and build bulk FASTA embedding extraction commands.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

Model Embeddings

Use this sub-skill when an agent needs embeddings, logits, or unsupervised contact maps from ESM, ESM-2, ESM-1/1b/1v, or MSA Transformer language models. It covers Python APIs for model loading and tokenization plus the esm-extract bulk FASTA CLI.

Do not use this sub-skill for structure prediction, inverse folding, or mutation-effect scoring. Route those tasks to sibling sub-skills instead:

  • Structure prediction / ESMFold PDB output: ../structure-prediction/SKILL.md
  • Inverse folding / ESM-IF1 design and structure-conditioned scoring: ../inverse-folding/SKILL.md
  • DMS or zero-shot mutation scoring: ../variant-effect-prediction/SKILL.md

Start Here

  1. For Python model loading, tokenization, layer selection, output tensors, and MSA shapes, read references/api-reference.md.
  2. For common embedding/contact workflows and safe model choices, read references/workflows.md.
  3. For bulk FASTA extraction, .pt contents, truncation, CPU/GPU flags, and command construction, read references/cli-reference.md.
  4. For large ESM-2 15B inference with Fairscale FSDP CPU offload, read references/fsdp-offloading.md.
  5. For failures such as bad model names, download issues, MSA misuse, duplicate FASTA labels, layer errors, and OOM, read references/troubleshooting.md.

Bundled Helper

Use the safe command builder when constructing a reproducible esm-extract invocation without triggering model downloads:

python sub-skills/model-embeddings/scripts/esm_extract_command_builder.py \
  esm2_t33_650M_UR50D input.fasta embeddings_out \
  --repr-layers -1 --include mean contacts --nogpu --print-only

The helper validates that the FASTA exists, checks extraction options, warns about unsupported MSA Transformer model names, and prints a shell-quoted command by default. It does not import esm or load model weights for --help or --print-only.

Quick Decisions

  • Use esm.pretrained.load_model_and_alphabet(name) or a specific esm.pretrained.<model>() function for Python embeddings.
  • Use alphabet.get_batch_converter(truncation_seq_length=...) for single-sequence models and MSA models; MSA alphabets return MSABatchConverter automatically.
  • Use model(tokens, repr_layers=[...], return_contacts=True) for hidden representations plus contact maps.
  • Use esm-extract only for single-sequence models; MSA Transformer requires Python API input shaped as a batch of MSAs.
  • Force CPU with --nogpu in esm-extract or by keeping tensors/model on CPU in Python; expect slow inference for large models.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351