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
Download README.md from trillionlabs/TxGravity-30B-A5B-Open: direct link, hf CLI and curl.
- Browser
- Download file 3.19 kB
-
https://huggingface.co/trillionlabs/TxGravity-30B-A5B-Open/resolve/802d85cc6b12b3fd3cffd0d99bf4357d2f347066/README.md
- Command line
-
hf download hf://trillionlabs/TxGravity-30B-A5B-Open@802d85cc6b12b3fd3cffd0d99bf4357d2f347066/README.md
-
curl -L -o README.md https://huggingface.co/trillionlabs/TxGravity-30B-A5B-Open/resolve/802d85cc6b12b3fd3cffd0d99bf4357d2f347066/README.md
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 — following the instruction format of the Therapeutic Data Commons (TDC) benchmark, in the same spirit as Google's TxGemma.
It is trained on TDC therapeutic instruction data (single-turn instruction → answer) covering 57 tasks. Answers are formatted as (A)/(B) for binary classification or a normalized 000–1000 bin for regression.
| 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 across 60 comparable tasks:
16 wins · 26 ties · 18 losses
Selected results (TxGravity vs TxGemma-27B):
| Task | Metric | TxGravity | TxGemma-27B |
|---|---|---|---|
| bindingdb_ki | PCC ↑ | 0.750 | −0.112 |
| bindingdb_ic50 | Spearman ↑ | 0.766 | 0.643 |
| protein_sabdab | MAE ↓ | 0.969 | 2.332 |
| ld50_zhu | MAE ↓ | 0.651 | 0.776 |
| drugcomb_css | MAE ↓ | 7.838 | 9.418 |
| bioavailability_ma | AUROC ↑ | 0.749 | 0.697 |
| bbb_martins | AUROC ↑ | 0.919 | 0.897 |
| ames | AUROC ↑ | 0.841 | 0.830 |
| davis | MSE ↓ | 0.760 | 0.643 |
| kiba | MSE ↓ | 0.637 | 0.460 |
Full per-task results (66 tasks, metric, N, margin, verdict) are in summary.csv.
Usage
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