SaProt is a 650M-parameter, structure-aware protein language model that augments ESM-2-style transformers with Foldseek 3Di tokens derived from PDB input (experimental or AlphaFold-style) to produce joint sequence–structure embeddings and masked-marginal mutation scores. The API supports residue-level encoding and variant scoring for proteins up to 1024 residues (single chain, batch size up to 8), enabling structure-aware variant effect and stability analysis (e.g., ProteinGym Spearman ≈0.46, ClinVar AUC ≈0.91) in protein engineering and functional genomics workflows.

Predict

Run the predict action for SaProt.

python
from biolmai import BioLM
response = BioLM(
    entity="saprot",
    action="predict",
    params={},
    items=[{'sequence': 'MKTVA',
      'pdb': 'ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 '
             '95.00           N\n'
             'ATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 '
             '95.00           C\n'
             'ATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 '
             '95.00           C\n'
             'ATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 '
             '95.00           C\n'
             'ATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 '
             '95.00           O\n'
             'ATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 '
             '95.00           N\n'
             'ATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 '
             '95.00           C\n'
             'ATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 '
             '95.00           C\n'
             'ATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 '
             '95.00           C\n'
             'ATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 '
             '95.00           O\n'
             'ATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 '
             '95.00           N\n'
             'ATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 '
             '95.00           C\n'
             'ATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 '
             '95.00           C\n'
             'ATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 '
             '95.00           C\n'
             'ATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 '
             '95.00           O\n'
             'ATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 '
             '95.00           N\n'
             'ATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 '
             '95.00           C\n'
             'ATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 '
             '95.00           C\n'
             'ATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 '
             '95.00           C\n'
             'ATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 '
             '95.00           O\n'
             'ATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 '
             '95.00           N\n'
             'ATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 '
             '95.00           C\n'
             'ATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 '
             '95.00           C\n'
             'ATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 '
             '95.00           C\n'
             'ATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 '
             '95.00           O\n'
             'END\n',
      'chain_id': 'A',
      'plddt_threshold': 70.0}]
)
print(response)
bash
curl -X POST https://biolm.ai/api/v3/saprot/predict/ \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "sequence": "MKTVA",
      "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
      "chain_id": "A",
      "plddt_threshold": 70.0
    }
  ]
}'
python
import requests

url = "https://biolm.ai/api/v3/saprot/predict/"
headers = {
    "Authorization": "Token YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
      "items": [
        {
          "sequence": "MKTVA",
          "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
          "chain_id": "A",
          "plddt_threshold": 70.0
        }
      ]
    }

response = requests.post(url, headers=headers, json=payload)
print(response.json())
r
library(httr)

url <- "https://biolm.ai/api/v3/saprot/predict/"
headers <- c("Authorization" = "Token YOUR_API_KEY", "Content-Type" = "application/json")
body <- list(
  items = list(
    list(
      sequence = "MKTVA",
      pdb = "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N
ATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C
ATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C
ATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C
ATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O
ATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N
ATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C
ATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C
ATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C
ATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O
ATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N
ATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C
ATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C
ATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C
ATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O
ATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N
ATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C
ATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C
ATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C
ATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O
ATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N
ATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C
ATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C
ATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C
ATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O
END
",
      chain_id = "A",
      plddt_threshold = 70.0
    )
  )
)

res <- POST(url, add_headers(.headers = headers), body = body, encode = "json")
print(content(res))
POST /api/v3/saprot/predict/

Predict endpoint for SaProt.

Request Headers:

Request

  • params (object, optional) — Configuration parameters:

    • include (array of strings, default: [“mean”]) — Embedding types to include in the response; allowed values: “mean”, “per_token”

  • items (array of objects, min: 1, max: 8, required) — Input protein structures:

    • sequence (string, min length: 1, max length: 1024, required) — Amino acid sequence string after unambiguous validation

    • pdb (string, min length: 1, required) — PDB file content as a single string after PDB validation

    • chain_id (string, min length: 1, max length: 2, default: “A”) — Chain ID to extract from the PDB structure

    • plddt_threshold (float, range: 0.0-100.0, default: 70.0) — pLDDT threshold below which structure tokens are masked with “#”

