Unified toolkit for inference across a variety of protein language models (pLMs).
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protlms-0.1.0.tar.gz.
File metadata
- Download URL: protlms-0.1.0.tar.gz
- Upload date:
- Size: 144.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c90a3d0bf6680a71d823e557ef8885da5c6807a227ad1c0be3842e44d3d85bf
|
|
| MD5 |
1ecace40dcd4321ae22d060c1bb2f641
|
|
| BLAKE2b-256 |
4fd453d9e4431d9cd6177f732af93fa158d24293b74356e6c7af353a2c400f35
|
Provenance
The following attestation bundles were made for protlms-0.1.0.tar.gz:
Publisher:
python-publish.yaml on briney/protlms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protlms-0.1.0.tar.gz -
Subject digest:
1c90a3d0bf6680a71d823e557ef8885da5c6807a227ad1c0be3842e44d3d85bf - Sigstore transparency entry: 1892976996
- Sigstore integration time:
-
Permalink:
briney/protlms@2e96f9ff9c293a492d575975750b305dfa38374e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/briney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@2e96f9ff9c293a492d575975750b305dfa38374e -
Trigger Event:
release
-
Statement type:
File details
Details for the file protlms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: protlms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6755676b1db1afe2cfd4c83b2a847776978cb5da2e82e1587cec05bba622632f
|
|
| MD5 |
0c0fe7e4549f197a9c8bdc416343483a
|
|
| BLAKE2b-256 |
543605dc1101c2378632601febc4766f877e0ef4dda59e199eabb3109fabcfdf
|
Provenance
The following attestation bundles were made for protlms-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yaml on briney/protlms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protlms-0.1.0-py3-none-any.whl -
Subject digest:
6755676b1db1afe2cfd4c83b2a847776978cb5da2e82e1587cec05bba622632f - Sigstore transparency entry: 1892977134
- Sigstore integration time:
-
Permalink:
briney/protlms@2e96f9ff9c293a492d575975750b305dfa38374e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/briney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@2e96f9ff9c293a492d575975750b305dfa38374e -
Trigger Event:
release
-
Statement type: