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
Download tools/colab_k3rescue_public.py from STAR-future/Trinity: direct link, hf CLI and curl.
- Browser
- Download file 2.24 kB
-
https://huggingface.co/STAR-future/Trinity/resolve/main/tools/colab_k3rescue_public.py
- Command line
-
hf download hf://STAR-future/Trinity/tools/colab_k3rescue_public.py
-
curl -L -o colab_k3rescue_public.py https://huggingface.co/STAR-future/Trinity/resolve/main/tools/colab_k3rescue_public.py
2.24 kB
| """Colab cell run AFTER a k3pass 'train2'/'train3' pass, in the same runtime (Colab disk /content/k3p/out_<mode>). | |
| The private storage of STAR-future is full (2026-11-21), so the per-token cache of these PUBLIC CC0 texts goes to the | |
| PUBLIC dataset STAR-future/Trinity-k3cache-<mode> (founder's decision, HUMAN_APPROVALS 2026-11-21). Holdouts stay private. | |
| import os; os.environ['K3P'] = 'train2' # or 'train3' | |
| exec(open(h.hf_hub_download('STAR-future/Trinity', 'tools/colab_k3rescue_public.py', token=os.environ['HF_TOKEN'], | |
| force_download=True)).read()) | |
| """ | |
| import json | |
| import os | |
| import time | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| api = HfApi(token=os.environ["HF_TOKEN"]) | |
| MODE = os.environ.get("K3P", "train2") | |
| REPO = f"STAR-future/Trinity-k3cache-{MODE}" | |
| NEEDED = ("summary.json", "x92.npy", "acc92.npy", "A92.npy", "Zm92.npy", "prefix92.npy", "target92.npy") | |
| out = Path(f"/content/k3p/out_{MODE}") | |
| summary = out / "summary.json" | |
| if not summary.exists(): | |
| raise SystemExit(f"no finished {MODE} pass in this runtime") | |
| lr = json.loads(summary.read_text()).get("layers_run") | |
| if lr != 93: | |
| raise SystemExit(f"{MODE} pass ran {lr} layers, not 93: nothing to rescue") | |
| api.create_repo(REPO, repo_type="dataset", private=False, exist_ok=True) | |
| have = set(api.list_repo_files(REPO, repo_type="dataset")) | |
| for name in sorted(p.name for p in out.iterdir() if p.suffix in (".npy", ".json")): | |
| if f"{MODE}/{name}" in have: | |
| print("already there:", name) | |
| continue | |
| for attempt in range(4): | |
| try: | |
| api.upload_file(path_or_fileobj=str(out / name), path_in_repo=f"{MODE}/{name}", repo_id=REPO, | |
| repo_type="dataset", commit_message=f"k3pass cache {MODE}: {name}") | |
| print("uploaded", name, round((out / name).stat().st_size / 2 ** 30, 2), "GiB", flush=True) | |
| break | |
| except Exception as e: # noqa: BLE001 | |
| print("retry", name, attempt, type(e).__name__, str(e)[:160], flush=True) | |
| time.sleep(30) | |
| missing = [n for n in NEEDED if f"{MODE}/{n}" not in set(api.list_repo_files(REPO, repo_type="dataset"))] | |
| print("MISSING:", missing if missing else "none", flush=True) | |