Example request:

http
POST /api/v3/saprot/predict/ HTTP/1.1
Host: biolm.ai
Authorization: Token YOUR_API_KEY
Content-Type: application/json

      {
  "items": [
    {
      "sequence": "MKTVA",
      "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
      "chain_id": "A",
      "plddt_threshold": 70.0
    }
  ]
}
Status Codes:

Response

  • results (array of objects) — One result per input item, in the order requested:

    • sequence_index (int) — Zero-based index of the input item within the request batch

    • embeddings (array of objects, optional) — Mean pooled sequence-level embeddings for requested layers

      • layer (int) — Layer index that produced the embedding vector

      • embedding (array of floats) — Mean embedding vector for this layer; length equals the SaProt hidden dimension (model-dependent, fixed per model instance)

    • per_token_embeddings (array of objects, optional) — Per-token embeddings for requested layers

      • layer (int) — Layer index that produced the per-token embedding matrix

      • embeddings (array of arrays of floats) — Per-token embedding matrix for this layer; outer array length = number of tokens after SaProt structure-aware tokenization (≤ 1024), inner array length = SaProt hidden dimension (model-dependent, fixed per model instance)

  • results (array of objects) — One result per input item, in the order requested:

    • fitness_score (float) — Log-likelihood-based fitness score for the scored sequence; unbounded real value

    • mutation (string, optional) — Mutation specification that was scored, in the format “X{pos}Y” or multiple mutations separated by ‘:’ (e.g. “V3A” or “V3A:Q4M”); omitted when scoring the wildtype sequence

Example response:

http
HTTP/1.1 200 OK
Content-Type: application/json

      {
  "results": [
    {
      "fitness_score": -13.94306194782257
    }
  ]
}

Encode

Run the encode action for SaProt.

python
from biolmai import BioLM
response = BioLM(
    entity="saprot",
    action="encode",
    params={'include': ['mean']},
    items=[{'sequence': 'MKTVA',
      'pdb': 'ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 '
             '95.00           N\n'
             'ATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 '
             '95.00           C\n'
             'ATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 '
             '95.00           C\n'
             'ATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 '
             '95.00           C\n'
             'ATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 '
             '95.00           O\n'
             'ATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 '
             '95.00           N\n'
             'ATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 '
             '95.00           C\n'
             'ATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 '
             '95.00           C\n'
             'ATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 '
             '95.00           C\n'
             'ATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 '
             '95.00           O\n'
             'ATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 '
             '95.00           N\n'
             'ATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 '
             '95.00           C\n'
             'ATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 '
             '95.00           C\n'
             'ATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 '
             '95.00           C\n'
             'ATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 '
             '95.00           O\n'
             'ATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 '
             '95.00           N\n'
             'ATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 '
             '95.00           C\n'
             'ATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 '
             '95.00           C\n'
             'ATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 '
             '95.00           C\n'
             'ATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 '
             '95.00           O\n'
             'ATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 '
             '95.00           N\n'
             'ATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 '
             '95.00           C\n'
             'ATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 '
             '95.00           C\n'
             'ATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 '
             '95.00           C\n'
             'ATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 '
             '95.00           O\n'
             'END\n',
      'chain_id': 'A',
      'plddt_threshold': 70.0}]
)
print(response)
bash
curl -X POST https://biolm.ai/api/v3/saprot/encode/ \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "include": [
      "mean"
    ]
  },
  "items": [
    {
      "sequence": "MKTVA",
      "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
      "chain_id": "A",
      "plddt_threshold": 70.0
    }
  ]
}'
python
import requests

