Text Generation
Transformers
Safetensors
English
deepseek_v3
Mixture of Experts
mixture-of-experts
gravity
txgravity
therapeutics
tdc
trillion-labs
conversational
text-generation-inference
Instructions to use trillionlabs/TxGravity-30B-A5B-Open with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trillionlabs/TxGravity-30B-A5B-Open with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trillionlabs/TxGravity-30B-A5B-Open") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trillionlabs/TxGravity-30B-A5B-Open") model = AutoModelForCausalLM.from_pretrained("trillionlabs/TxGravity-30B-A5B-Open", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trillionlabs/TxGravity-30B-A5B-Open with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trillionlabs/TxGravity-30B-A5B-Open" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trillionlabs/TxGravity-30B-A5B-Open", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trillionlabs/TxGravity-30B-A5B-Open
- SGLang
How to use trillionlabs/TxGravity-30B-A5B-Open 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 "trillionlabs/TxGravity-30B-A5B-Open" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trillionlabs/TxGravity-30B-A5B-Open", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "trillionlabs/TxGravity-30B-A5B-Open" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trillionlabs/TxGravity-30B-A5B-Open", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trillionlabs/TxGravity-30B-A5B-Open with Docker Model Runner:
docker model run hf.co/trillionlabs/TxGravity-30B-A5B-Open
File size: 9,472 Bytes
802d85c 974cfce 802d85c 4c725af 974cfce 802d85c e2c7df7 802d85c 4c725af 802d85c f1159ac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | ---
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- moe
- mixture-of-experts
- gravity
- txgravity
- therapeutics
- tdc
- trillion-labs
base_model:
- trillionlabs/Gravity-30B-A5B
---
# TxGravity-30B-A6B-Open
## Model Summary
**TxGravity-30B-A6B-Open** is a therapeutics-focused, task-specialized model built on the **Gravity-30B-A5B** base. It predicts a broad range of therapeutic properties β small-molecule ADMET, toxicity, drugβtarget interaction, proteinβprotein and peptideβMHC interaction, and more β by converting the **Therapeutic Data Commons (TDC)** benchmark tasks into an instruction format for LLMs, in the same spirit as Google's TxGemma.
TxGravity is **co-developed by SK Biopharmaceuticals (SKBP) and Trillion Labs**.
It is trained on TDC tasks reformatted as single-turn instructions (instruction β answer), covering 57 tasks. Answers are formatted as `(A)`/`(B)` for binary classification or a normalized `000`β`1000` bin for regression.
This release is the open-license version, with any datasets restricted to non-commercial use excluded from training.
| Property | Value |
|---|---|
| Total Parameters | 29.56B |
| Active Parameters | ~6B |
| Architecture | GravityMoE (DeepSeek-V3-compatible) |
| Layers | 52 |
| Routed / Shared Experts | 64 (top-8) / 1 |
| Context Length | 8,192 tokens |
| Precision | bf16 |
| Base model | Gravity-30B-A5B |
> β οΈ This is a task-specialized property predictor, not a general instruction-tuned or safety-aligned assistant. Its outputs are intended for the TDC-style therapeutic prediction prompts it was trained on. Predictions may be inaccurate, biased, or incomplete and must be independently verified before any experimental, clinical, or decision-making use.
## Performance
Evaluated on the TDC therapeutic benchmark against a reproduced **TxGemma-27B** baseline. Over 60 comparable tasks: **16 wins / 26 ties / 18 losses** (6 tasks excluded for lack of a paper-reported comparison). A win/loss requires the margin to exceed the tie threshold; otherwise the task is scored a tie.
**Wins (16 tasks)** β TxGravity beats TxGemma-27B on: `bindingdb_ki`, `bindingdb_ic50`, `protein_sabdab`, `ppbr_az`, `caco2_wang`, `lipophilicity_astrazeneca`, `half_life_obach`, `clearance_hepatocyte_az`, `ld50_zhu`, `bioavailability_ma`, `buchwald_hartwig`, `drugcomb_css`, `drugcomb_loewe`, `drugcomb_zip`, `drugcomb_hsa`, `drugcomb_bliss` β spanning binding affinity, ADMET, toxicity, and drug-combination synergy.
Highlights: `bindingdb_ki` PCC **0.750** vs -0.112, `bindingdb_ic50` Spearman **0.766** vs 0.643, `protein_sabdab` MAE **0.969** vs 2.332, `ld50_zhu` MAE **0.651** vs 0.776.
### Full results
Margin is TxGravity - TxGemma, in percentage points (%p) for score metrics or relative percent (%rel) for error metrics (MAE/MSE, lower is better). Up-arrow = higher is better, down-arrow = lower is better.
| Task | Metric | N | TxGravity | TxGemma-27B | Margin | Verdict |
|---|---|---|---|---|---|---|
| bindingdb_ic50 | Spearman β | 35725 | **0.7660** | 0.6430 | +12.3%p | WIN |
| bindingdb_ki | PCC β | 11857 | **0.7500** | -0.1120 | +86.2%p | WIN |
| bioavailability_ma | AUROC β | 128 | **0.7490** | 0.6970 | +5.2%p | WIN |
| buchwald_hartwig | PCC β | 791 | **0.8920** | 0.8550 | +3.7%p | WIN |
| caco2_wang | MAE β | 182 | **0.4160** | 0.4660 | +10.7%rel | WIN |
| clearance_hepatocyte_az | Spearman β | 243 | **0.3240** | 0.2910 | +3.3%p | WIN |
| drugcomb_bliss | MAE β | 59708 | **3.7370** | 3.9280 | +4.9%rel | WIN |
| drugcomb_css | MAE β | 59708 | **7.8380** | 9.4180 | +16.8%rel | WIN |
| drugcomb_hsa | MAE β | 59708 | **3.5840** | 3.7880 | +5.4%rel | WIN |
| drugcomb_loewe | MAE β | 59708 | **6.4130** | 7.6720 | +16.4%rel | WIN |
| drugcomb_zip | MAE β | 59708 | **3.0610** | 3.4100 | +10.2%rel | WIN |
| half_life_obach | Spearman β | 135 | **0.3600** | 0.2890 | +7.1%p | WIN |
| ld50_zhu | MAE β | 1478 | **0.6510** | 0.7760 | +16.1%rel | WIN |
| lipophilicity_astrazeneca | MAE β | 840 | **0.5700** | 0.5950 | +4.2%rel | WIN |
| ppbr_az | MAE β | 559 | **8.2900** | 9.4180 | +12.0%rel | WIN |
| protein_sabdab | MAE β | 99 | **0.9690** | 2.3320 | +58.4%rel | WIN |
| ames | AUROC β | 1457 | **0.8410** | 0.8300 | +1.1%p | TIE |
| bbb_martins | AUROC β | 406 | **0.9190** | 0.8970 | +2.2%p | TIE |
| bindingdb_patent | PCC β | 49028 | **0.5410** | 0.5140 | +2.7%p | TIE |
| carcinogens_lagunin | Accuracy β | 56 | **0.8750** | 0.8930 | -1.8%p | TIE |
| clearance_microsome_az | Spearman β | 221 | **0.5000** | 0.4870 | +1.3%p | TIE |
| clintox | AUROC β | 297 | **0.7610** | 0.7560 | +0.5%p | TIE |
| cyp1a2_veith | AUPRC β | 2517 | **0.9310** | 0.9350 | -0.4%p | TIE |
| cyp2c19_veith | AUROC β | 2534 | **0.8940** | 0.8910 | +0.3%p | TIE |
| cyp2c9_veith | AUPRC β | 2419 | **0.7920** | 0.7820 | +1.0%p | TIE |
| cyp2d6_veith | AUPRC β | 2626 | **0.6840** | 0.6620 | +2.2%p | TIE |
| cyp3a4_veith | AUPRC β | 2467 | **0.8610** | 0.8410 | +2.0%p | TIE |
| dili | AUROC β | 96 | **0.8930** | 0.8890 | +0.4%p | TIE |
| herg | AUROC β | 132 | **0.8930** | 0.9000 | -0.7%p | TIE |
| herg_central | AUROC β | 61379 | **0.8760** | 0.8830 | -0.7%p | TIE |
| herg_karim | Accuracy β | 2690 | **0.7920** | 0.8000 | -0.8%p | TIE |
| hia_hou | AUROC β | 117 | **0.9860** | 0.9860 | +0.0%p | TIE |
| hiv | AUROC β | 8227 | **0.7640** | 0.7930 | -2.9%p | TIE |
| huri | AUPRC β | 4204 | **0.8080** | 0.7920 | +1.6%p | TIE |
| mhc2_iedb_jensen | AUROC β | 26856 | **0.8680** | 0.8500 | +1.8%p | TIE |
| pgp_broccatelli | AUROC β | 245 | **0.9380** | 0.9320 | +0.6%p | TIE |
| sarscov2_3clpro_diamond | AUROC β | 176 | **0.7470** | 0.7250 | +2.2%p | TIE |
| skin_reaction | AUROC β | 82 | **0.6510** | 0.6370 | +1.4%p | TIE |
| tox21 | AUROC β | 15600 | **0.8230** | 0.8430 | -2.0%p | TIE |
| toxcast | AUROC β | 307282 | **0.8970** | 0.9050 | -0.8%p | TIE |
| vdss_lombardo | Spearman β | 226 | **0.5820** | 0.5660 | +1.6%p | TIE |
| weber | AUROC β | 9417 | **0.7180** | 0.7390 | -2.1%p | TIE |
| bindingdb_kd | PCC β | 1630 | **0.5220** | 0.5960 | -7.4%p | LOSS |
| butkiewicz | AUROC β | 401997 | **0.7540** | 0.8620 | -10.8%p | LOSS |
| cyp2c9_substrate_carbonmangels | AUPRC β | 135 | **0.3460** | 0.4730 | -12.7%p | LOSS |
| cyp2d6_substrate_carbonmangels | AUPRC β | 135 | **0.7080** | 0.7380 | -3.0%p | LOSS |
| cyp3a4_substrate_carbonmangels | AUROC β | 135 | **0.6410** | 0.6950 | -5.4%p | LOSS |
| davis | MSE β | 1064 | **0.7600** | 0.6430 | -18.2%rel | LOSS |
| disgenet | MAE | 10495 | β | β | β | excluded |
| gdsc1 | PCC | 35462 | β | β | β | excluded |
| gdsc2 | PCC | 18541 | β | β | β | excluded |
| kiba | MSE β | 4537 | **0.6370** | 0.4600 | -38.5%rel | LOSS |
| leenay | Spearman β | 1520 | **0.1510** | 0.2260 | -7.5%p | LOSS |
| mhc1_iedb_imgt_nielsen | AUROC β | 37197 | **0.9200** | 0.9680 | -4.8%p | LOSS |
| mirtarbase | Accuracy β | 160033 | **0.5550** | 0.8040 | -24.9%p | LOSS |
| oncopolypharmacology | PCC β | 4647 | **0.5050** | 0.5690 | -6.4%p | LOSS |
| pampa_ncats | AUROC β | 408 | **0.6630** | 0.7080 | -4.5%p | LOSS |
| phase1 | AUROC | 561 | β | β | β | excluded |
| phase2 | AUROC | 1279 | β | β | β | excluded |
| phase3 | AUROC | 1200 | β | β | β | excluded |
| sabdab_chen | AUPRC β | 482 | **0.6580** | 0.7080 | -5.0%p | LOSS |
| sarscov2_vitro_touret | AUROC β | 298 | **0.4580** | 0.5300 | -7.2%p | LOSS |
| solubility_aqsoldb | MAE β | 1997 | **0.8550** | 0.8050 | -6.2%rel | LOSS |
| tap | MAE β | 240 | **5.4400** | 4.7850 | -13.7%rel | LOSS |
| uspto | Accuracy β | 221648 | **0.0000** | 0.0880 | -8.8%p | LOSS |
| uspto_yields | PCC β | 170728 | **-0.0571** | 0.1860 | -24.3%p | LOSS |
Also included in this repo as [`summary.csv`](./summary.csv).
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("trillionlabs/TxGravity-30B-A6B-Open")
model = AutoModelForCausalLM.from_pretrained(
"trillionlabs/TxGravity-30B-A6B-Open", dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "<TDC-formatted instruction here>"}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=16)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
```
The model expects TDC-style prompts and answers in TDC format: `(A)`/`(B)` for classification, or a `000`β`1000` normalized bin for regression.
## License
Apache 2.0
## Citation
```bibtex
@misc{txgravity2026,
title = {TxGravity-30B-A6B-Open},
author = {SK Biopharmaceuticals and Trillion Labs},
year = {2026},
howpublished = {\url{https://huggingface.co/trillionlabs/TxGravity-30B-A6B-Open}}
}
```
This model builds on the Therapeutic Data Commons (TDC) benchmark:
```bibtex
@article{huang2021therapeutics,
title = {Therapeutics Data Commons: Machine Learning Datasets and Tasks for Drug Discovery and Development},
author = {Huang, Kexin and Fu, Tianfan and Gao, Wenhao and Zhao, Yue and Roohani, Yusuf and Leskovec, Jure and Coley, Connor W and Xiao, Cao and Sun, Jimeng and Zitnik, Marinka},
journal = {Proceedings of Neural Information Processing Systems, NeurIPS Datasets and Benchmarks},
year = {2021}
}
```
|