Instructions to use InternScience/Sage-A1.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InternScience/Sage-A1.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="InternScience/Sage-A1.5") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("InternScience/Sage-A1.5") model = AutoModelForMultimodalLM.from_pretrained("InternScience/Sage-A1.5", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use InternScience/Sage-A1.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InternScience/Sage-A1.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InternScience/Sage-A1.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/InternScience/Sage-A1.5
- SGLang
How to use InternScience/Sage-A1.5 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 "InternScience/Sage-A1.5" \ --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": "InternScience/Sage-A1.5", "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 "InternScience/Sage-A1.5" \ --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": "InternScience/Sage-A1.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use InternScience/Sage-A1.5 with Docker Model Runner:
docker model run hf.co/InternScience/Sage-A1.5
Sage-A1.5 compatible and optimized with Strata Fork - Tested on RTX 5080
Full model, Strata build and optimized engine on the repo below, now updated to round 2 (branch q36-r2):
Round 2 adds tensor-core decode attention over the int8 cache, a fused prompt attention that reads the int8 cache directly, a chunked DeltaNet prompt pass, faster expert streaming and CPU-pool warm-up, and more experts kept in VRAM (78 -> 97 per layer at 262K). All of it is on by default, and each part can be switched off.
Measured
RTX 5080 16 GB, Core Ultra 9 285K, 64 GB DDR5-6400. Through the server: fresh code prompts, 384 tokens generated, temperature 0.7, thinking off, MTP 2, average of two runs, tok/s. llama.cpp b11834 tuned for this card: --cpu-moe --moe-cache-mib 10300, -b 4096 -ub 2048, MTP draft 2, 8 threads on the P-cores.
| decode | 4K | 16K | 40K | 90K | 160K | 240K |
|---|---|---|---|---|---|---|
| Strata q36-r2 (262K context) | 231 | 210 | 213 | 187 | 179 | 162 |
| Strata q36-optimized (round 1) | 173 | 154 | 151 | 124 | 105 | 86 |
| llama.cpp (131K context) | 166 | 171 | 146 |
| prompt read | 4K | 16K | 40K | 90K | 160K | 240K |
|---|---|---|---|---|---|---|
| Strata q36-r2 | 6,425 | 6,903 | 6,115 | 4,561 | 3,351 | 2,477 |
| Strata q36-optimized | 4,685 | 5,111 | 4,350 | 2,706 | 1,511 | 806 |
| llama.cpp | 3,185 | 3,830 | 3,730 |
Decode +34% at 4K up to +88% at 240K over round 1, and 1.2-1.5x llama.cpp where both run. Prompt reads are 1.6-2.0x llama.cpp, and 3.1x round 1 at 240K. An agent's next turn on a cached 198K conversation (+2,000 tokens) takes 0.96 s (round 1: 5.1 s).
Quality. Round 2 changes numerics, so it was checked against the fp32 cache as the reference: every round-2 path is at least as close as round 1 (mean KL 6.6-8.5e-3 against 1.55e-2, full-vocabulary logits, 195 teacher-forced steps at 14K / 57K / 76K; top-1 184-189 of 195 against 185). At 200K the change is no bigger than changing the prompt chunk size. Needle retrieval at ~100K and ~200K: 40/40.
Sampling. The config on the model page sets your card's recommendation (temperature 1.0, top_p 0.95, top_k 20, min_p 0, presence penalty 1.5) as the server default, because many agent clients (opencode, for one) send no temperature, which otherwise means greedy decoding.
Base Qwen3.6-35B-A3B on the same engine: ykarout/Strata-Qwen3.6-35B-A3B has the config, an expert profile and a how-to for Unsloth's MTP GGUFs (UD-Q4_K_XL recommended; the plain non-MTP repo does not load). Same card and sweep as above:
| Qwen3.6-35B-A3B UD-Q4_K_XL | 4K | 16K | 40K | 90K | 160K | 240K |
|---|---|---|---|---|---|---|
| decode | 228 | 211 | 199 | 186 | 167 | 159 |
| prompt read | 6,506 | 7,005 | 6,245 | 4,648 | 3,404 | 2,505 |
The base model accepts more MTP drafts (73-86% here, 88-95% on agent work), so in a real opencode coding session it decodes 273 tok/s under 16K context, 254 at 16-40K, 234 at 40-90K and 206 at 90-160K (peak 288).
The engine changes are proposed upstream to Strata as #3699 and #3903-#3911.
repo is up to date now with the latest optimizations