url = "https://biolm.ai/api/v3/saprot/encode/"
headers = {
    "Authorization": "Token YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
      "params": {
        "include": [
          "mean"
        ]
      },
      "items": [
        {
          "sequence": "MKTVA",
          "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
          "chain_id": "A",
          "plddt_threshold": 70.0
        }
      ]
    }

response = requests.post(url, headers=headers, json=payload)
print(response.json())
r
library(httr)

url <- "https://biolm.ai/api/v3/saprot/encode/"
headers <- c("Authorization" = "Token YOUR_API_KEY", "Content-Type" = "application/json")
body <- list(
  params = list(
    include = list(
      "mean"
    )
  ),
  items = list(
    list(
      sequence = "MKTVA",
      pdb = "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N
ATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C
ATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C
ATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C
ATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O
ATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N
ATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C
ATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C
ATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C
ATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O
ATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N
ATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C
ATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C
ATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C
ATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O
ATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N
ATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C
ATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C
ATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C
ATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O
ATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N
ATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C
ATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C
ATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C
ATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O
END
",
      chain_id = "A",
      plddt_threshold = 70.0
    )
  )
)

res <- POST(url, add_headers(.headers = headers), body = body, encode = "json")
print(content(res))
POST /api/v3/saprot/encode/

Encode endpoint for SaProt.

Request Headers:

Request

  • params (object, optional) — Configuration parameters:

    • include (array of strings, default: [“mean”]) — Output embeddings to return; allowed values: “mean”, “per_token”

  • items (array of objects, min: 1, max: 8, required) — Input sequences and structures:

    • sequence (string, min length: 1, max length: 1024, required) — Amino acid sequence using unambiguous residue codes

    • pdb (string, min length: 1, required) — PDB file content as a single text string

    • chain_id (string, min length: 1, max length: 2, default: “A”) — Chain identifier to select from the PDB structure

    • plddt_threshold (float, range: 0.0-100.0, default: 70.0) — pLDDT score threshold below which structure tokens are masked with “#”

Example request:

http
POST /api/v3/saprot/encode/ HTTP/1.1
Host: biolm.ai
Authorization: Token YOUR_API_KEY
Content-Type: application/json

      {
  "params": {
    "include": [
      "mean"
    ]
  },
  "items": [
    {
      "sequence": "MKTVA",
      "pdb": "ATOM      1  N   MET A   1      27.340  24.430   2.614  1.00 95.00           N\nATOM      2  CA  MET A   1      26.266  25.413   2.842  1.00 95.00           C\nATOM      3  C   MET A   1      26.913  26.639   3.531  1.00 95.00           C\nATOM      4  CB  MET A   1      25.112  24.880   3.649  1.00 95.00           C\nATOM      5  O   MET A   1      27.886  26.463   4.263  1.00 95.00           O\nATOM      6  N   LYS A   2      26.335  27.770   3.209  1.00 95.00           N\nATOM      7  CA  LYS A   2      26.850  29.021   3.755  1.00 95.00           C\nATOM      8  C   LYS A   2      27.672  28.751   5.012  1.00 95.00           C\nATOM      9  CB  LYS A   2      25.654  29.921   4.084  1.00 95.00           C\nATOM     10  O   LYS A   2      28.200  29.577   5.773  1.00 95.00           O\nATOM     11  N   THR A   3      27.838  27.467   5.261  1.00 95.00           N\nATOM     12  CA  THR A   3      28.594  27.050   6.441  1.00 95.00           C\nATOM     13  C   THR A   3      29.928  26.400   6.060  1.00 95.00           C\nATOM     14  CB  THR A   3      27.780  26.113   7.375  1.00 95.00           C\nATOM     15  O   THR A   3      30.015  25.757   5.002  1.00 95.00           O\nATOM     16  N   VAL A   4      30.923  26.582   6.936  1.00 95.00           N\nATOM     17  CA  VAL A   4      32.272  26.026   6.728  1.00 95.00           C\nATOM     18  C   VAL A   4      33.158  27.203   6.347  1.00 95.00           C\nATOM     19  CB  VAL A   4      32.862  25.305   7.954  1.00 95.00           C\nATOM     20  O   VAL A   4      32.660  28.213   5.838  1.00 95.00           O\nATOM     21  N   ALA A   5      34.446  27.070   6.634  1.00 95.00           N\nATOM     22  CA  ALA A   5      35.403  28.133   6.306  1.00 95.00           C\nATOM     23  C   ALA A   5      36.738  27.487   5.935  1.00 95.00           C\nATOM     24  CB  ALA A   5      35.575  29.064   7.497  1.00 95.00           C\nATOM     25  O   ALA A   5      37.171  26.441   6.467  1.00 95.00           O\nEND\n",
      "chain_id": "A",
      "plddt_threshold": 70.0
    }
  ]
}
Status Codes:

