Protuna is an optimization framework for iterative protein engineering campaigns. Starting from historical mutagenesis data or a single hit1, it proposes the batch of variants to test next.
Features
- Guided generation: Steer protein language models towards your design objectives with reward-guided generation – Feynman–Kac steering, classifier guidance, and beam search.
- Scalable screening: Ray-based distributed streaming APIs for large-scale screening on local accelerators or clusters.
- Modular campaigns: Combine interchangeable samplers, predictors, constraints, and acquisition strategies.
- Multiple design goals: Optimize for multiple properties with a primary objective and inequality constraints on the others.
Getting Started
Installation
Protuna requires Python 3.12 or higher.
pip install protuna
Building with AI Agents
The protuna-skills plugin gives AI coding agents the guidance and examples needed
to work with Protuna. Use it to build, and run optimization pipelines,
configure distributed inference, or extend the framework with custom components.
See the plugin guide for installation instructions for coding and science agents.
Quickstart
The following code builds and runs a simple Pipeline.
It starts by defining which mutations are allowed and how to sample narrower search spaces. The pipeline then samples random protein sequences in those subspaces, uses a multiple sequence alignment (MSA) to score them based on amino acid frequencies at the mutated sites, and selects up to 20 of the highest-scoring sequences.
from protuna import data
from protuna import optim
from protuna.optim import acquisitions
from protuna.optim import predictors
from protuna.optim import rules
from protuna.optim import samplers
from protuna.optim import spaces
dataset = data.get_dataset("gb1", source=data.DatasetSource.FLIP)
tokens = data.tokenizer.encode(dataset.target_sequence)
msa = data.TokenizedMSA.from_file(
dataset.get_msa_path(data.MSAProtocol.ColabFold), format="a3m"
)
design_space = spaces.DesignSpace.from_rules(
rules=[
# Positions are illustrative and use zero-based indexing.
rules.AllowOnly(positions=list(range(100, 125))),
rules.DenyResidues(amino_acids=["C"]),
rules.FixSites(positions=[105, 120]),
# Protect sites where the query residue is >= 95% conserved.
rules.MSAConserved(tokenized_msa=msa, threshold=0.95),
],
init_sequences=[tokens],
# Explore up to 4 subspaces, each with at most 3 mutable sites.
space_sampler=spaces.RandomMaskSampler(max_mutations=3, n_subspaces=4),
)
pipeline = optim.Pipeline(
design_space=design_space,
sampler=samplers.RandomSampler(max_samples=100), # Propose up to 4x100 variants
objective=predictors.PSSMZeroshotPredictor(tokens, msa, laplace_smoothing=True),
acquisition=acquisitions.Greedy(budget=20),
)
output = pipeline.run()
# Up to 20 sequences
candidates = data.tokenizer.decode(list(output.selection.token_ids))
See the pipeline documentation for configuration options or read the concepts overview to understand Protuna's workflow and core primitives.
Storage
Protuna stores cached downloads and default pipeline artifacts under $PROTUNA_HOME/protuna. If PROTUNA_HOME is unset, it uses $XDG_CACHE_HOME/protuna, falling back to $HOME/.cache/protuna.
You can configure pipeline runs to store artifacts in another folder or directly in cloud storage (AWS, Azure, or GCP) to support large exploration campaigns.
Concepts
Protuna separates candidate generation from experimental batch selection. A Pipeline combines four steps:
- Defining the search region. A
DesignSpaceholds starting sequences and their allowed substitutions and can sample smaller search spaces for independent exploration. - Generating proposals. A
Samplerproposes sequences within each search space. - Evaluating proposals. A
Predictorestimates the objective property. Hard constraints reject candidates; soft constraints provide feasibility probabilities. - Selecting candidates. An
Acquisitionselects candidates within your budget, using criteria such as predicted fitness, uncertainty, or diversity.
Selection is limited to the candidates proposed by the sampler. Protein language models provide a useful prior over plausible sequences, but their likelihoods need not align with a campaign’s objective. Protuna supports reward-guided generation to steer exploration towards desired properties, using inference-time steering, externally aligned generators, or both.
Optional recycling uses promising candidates as parents for the next generation cycle, allowing subsequent cycles to build on promising mutations.
Read the optimization overview for the broader campaign workflow. To extend Protuna, see the guides for custom model adapters, samplers, and acquisitions.
Modules
| Module | Description |
|---|---|
| protuna.optim | The primary optimization framework. It contains all the primitives needed to set up and run your protein optimization task. |
| protuna.inference | Distributed inference interface and a few illustrative model adapters. |
| protuna.data | Common preprocessed public benchmark datasets, MSA handling, and tokenization modules. |
| protuna.score | Functional library of protein scoring methods such as zero-shot variant effect prediction (VEP) and contact prediction using a categorical Jacobian. |
| protuna.train (coming soon) | Future releases will include trainers and recipes for few-shot property prediction models, fine-tuning, and preference alignment of generators. |
Upcoming Releases
See the roadmap for upcoming releases.
Contributing
See CONTRIBUTING.md.
Citation
If you use Protuna in your research, please cite this software:
@software{protuna2026,
title = {{Protuna: An optimization framework for AI-guided protein engineering}},
author = {Shreshtha, Kumar},
url = {https://github.com/kumarshreshtha/protuna},
year = {2026},
version = {0.1.0}
}
-
Successfully generating candidates from a single data point depends on how well your goals, the zero-shot proxies you use for scoring, and the sampler's likelihoods align. ↩
Metadata
Release files for protuna 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| protuna-0.1.0.tar.gz | 246.1 kB | With provenance | Details for protuna-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| protuna-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for protuna-0.1.0-py3-none-any.whl |
Total release size: 409.5 kB
Release files / protuna-0.1.0.tar.gz
| Download URL | protuna-0.1.0.tar.gz |
|---|---|
| Size | 246.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
236bed148fd71be91262e7b0df32c90d89d3e147c598f23d3902cf83cfdd9f66
|
|
BLAKE2b-256 checksum How to use checksums |
31d93a2451cd3cd558046dc445f43ad53308499738a0a7da69f2c682a6607f99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / protuna-0.1.0-py3-none-any.whl
| Download URL | protuna-0.1.0-py3-none-any.whl |
|---|---|
| Size | 163.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3708aa35e91dd0a95c5394b2e277568d0e0f3f4d1158f4942dfb995d95b4911
|
|
BLAKE2b-256 checksum How to use checksums |
bfdcbc95d82c3b9995b0fa565059795cf372b176b8eb6f1b94111213c5fd13f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for protuna 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for protuna-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.