ProGen2 API

ProGen2, with models up to 6.4B parameters, is adept at generating viable protein sequences and predicting their fitness. It's utilized in protein design, trained on data from genomic and metagenomic sources.




API Call with Python requests

We need to make sure we have the Python requests module loaded first.

import time
from biolmai import BioLM
from IPython.display import JSON  # Helpful UI for JSON display

ProGen2 Medium

data = {
    "params": {
        "temperature": 0.1,  # Temperature
        "top_p": 0.6,  # Nucleus sampling probability
        "num_samples": 2,  # Number of proteins to generate
        "max_length": 175  # Max length of generated proteins
    },
    "items": [
        {
            "context": "MA"  # Starting amino acid(s) for protein
        }
    ]
}

result = BioLM(entity="progen2-medium", action="generate",  items=data["items"], params=data["params"])

result
[{'sequence': 'MASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS',
  'll_sum': -24.980133056640625,
  'll_mean': -0.14356398582458496},
 {'sequence': 'MASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS',
  'll_sum': -24.980133056640625,
  'll_mean': -0.14356398582458496}]

We can view this a bit more easily below:

JSON(result)
<IPython.core.display.JSON object>

ProGen2 OAS

data = {
    "params": {
        "temperature": 0.7,  # Temperature
        "top_p": 0.6,  # Nucleus sampling probability
        "num_samples": 2,  # Number of proteins to generate
        "max_length": 175  # Max length of generated proteins
    },
    "items": [
        {
            "context": "EVQ"  # Starting amino acids for Antibody
        }
    ]
}

result = BioLM(entity="progen2-oas", action="generate",  items=data["items"], params=data["params"])

result
[{'sequence': 'EVQLVESGGGLVQPGGSLRLSCAASGFTFSSYWMSWVRQAPGKGLEWVANIKQDGSEKYYVDSVKGRFTISRDNAKNSLYLQMNSLRAEDTAVYYCARDRRDGYNYFDYWGQGTLVTVSS',
  'll_sum': -22.199049949645996,
  'll_mean': -0.18499208241701126},
 {'sequence': 'EVQLVESGGGLVQPGGSLRLSCAASGFTFSSYWMSWVRQAPGKGLEWVANIKQDGSEKYYVDSVKGRFTISRDNAKNSLYLQMNSLRAEDTAVYYCARDGRIAAAGTSYYYYGMDVWGQGTTVTVSS',
  'll_sum': -25.153675079345703,
  'll_mean': -0.19806043803691864}]
JSON(result)
<IPython.core.display.JSON object>

ProGen2 BFD90

data = {
    "params": {
        "temperature": 0.7,  # Temperature
        "top_p": 0.6,  # Nucleus sampling probability
        "num_samples": 2,  # Number of proteins to generate
        "max_length": 175  # Max length of generated proteins
    },
    "items": [
        {
            "context": "M"  # Starting amino acid(s) for protein
        }
    ]
}

result = BioLM(entity="progen2-bfd90", action="generate",  items=data["items"], params=data["params"])

result
JSON(result)
<IPython.core.display.JSON object>

Next Steps

Check out additional tutorials at jupyter.biolm.ai, or head over to our BioLM Documentation to explore additional models and functionality.

See more use-cases and APIs on your BioLM Console Catalog.


BioLM hosts deep learning models and runs inference at scale. You do the science.

Contact us to learn more.

<span></span>

Accelerate yourLead generation

BioLM offers tailored AI solutions to meet your experimental needs. We deliver top-tier results with our model-agnostic approach, powered by our highly scalable and real-time GPU-backed APIs and years of experience in biological data modeling, all at a competitive price.

CTA

We speak the language of bio-AI

© 2022 - 2025 BioLM. All Rights Reserved.