Response

  • results (array of objects) — One result per input item, in the order requested:

    • sequence_index (int) — Zero-based index of the input sequence within the request batch

    • embeddings (array of objects, optional) — Mean-pooled sequence embeddings per SaProt encoder layer

      • layer (int) — Encoder layer index

      • embedding (array of floats) — Mean embedding vector for this layer, shape: [d_model], where d_model is the SaProt hidden size (implementation-dependent, constant across layers)

    • per_token_embeddings (array of objects, optional) — Per-residue embeddings per SaProt encoder layer

      • layer (int) — Encoder layer index

      • embeddings (array of arrays of floats) — Token-wise embedding matrix for this layer, shape: [L, d_model], where L is the sequence length after any structure-based masking or trimming, and d_model is the SaProt hidden size (implementation-dependent, constant across layers)

Example response:

http
HTTP/1.1 200 OK
Content-Type: application/json

      {
  "results": [
    {
      "sequence_index": 0,
      "embeddings": [
        {
          "layer": 33,
          "embedding": [
            -0.02189989760518074,
            0.2690432667732239,
            "... (truncated for documentation)"
          ]
        }
      ]
    }
  ]
}

Performance

  • Predictive accuracy (variant effects and stability) - ProteinGym DMS benchmarks (vs. ESM-2 650M sequence LM): SaProt achieves average Spearman ρ ≈ 0.46 vs. ≈ 0.41, giving ~10–15% higher rank-correlation when a reasonable single-chain structure is available - ClinVar missense pathogenicity: SaProt AUC ≈ 0.91 vs. ≈ 0.86 for ESM-2 650M, making it better suited for structure-aware clinical triage when you can supply a matching PDB and chain - On thermostability and related stability assays, SaProt reaches Spearman ρ up to ≈ 0.72 (thermostability) and ≈ 0.59 (stability assays), consistently outperforming sequence-only scoring (e.g., ESM-2 ≈ 0.68 on comparable thermostability data)

  • Comparison to other BioLM fitness / stability models - Versus GEMME (MSA-based): GEMME can outperform language models when deep MSAs are available but requires non-trivial MSA generation; SaProt is MSA-free and offers competitive or better performance than other MSA-free methods when good structures are available - Versus ESM-1v / ESM-2 scoring: sequence-only methods underperform SaProt at structure-sensitive positions (buried cores, catalytic residues, cofactor-binding sites); SaProt’s advantage diminishes in low-confidence or highly disordered regions where structure tokens are masked - Versus ESM2StabP (stability-focused regression): ESM2StabP can yield lower RMSE on specific curated stability datasets it was trained on; SaProt is more general-purpose, providing a single zero-shot interface for mixed functional and stability assays

  • Relation to structure prediction and complexes - SaProt is a structure-aware scoring/encoding model and does not generate 3D structures; typical usage is: obtain a structure (AlphaFold2, Boltz-2, ESMFold, or experimental PDB) once for the wildtype, then run SaProt for mutation scoring or embeddings - Compared to using pLDDT or ΔpLDDT from structure predictors as a proxy for fitness, SaProt’s learned fitness prior usually correlates better with DMS measurements for mutational scans - SaProt operates on single chains and ignores inter-chain geometry; for interface or multimer affinity design, dedicated complex models (e.g., DSM 650M PPI, HyperMPNN, RFdiffusion3, AlphaFold2 multimer) are preferred, with SaProt used for per-chain mutation effects

  • Robustness and practical workflow characteristics - Model behavior is deterministic for fixed inputs; repeated calls with the same sequence, PDB, chain, and mutation produce identical scores/embeddings - Performance depends primarily on structure quality and correct chain/sequence alignment; low pLDDT regions are automatically masked (default threshold 70.0), which protects against noisy coordinates but reduces structural signal and brings performance closer to sequence-only models - For large-scale fitness landscapes, SaProt’s structure-preserving masked marginal scoring allows scanning all 19 single-residue substitutions per position without rerunning structure prediction, enabling higher throughput and more consistent fitness estimates than workflows that recompute structures per mutant

