Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protlms-0.1.0.tar.gz (144.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protlms-0.1.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

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

Hashes for protlms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c90a3d0bf6680a71d823e557ef8885da5c6807a227ad1c0be3842e44d3d85bf
MD5 1ecace40dcd4321ae22d060c1bb2f641
BLAKE2b-256 4fd453d9e4431d9cd6177f732af93fa158d24293b74356e6c7af353a2c400f35

See more details on using hashes here.

Provenance

The following attestation bundles were made for protlms-0.1.0.tar.gz:

Publisher: python-publish.yaml on briney/protlms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for protlms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6755676b1db1afe2cfd4c83b2a847776978cb5da2e82e1587cec05bba622632f
MD5 0c0fe7e4549f197a9c8bdc416343483a
BLAKE2b-256 543605dc1101c2378632601febc4766f877e0ef4dda59e199eabb3109fabcfdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for protlms-0.1.0-py3-none-any.whl:

Publisher: python-publish.yaml on briney/protlms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page