
License: ESM2 is open source and free for academic and commercial use under an MIT license. Please refer to the license for full terms.
This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.

API Reference
Configuration for ESM2 perplexity scoring (forward + gradient).
ESM2 model checkpoint to useOptions:
esm2_t6_8M_UR50D, esm2_t12_35M_UR50D, esm2_t30_150M_UR50D, esm2_t33_650M_UR50D, esm2_t36_3B_UR50D, esm2_t48_15B_UR50DSoftmax temperature for ESM2 (fixed for this constraint, not varied per optimizer step).
Hard one-hot forward pass with soft-probability gradients.
Device for ESM2 execution, e.g. ‘cuda’ or ‘cuda:0’.
AA positions per ESM2 forward pass. Lower if OOM, higher for throughput.
Return raw mean NLL by default, or ESM2 perplexity when set to ‘ppl’.Options:
nll, pplPre-scale raw logits before ESM2; gradients are scaled back by the same factor.
Declarative sequence-symbol bias (canonical 20-AA protein) added before ESM2.
Usage
python
Metadata
| Property | Value |
|---|---|
| Key | esm2-perplexity |
| Function | esm2_perplexity_constraint |
| Category | sequence_scoring |
| Mode | dual |
| Uses GPU | True |
| Supported Types | protein |