Welcome to BioLM Python Client Docs#
Quickstart#
Install the package:
pip install biolmai
Basic usage (one-off calls with biolm()). These calls are synchronous (blocking) but use an async backend internally, so you get concurrent batch performance without writing async code.
from biolmai import biolm
# Encode a single sequence
result = biolm(entity="esm2-8m", action="encode", type="sequence", items="MSILVTRPSPAGEEL")
# Predict a batch of sequences
result = biolm(entity="esmfold", action="predict", type="sequence", items=["SEQ1", "SEQ2"])
# Write results to disk
biolm(entity="esmfold", action="predict", type="sequence", items=["SEQ1", "SEQ2"], output='disk', file_path="results.jsonl")
Overview#
The BioLM Python client provides a high-level, user-friendly interface for interacting with the BioLM API. It supports both synchronous and asynchronous usage, automatic batching, flexible error handling, and efficient processing of biological data.
Main features:
High-level BioLM constructor for quick requests
Sync and async interfaces
Automatic or custom rate limiting/throttling
Schema-based batch size detection
Flexible input formats (single key + list, or list of dicts)
Low memory usage via generators
Flexible error handling (raise, continue, or stop on error)
Universal HTTP client for both sync and async