Instructions to use trillionlabs/gravity-sft-v7-agentic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trillionlabs/gravity-sft-v7-agentic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trillionlabs/gravity-sft-v7-agentic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trillionlabs/gravity-sft-v7-agentic") model = AutoModelForCausalLM.from_pretrained("trillionlabs/gravity-sft-v7-agentic") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trillionlabs/gravity-sft-v7-agentic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trillionlabs/gravity-sft-v7-agentic" # 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/gravity-sft-v7-agentic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trillionlabs/gravity-sft-v7-agentic
- SGLang
How to use trillionlabs/gravity-sft-v7-agentic 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/gravity-sft-v7-agentic" \ --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/gravity-sft-v7-agentic", "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/gravity-sft-v7-agentic" \ --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/gravity-sft-v7-agentic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trillionlabs/gravity-sft-v7-agentic with Docker Model Runner:
docker model run hf.co/trillionlabs/gravity-sft-v7-agentic
gravity-sft-v7-agentic
Agentic SFT model trained on trillionlabs/cyan-agentic-v7. Optimized for
tool-calling and terminal-style agent trajectories in three complementary
formats (structured tool_calls, JSON-list, BFCL Python-syntax) with
loop-recovery signal from openagent v1 augmentations.
Model summary
- Architecture: DeepseekV3-style MoE (52 layers, 64 experts, top-8, 1 shared expert, 2 dense layers).
- Params: ~29.5B total, ~5.3B active per token.
- Context: 131,072 tokens (RoPE θ = 1e6).
- Tokenizer: GLM-151k SFT.
- Precision: bfloat16.
Training
- Dataset:
trillionlabs/cyan-agentic-v7— 420,936 rows, mixture of xlam, nemotron (both in rawtool_callsand BFCL Python-syntax variants), envgen_v2 (TerminalBench + OfficeBench), openagent-v1 loop-recovery augmentations, and endless-terminal SFT. - Init:
llama_pro_cyan_renew_lc/0000000600(clean base checkpoint). - Epochs: 3 (step 1224 = end of epoch 3, uploaded here).
- Optimizer: Muon, lr 2e-5, cosine schedule with 50-step warmup, min ratio 0.1, grad clip 1.0.
- Global batch: 4.19M tokens/step (dp_shard=16, batch_size=2, seq_len=131072).
- Hardware: 2× nodes with 8× B200 (16 GPUs), FSDP + activation checkpointing.
- Per-turn loss masking: bad turns (
looped_stuck,mistake_later_fixed,redundant_step,hallucination) are masked out of the loss via the chat template's{% generation %}markers.
Supported call formats
The model is trained to answer in three formats depending on the system prompt it receives:
Structured
tool_calls— standard OpenAI-stylerole=assistant / tool_callswith pairedrole=toolobservation messages.JSON-list content — assistant emits
[{"name": "fn", "arguments": {...}}]in the content field; observations come back as user turns containing a stringified list-of-dicts.BFCL Python-syntax — assistant emits
[fn_name(arg=val, ...)]and nothing else; observations come back as user turns of the form[{'role': 'tool', 'name': "fn(arg='val')", 'content': "..."}, ...].
The dataset card at
trillionlabs/cyan-agentic-v7
documents the format matrix per source.
Usage
sglang
python -m sglang.launch_server \
--model-path trillionlabs/gravity-sft-v7-agentic \
--tp 8 \
--dtype bfloat16 \
--moe-runner-backend triton \
--context-length 131072 \
--host 0.0.0.0 --port 8080
transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("trillionlabs/gravity-sft-v7-agentic")
model = AutoModelForCausalLM.from_pretrained(
"trillionlabs/gravity-sft-v7-agentic",
torch_dtype="bfloat16",
device_map="auto",
)
Note: the exported config.json includes moe_layer_freq: 1 so the model
loads under sglang's DeepseekV3 config path without patches.
Related
- Dataset:
trillionlabs/cyan-agentic-v7 - Previous mix:
trillionlabs/cyan-agentic-v6.1
License
Apache 2.0.
- Downloads last month
- -