Applications

  • Structure-aware variant impact scoring on protein–ligand complexes using SaProt’s masked marginal fitness scores, enabling teams to flag destabilizing or function-impairing pocket mutations (e.g., resistance hotspots in kinases, liability sites in receptor ectodomains) before expensive screening; its structure-aware tokenization (sequence + 3Di states from PDB, with low-pLDDT positions masked) helps distinguish mutations that mainly alter local geometry from those that disrupt key interaction patterns, but this should complement, not replace, full FEP or physics-based binding free-energy calculations

  • Pocket similarity analysis for target re-positioning and off-target risk assessment by embedding binding sites with SaProt and computing cosine similarity between mean pocket embeddings, allowing medicinal chemistry and safety teams to find unrelated proteins with similar pockets that might bind the same chemotype (e.g., nuclear receptor pockets mimicking a GPCR allosteric site); this is most informative when good-quality 3D structures are available for the chain/region of interest and less reliable for highly flexible or poorly resolved pockets where many residues fall below the pLDDT masking threshold

  • Ligand binding affinity or activity model bootstrapping by using SaProt’s mean or per-residue embeddings as fixed protein features and training lightweight regression or classification heads on in-house Kd/IC50 or hit/decoy data for a target class (e.g., kinases, nuclear receptors, proteases), reducing data requirements and training time compared with training 3D GNNs from scratch while still capturing interaction-relevant pocket context learned from structure-aware pretraining; performance remains constrained by the size, quality, and chemical diversity of the organization’s own SAR data

  • Fragment hotspot and druggability-style pocket characterization by combining SaProt pocket embeddings with simple KNN or shallow models trained on existing druggability and pocket-property labels (e.g., Fpocket scores, solvent exposure), helping chemistry and platform teams assess whether a newly observed pocket is likely suitable for small-molecule modulation and which subpockets (residue-level windows) appear most promising for fragment growing; because SaProt is trained on protein structures rather than explicit ligand chemotypes, predictions may be less accurate for highly atypical ligands (e.g., covalent warheads, metal-chelating scaffolds) and should be validated experimentally where possible

  • Early-stage generative design filtering and triage by embedding protein targets and candidate ligands (using an external ligand encoder) into a joint space and using simple learned or zero-shot interaction scores (e.g., cosine similarity between pocket and ligand embeddings or a small trained interaction head) as a fast pre-filter ahead of docking or physics-based rescoring, allowing design teams to down-select large enumerated or generative libraries to sets enriched for compatible pocket–ligand interaction patterns; these scores are most appropriate as relative prioritization signals and should not be interpreted as calibrated affinity values on their own

