Launch and track BioLM finetuning runs (XGBoost and DSM) from Python without
browser cookies. Install biolm-sdk and authenticate with BIOLM_TOKEN or
biolm login.
XGBoost finetune
from biolm.finetune import Finetune
result = Finetune.xgboost(
train_data=[{"sequence": "MKTAYIAKQRQ", "label": 1}],
embedding_models=["esm2-8m"],
task_type="classification",
run_name="my-xgb-run",
)
print(result["run_id"])
DSM finetune
DSM is a two-stage workflow (masked-LM pretrain, then RL). Launch stage 1:
from biolm.finetune import Finetune
result = Finetune.dsm_stage1(
train_data=[{"sequence": "MKTAYIAKQRQ"}],
run_name="my-dsm-stage1",
)
run_id = result["run_id"]
Finetune.wait(run_id)
All methods have async variants (e.g. Finetune.xgboost_async,
Finetune.dsm_stage1_async). Pass api_key= or set BIOLM_TOKEN for
authentication.
API
- class biolm.finetune.Finetune
Launch and track BioLM finetuning runs.
All methods are classmethods returning plain dicts.
*_dataarguments accept a list of row dicts ([{"sequence": ..., "label": ...}, ...]) or a raw CSV string; they are sent inline as JSON.- classmethod cancel(run_id: str, **kwargs) → dict
Synchronous wrapper for
cancel_async().
- classmethod dsm_rl(**kwargs) → dict
Synchronous wrapper for
dsm_rl_async().
- classmethod dsm_stage1(**kwargs) → dict
Synchronous wrapper for
dsm_stage1_async().
- classmethod dsm_stage2(**kwargs) → dict
Synchronous wrapper for
dsm_stage2_async().
- classmethod get_run(run_id: str, **kwargs) → dict
Synchronous wrapper for
get_run_async().
- classmethod progress(run_id: str, **kwargs) → dict
Synchronous wrapper for
progress_async().
- classmethod wait(run_id: str, *, poll_interval: float = 15.0, timeout: float | None = None, api_key: str | None = None, base_url: str | None = None) → dict
Block until run_id reaches a terminal state, returning its detail.
- classmethod xgboost(**kwargs) → dict
Synchronous wrapper for
xgboost_async().
See also
biolm package —
biolm.finetunemodule reference