Text Generation
Transformers
Safetensors
gpt2
biology
protein
protein-language-model
knowledge-distillation
protein-engineering
drug-discovery
fine-tuning
domain-adaptation
text-generation-inference
Instructions to use littleworth/protgpt2-distilled-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use littleworth/protgpt2-distilled-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="littleworth/protgpt2-distilled-small")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("littleworth/protgpt2-distilled-small") model = AutoModelForMultimodalLM.from_pretrained("littleworth/protgpt2-distilled-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use littleworth/protgpt2-distilled-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "littleworth/protgpt2-distilled-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "littleworth/protgpt2-distilled-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/littleworth/protgpt2-distilled-small
- SGLang
How to use littleworth/protgpt2-distilled-small 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 "littleworth/protgpt2-distilled-small" \ --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": "littleworth/protgpt2-distilled-small", "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 "littleworth/protgpt2-distilled-small" \ --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": "littleworth/protgpt2-distilled-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use littleworth/protgpt2-distilled-small with Docker Model Runner:
docker model run hf.co/littleworth/protgpt2-distilled-small
docs: cite bioRxiv preprint (doi:10.64898/2026.02.17.706304)
Browse files
README.md
CHANGED
|
@@ -20,7 +20,7 @@ base_model: nferruz/ProtGPT2
|
|
| 20 |
|
| 21 |
A compact protein language model distilled from [ProtGPT2](https://huggingface.co/nferruz/ProtGPT2) using **complementary-regularizer distillation**---a method that combines uncertainty-aware position weighting with calibration-aware label smoothing to achieve 54% better perplexity than standard knowledge distillation at 9.4x compression.
|
| 22 |
|
| 23 |
-
> **
|
| 24 |
> **Code**: [github.com/ewijaya/protein-lm-distill](https://github.com/ewijaya/protein-lm-distill)
|
| 25 |
|
| 26 |
## Model Summary
|
|
@@ -183,10 +183,17 @@ Recommended fine-tuning hyperparameters for this model:
|
|
| 183 |
## Citation
|
| 184 |
|
| 185 |
```bibtex
|
| 186 |
-
@article{
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
| 191 |
```
|
| 192 |
|
|
|
|
| 20 |
|
| 21 |
A compact protein language model distilled from [ProtGPT2](https://huggingface.co/nferruz/ProtGPT2) using **complementary-regularizer distillation**---a method that combines uncertainty-aware position weighting with calibration-aware label smoothing to achieve 54% better perplexity than standard knowledge distillation at 9.4x compression.
|
| 22 |
|
| 23 |
+
> **Preprint**: *Distilling Protein Language Models with Complementary Regularizers* (Wijaya, 2026) — [bioRxiv](https://www.biorxiv.org/content/10.64898/2026.02.17.706304)
|
| 24 |
> **Code**: [github.com/ewijaya/protein-lm-distill](https://github.com/ewijaya/protein-lm-distill)
|
| 25 |
|
| 26 |
## Model Summary
|
|
|
|
| 183 |
## Citation
|
| 184 |
|
| 185 |
```bibtex
|
| 186 |
+
@article {Wijaya2026.02.17.706304,
|
| 187 |
+
author = {Wijaya, Edward},
|
| 188 |
+
title = {Distilling Protein Language Models with Complementary Regularizers},
|
| 189 |
+
elocation-id = {2026.02.17.706304},
|
| 190 |
+
year = {2026},
|
| 191 |
+
doi = {10.64898/2026.02.17.706304},
|
| 192 |
+
publisher = {Cold Spring Harbor Laboratory},
|
| 193 |
+
abstract = {Large autoregressive protein language models generate novel sequences de novo, but their size limits throughput and precludes rapid domain adaptation on scarce proprietary data. We distill a 738M-parameter protein language model into compact students using two protein-specific enhancements, uncertainty-aware position weighting and calibration-aware label smoothing, that individually degrade quality yet combine for substantial improvement. We trace this complementary-regularizer effect to information theory: smoothing denoises teacher distributions while weighting amplifies the cleaned signal at biologically variable positions. Students achieve up to 5x inference speedup, preserve natural amino acid distributions, and require as little as 170 MB of GPU memory, enabling deployment on consumer-grade hardware. When fine-tuned on protein families with as few as 50 sequences, students generate more family-matching sequences than the teacher, achieving higher sample efficiency and Pfam hit rates despite their smaller capacity. These results establish distilled protein language models as superior starting points for domain adaptation on scarce data.Competing Interest StatementThe authors have declared no competing interest.},
|
| 194 |
+
URL = {https://www.biorxiv.org/content/early/2026/02/25/2026.02.17.706304},
|
| 195 |
+
eprint = {https://www.biorxiv.org/content/early/2026/02/25/2026.02.17.706304.full.pdf},
|
| 196 |
+
journal = {bioRxiv}
|
| 197 |
}
|
| 198 |
```
|
| 199 |
|