Limitations

  • Maximum Sequence Length and Batch Size: Each sequence must be between 1 and 1024 amino acids long; longer proteins must be truncated or split before calling the API. Each request can include between 1 and 8 items (items list length in SaProtEncodeRequest and SaProtScoreRequest); larger batches must be sharded client-side.

  • Strict Input Validation for Sequences and Structures: sequence accepts only unambiguous standard amino acids (no ambiguous or non-canonical residues). pdb must be valid PDB text containing the specified chain_id (1–2 characters). Any length or content mismatch between the sequence and residues in the selected chain will cause failures in 3Di token generation and will be rejected; multi-chain complexes must be split and scored per chain.

  • Dependence on 3D Structure Quality (pLDDT and Disordered Regions): SaProt relies on local structure tokens derived from the PDB. Residues with low confidence (per-residue pLDDT, read from the B-factor column) below the configured plddt_threshold (default 70.0) are structurally masked (their structural state is replaced with '#'). In intrinsically disordered, poorly predicted, or flexible regions, predictions effectively degrade to sequence-only behavior; for heavily disordered proteins or short peptides, structure-aware advantages are minimal and sequence-only models may be more appropriate.

  • Scoring Semantics and Fitness Interpretation: SaProtScoreRequestItem.mutation supports single or multiple point mutations in the format X{pos}Y (e.g. "V3A" or "V3A:Q4M"). The returned fitness_score is the sum over all specified sites of log P(mutant_AA) - log P(wildtype_AA) under the model’s structure-aware masked language distribution. This is a relative compatibility score, not an experimentally calibrated value (e.g. not directly ΔΔG or activity); strongly negative values are typically deleterious, but thresholds are protein- and task-dependent and should be interpreted or re-scaled using appropriate controls or labeled data.

  • Performance and Use-Case Boundaries: The predictor endpoint performs one forward pass per mutated position using masked-marginal scoring, so runtime scales linearly with the number of mutation sites; exhaustive scanning of every position with all 19 alternatives on long proteins can be computationally expensive. SaProt is optimized for single-chain, well-folded proteins (e.g. enzymes); it does not model inter-chain interactions or quaternary complexes, and is not specialized for antibody paratope/epitope modeling, peptide-only tasks, or explicit pocket–ligand design. For ultra–high-throughput sequence generation or screening, faster sequence-only or diffusion-based models may be preferable in early pipeline stages, with SaProt reserved for structure-aware re-ranking of smaller candidate sets.

  • Embedding Outputs and Downstream Use: SaProtEncodeRequestParams.include controls which embeddings are returned: "mean" yields per-item mean-pooled embeddings (embeddings in SaProtEncodeResponseResult), while "per_token" yields residue-level embeddings (per_token_embeddings). These vectors capture local structure-aware context but are not guaranteed to be comparable across arbitrarily different proteins without downstream task-specific modeling; for clustering, similarity search, or supervised prediction, you should benchmark SaProt embeddings against simpler sequence-only baselines to confirm that structure-aware features provide a measurable benefit for your specific application.

How We Use It

BioLM uses SaProt as a structure-aware scoring and encoding component in protein design and optimization workflows where 3D context is needed to compare sequence variants against an available or predicted structure. In enzyme and antibody campaigns, SaProt fitness scores and embeddings are combined with generative sequence models, AlphaFold-class predictors, and developability/property models to prioritize mutations that remain compatible with the structural scaffold and are worth synthesis. Standardized, scalable APIs let data science and ML teams plug SaProt into automated design–score–filter loops, while wet-lab groups receive variant shortlists whose predicted impacts reflect both sequence conservation and local geometry, reducing low-value constructs entering assays.

  • In multi-round optimization, SaProt scores contribute to multi-objective ranking that balances fitness-like scores with stability and manufacturability, supporting systematic exploration of sequence–structure space rather than ad hoc mutagenesis.

  • For portfolio-level variant triage (e.g., enzyme panels, antibody liabilities, or other prioritized positions), SaProt’s structure-aware scores and embeddings are accessed via the same APIs as other BioLM models, enabling consistent thresholds and reports across targets and programs.

References