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
model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- moe
|
| 9 |
+
- mixture-of-experts
|
| 10 |
+
- gravity
|
| 11 |
+
- txgravity
|
| 12 |
+
- therapeutics
|
| 13 |
+
- tdc
|
| 14 |
+
- trillion-labs
|
| 15 |
+
base_model:
|
| 16 |
+
- trillionlabs/Gravity-30B-A5B
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# TxGravity-30B-A6B-Open
|
| 20 |
+
|
| 21 |
+
## Model Summary
|
| 22 |
+
|
| 23 |
+
**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.
|
| 24 |
+
|
| 25 |
+
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.
|
| 26 |
+
|
| 27 |
+
| Property | Value |
|
| 28 |
+
|---|---|
|
| 29 |
+
| Total Parameters | 29.56B |
|
| 30 |
+
| Active Parameters | ~6B |
|
| 31 |
+
| Architecture | GravityMoE (DeepSeek-V3-compatible) |
|
| 32 |
+
| Layers | 52 |
|
| 33 |
+
| Routed / Shared Experts | 64 (top-8) / 1 |
|
| 34 |
+
| Context Length | 8,192 tokens |
|
| 35 |
+
| Precision | bf16 |
|
| 36 |
+
| Base model | Gravity-30B-A5B |
|
| 37 |
+
|
| 38 |
+
> ⚠️ 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.
|
| 39 |
+
|
| 40 |
+
## Performance
|
| 41 |
+
|
| 42 |
+
Evaluated on the TDC therapeutic benchmark against a reproduced **TxGemma-27B** baseline across 60 comparable tasks:
|
| 43 |
+
|
| 44 |
+
**16 wins · 26 ties · 18 losses**
|
| 45 |
+
|
| 46 |
+
Selected results (TxGravity vs TxGemma-27B):
|
| 47 |
+
|
| 48 |
+
| Task | Metric | TxGravity | TxGemma-27B |
|
| 49 |
+
|---|---|---|---|
|
| 50 |
+
| bindingdb_ki | PCC ↑ | **0.750** | −0.112 |
|
| 51 |
+
| bindingdb_ic50 | Spearman ↑ | **0.766** | 0.643 |
|
| 52 |
+
| protein_sabdab | MAE ↓ | **0.969** | 2.332 |
|
| 53 |
+
| ld50_zhu | MAE ↓ | **0.651** | 0.776 |
|
| 54 |
+
| drugcomb_css | MAE ↓ | **7.838** | 9.418 |
|
| 55 |
+
| bioavailability_ma | AUROC ↑ | **0.749** | 0.697 |
|
| 56 |
+
| bbb_martins | AUROC ↑ | **0.919** | 0.897 |
|
| 57 |
+
| ames | AUROC ↑ | **0.841** | 0.830 |
|
| 58 |
+
| davis | MSE ↓ | 0.760 | **0.643** |
|
| 59 |
+
| kiba | MSE ↓ | 0.637 | **0.460** |
|
| 60 |
+
|
| 61 |
+
Full per-task results (66 tasks, metric, N, margin, verdict) are in [`summary.csv`](./summary.csv).
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 67 |
+
tok = AutoTokenizer.from_pretrained("trillionlabs/TxGravity-30B-A6B-Open")
|
| 68 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 69 |
+
"trillionlabs/TxGravity-30B-A6B-Open", dtype="bfloat16", device_map="auto")
|
| 70 |
+
|
| 71 |
+
messages = [{"role": "user", "content": "<TDC-formatted instruction here>"}]
|
| 72 |
+
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 73 |
+
out = model.generate(ids, max_new_tokens=16)
|
| 74 |
+
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
The model expects TDC-style prompts and answers in TDC format: `(A)`/`(B)` for classification, or a `000`–`1000` normalized bin for regression.
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
Apache 2.0
|