← All models

masked language model Β· protein sequence Β· WASM Β· ~35 MB

Protein mutation oracle

A protein language model reads sequences the way an LLM reads text β€” but its "words" are the 20 amino acids. Mask a position and ESM-2 predicts which residue belongs there; from that same prediction it scores every possible mutation as tolerated or likely-damaging. This is the zero-shot method behind modern variant-effect prediction, running entirely in your browser.

At a glance

ModelXenova/esm2_t12_35M_UR50D (ONNX of Meta esm2_t12_35M)
Taskmasked language modeling on protein sequences (AutoModelForMaskedLM)
Vocabularythe 20 standard amino acids (+ special tokens)
TrainingESM-2, ~65M UniRef protein sequences (Meta AI)
Quantizationq8 ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~35 MB, cached after first load
LicenseMIT (ESM-2 upstream)

Run it

Paste a protein sequence or pick an example, then click a residue in the grid. The model masks that position and predicts what belongs there β€” and how every substitution scores.

Why it matters

Trained only to fill in masked residues across tens of millions of natural proteins, ESM-2 learns which amino acids are compatible with a protein's structure and function. That single skill powers a surprising amount of biology β€” without any labels, structures, or experiments:

This is a fast, zero-shot signal, not a clinical verdict. The score is the model's sequence likelihood β€” it has no knowledge of a specific structure, assay, or patient, and the 35M model is the smallest ESM-2 (larger models are more accurate). Use it to explore and prioritise, not to diagnose.

How the API works

The fill-mask pipeline needs a mask_token this ONNX build omits, so we run the model directly and read the logits at the masked position:

import { AutoTokenizer, AutoModelForMaskedLM, Tensor }
  from "@huggingface/transformers";

const tok = await AutoTokenizer.from_pretrained("Xenova/esm2_t12_35M_UR50D");
const model = await AutoModelForMaskedLM.from_pretrained(
  "Xenova/esm2_t12_35M_UR50D", { dtype: "q8" });

const ids = Array.from((await tok(sequence)).input_ids.data).map(Number);
ids[pos + 1] = maskId;                       // +1 for the leading <cls>
const { logits } = await model({ input_ids: new Tensor("int64", …) });
// softmax the logits row β†’ P(amino acid) at that position;
// ln P(mutant) βˆ’ ln P(wild-type) = the variant-effect score.

Each click is one forward pass, run in a Web Worker so the page stays responsive.

References