Image-Text-to-Text
Transformers
Safetensors
kimi_k31
text-generation
mixture-of-experts
expert-upcycling
scientific-ai
chip-design
space
physics
s-t-a-r
custom_code
8-bit precision
Instructions to use STAR-future/Trinity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STAR-future/Trinity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="STAR-future/Trinity", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("STAR-future/Trinity", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use STAR-future/Trinity with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "STAR-future/Trinity" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "STAR-future/Trinity", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/STAR-future/Trinity
- SGLang
How to use STAR-future/Trinity 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 "STAR-future/Trinity" \ --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": "STAR-future/Trinity", "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 "STAR-future/Trinity" \ --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": "STAR-future/Trinity", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use STAR-future/Trinity with Docker Model Runner:
docker model run hf.co/STAR-future/Trinity
H6-lite on GPUs < 39 GB
Browse files- tools/colab_k3pass.py +9 -1
tools/colab_k3pass.py
CHANGED
|
@@ -279,11 +279,19 @@ if MODE == "h6":
|
|
| 279 |
force_download=True)).read_bytes())
|
| 280 |
h6 = W / "h6"
|
| 281 |
h6_doms = os.environ.get("H6_DOMAINS", "chips,space,physics")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
if not (h6 / "full_tail_wsp.pt").exists():
|
| 283 |
rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
|
| 284 |
str(W / "out_train3"), *extra, "--out", str(h6), "--domains", h6_doms,
|
| 285 |
"--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
|
| 286 |
-
|
| 287 |
"--skip-prefix-tokens", "2", "--lr", "1.5e-4", "--epochs", "3.0",
|
| 288 |
"--kl", "6.0", "--block-size", "256"], "h6_train.log")
|
| 289 |
if rc != 0:
|
|
|
|
| 279 |
force_download=True)).read_bytes())
|
| 280 |
h6 = W / "h6"
|
| 281 |
h6_doms = os.environ.get("H6_DOMAINS", "chips,space,physics")
|
| 282 |
+
import torch
|
| 283 |
+
_h6_gpu = torch.cuda.get_device_properties(0).total_memory / 2 ** 30
|
| 284 |
+
# 2026-11-24 (prereg Amendment 3): 384 routed experts (w1+w3 ~58 MB each, ~22 GB) do not fit a 24 GB L4. Below
|
| 285 |
+
# 39 GB the run is "H6-lite": head r256 + tail r128 + final norm, no routed-expert LoRA. Recorded in h6_variant.json.
|
| 286 |
+
h6_routed = ["--k", "128", "--include-new-experts"] if _h6_gpu >= 39 else ["--k", "0"]
|
| 287 |
+
h6.mkdir(parents=True, exist_ok=True)
|
| 288 |
+
(h6 / "h6_variant.json").write_text(json.dumps({"gpu_gib": round(_h6_gpu, 1), "variant": "full" if _h6_gpu >= 39 else "lite",
|
| 289 |
+
"routed_args": h6_routed, "domains": h6_doms}))
|
| 290 |
if not (h6 / "full_tail_wsp.pt").exists():
|
| 291 |
rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
|
| 292 |
str(W / "out_train3"), *extra, "--out", str(h6), "--domains", h6_doms,
|
| 293 |
"--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
|
| 294 |
+
*h6_routed, "--routed-rank", "16", "--routed-alpha", "16",
|
| 295 |
"--skip-prefix-tokens", "2", "--lr", "1.5e-4", "--epochs", "3.0",
|
| 296 |
"--kl", "6.0", "--block-size", "256"], "h6_train.log")
|
| 297 |
if rc != 0:
|