Instructions to use McClain/PlasmidLM-kmer6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use McClain/PlasmidLM-kmer6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="McClain/PlasmidLM-kmer6", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("McClain/PlasmidLM-kmer6", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use McClain/PlasmidLM-kmer6 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "McClain/PlasmidLM-kmer6" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "McClain/PlasmidLM-kmer6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/McClain/PlasmidLM-kmer6
- SGLang
How to use McClain/PlasmidLM-kmer6 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "McClain/PlasmidLM-kmer6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "McClain/PlasmidLM-kmer6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "McClain/PlasmidLM-kmer6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "McClain/PlasmidLM-kmer6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use McClain/PlasmidLM-kmer6 with Docker Model Runner:
docker model run hf.co/McClain/PlasmidLM-kmer6
Configuration Parsing Warning:In UNKNOWN_FILENAME: "auto_map.AutoTokenizer" must be a string
PlasmidLM-kmer6 (v2.0 Cluster-Disjoint Base)
A 19.3M-parameter decoder-only transformer for conditional plasmid DNA sequence generation, pretrained from scratch on a BLAST-certified sequence-cluster-disjoint Addgene split (cluster_v3) with random circular start rotation and capped inverse-square-root minority upweighting (<=4x).
Versioning note:
mainand tagv2.0host the100,000-stepcluster_base_s42checkpoint (cluster_v3split). The original65,000-step source-ID-disjoint release is preserved on branchv1/ tagv1.0. For best conditional fidelity and viability, use the RL post-trained companion modelMcClain/PlasmidLM-kmer6-GRPO-plannotate.
Revision Comparison (frozen_panel_v3, n=468 clusters, t=0.3, <=4,096 new tokens)
| Revision / Checkpoint | Pretraining Split | Steps | GC Content | Viable | Useful@0.5 | BoK-4 Useful | Intact AMRFinder | Extra ORI/AMR |
|---|---|---|---|---|---|---|---|---|
v2.0 (main, cluster_base_s42) |
cluster_v3 (zero >=90%/90% overlap) |
100,000 | 50.4% | 74.1% | 47.7% | 78.4% | 55.2% | 0.57 |
v1.0 (v1 branch, hf_base) |
Source-ID-disjoint (108K) |
65,000 | 48.5% | 65.9% | 45.9% | 72.0% | 48.0% | 0.55 |
- Held-out
cluster_v3validation loss:0.9867(85.23%token accuracy) across zero-overlap circular sequence clusters. model.safetensorsSHA-256:c6499c7dbcc987500098036f61748cc7059d771ef659b92dc69243de3f6563de
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("McClain/PlasmidLM-kmer6", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("McClain/PlasmidLM-kmer6", trust_remote_code=True)
prompt = "<BOS><AMR_KANAMYCIN><ORI_COLE1><SEQ>"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=4096,
temperature=0.3,
top_p=0.95,
do_sample=True,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(outputs[0].tolist(), skip_special_tokens=False))
To pin the original v1.0 checkpoint:
model = AutoModelForCausalLM.from_pretrained("McClain/PlasmidLM-kmer6", revision="v1.0", trust_remote_code=True)
Links & Artifacts
- Interactive Demo (Space): https://huggingface.co/spaces/McClain/PlasmidSpace
- Paper: https://doi.org/10.64898/2026.05.19.725242
- Code: https://github.com/McClain-Thiel/PlasmidLLM
- Benchmark Summary Dataset: https://huggingface.co/datasets/McClain/PlasmidLM-Eval
- Datasets &
cluster_v3split:hf://buckets/McClain/PlasmidRL/datasets/ - Evaluation Archive (
rigor_20261116):hf://buckets/McClain/PlasmidLMEval/rigor_20261116/
Limitations
- Computational validation only (pLannotate + Prodigal + NCBI AMRFinderPlus); sequences are not wet-lab tested.
- Under strict homologous backbone holdout, rare low-copy origins (
<ORI_P15A>,<ORI_PSC101>) and soft copy-class tokens (<COPY_LOW>) remain hard without explicit constraints.
Citation
@article{thiel2026plasmidlm,
title = {{PlasmidLM}: A Promptable {DNA} Language Model via Verifiable-Reward Post-Training},
author = {Thiel, McClain and Barnes, Chris P.},
journal = {bioRxiv},
year = {2026},
doi = {10.64898/2026.05.19.725242},
url = {https://doi.org/10.64898/2026.05.19.725242},
}
- Downloads last month
- 295
Model tree for McClain/PlasmidLM-kmer6
Dataset used to train McClain/PlasmidLM-kmer6
Space using McClain/PlasmidLM-kmer6 1
Collection including McClain/PlasmidLM-kmer6
Evaluation results
- Useful-plasmid rate (T=0.5, single-shot) on frozen_panel_v3 (cluster-disjoint test panel, n=468 clusters)self-reported0.477
- Viability rate (single-shot) on frozen_panel_v3 (cluster-disjoint test panel, n=468 clusters)self-reported0.742
- Best-of-4 useful-plasmid rate on frozen_panel_v3 (cluster-disjoint test panel, n=468 clusters)self-reported0.784
- NCBI AMRFinderPlus intact-ORF recall on frozen_panel_v3 (cluster-disjoint test panel, n=468 clusters)self-reported0.552