protlms
Unified toolkit for inference across a variety of protein language models (pLMs).
protlms is a lightweight client/CLI that gives you one interface for embeddings
and likelihoods regardless of the underlying model. The client itself carries no
ML dependencies — each model ships as a standalone Docker image, and the client
talks to images through a standardized container contract.
See docs/VISION.md for the full design.
Installation
pip install -e ".[dev]"
Quick start
Build a model image (the tiny ESM2 demo model), then run inference through the client:
# build the demo image (weights baked in)
docker build --build-arg ESM2_CHECKPOINT=esm2_t6_8M -t protlms-esm2:t6_8M containers/esm2
protlms models list # available models
protlms embed esm2-8m seqs.fasta -o out/ --pooling mean # pooled embeddings (.npz)
protlms embed esm2-8m seqs.fasta -o out/ --pooling none # per-residue embeddings (.npy)
protlms likelihood esm2-8m seqs.fasta -o out/ # pseudo-log-likelihoods (.csv)
protlms embed esm2-8m seqs.fasta -o out/ --gpu # run on GPU
import protlms
model = protlms.load("esm2-8m")
emb = model.embed("seqs.fasta", pooling="mean")
print(emb.pooled()) # {record_id: (embedding_dim,) array}
ll = model.likelihood("seqs.fasta")
print(ll.rows()) # per-sequence likelihood / perplexity
Project layout
| Path | What it is |
|---|---|
src/protlms/contract.py |
Contract schemas (manifest, result, errors). |
src/protlms/registry.py |
Model name → image resolution (_data/models.yaml). |
src/protlms/runner.py |
Docker invocation behind a swappable Runner interface. |
src/protlms/io.py |
FASTA parsing, input staging, output parsing. |
src/protlms/models.py |
protlms.load() and the unified Model interface. |
containers/esm2/ |
Reference contract-compliant model image. |
docs/CONTRACT.md |
The container contract specification. |
Development
pytest # run the test suite
ruff check src/ tests/ # lint
ruff format src/ tests/ # format
ty check src/ # type check
All tooling is configured in pyproject.toml — there are no separate config files.
License
MIT — see LICENSE.
Metadata
Release files for protlms 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 | |
|---|---|---|---|
| protlms-0.1.0.tar.gz | 144.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| protlms-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 170.4 kB
Release files / protlms-0.1.0.tar.gz
| Download URL | protlms-0.1.0.tar.gz |
|---|---|
| Size | 144.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c90a3d0bf6680a71d823e557ef8885da5c6807a227ad1c0be3842e44d3d85bf
|
|
BLAKE2b-256 checksum How to use checksums |
4fd453d9e4431d9cd6177f732af93fa158d24293b74356e6c7af353a2c400f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 21, 2026.
Transparency logRelease files / protlms-0.1.0-py3-none-any.whl
| Download URL | protlms-0.1.0-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6755676b1db1afe2cfd4c83b2a847776978cb5da2e82e1587cec05bba622632f
|
|
BLAKE2b-256 checksum How to use checksums |
543605dc1101c2378632601febc4766f877e0ef4dda59e199eabb3109fabcfdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 21, 2026.
Transparency log