Instructions to use NapYang/Sage-A1.5-UD-4bit-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NapYang/Sage-A1.5-UD-4bit-fp16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NapYang/Sage-A1.5-UD-4bit-fp16") 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("NapYang/Sage-A1.5-UD-4bit-fp16") model = AutoModelForMultimodalLM.from_pretrained("NapYang/Sage-A1.5-UD-4bit-fp16", 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 NapYang/Sage-A1.5-UD-4bit-fp16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NapYang/Sage-A1.5-UD-4bit-fp16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NapYang/Sage-A1.5-UD-4bit-fp16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NapYang/Sage-A1.5-UD-4bit-fp16
- SGLang
How to use NapYang/Sage-A1.5-UD-4bit-fp16 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 "NapYang/Sage-A1.5-UD-4bit-fp16" \ --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": "NapYang/Sage-A1.5-UD-4bit-fp16", "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 "NapYang/Sage-A1.5-UD-4bit-fp16" \ --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": "NapYang/Sage-A1.5-UD-4bit-fp16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NapYang/Sage-A1.5-UD-4bit-fp16 with Docker Model Runner:
docker model run hf.co/NapYang/Sage-A1.5-UD-4bit-fp16
Sage-A1.5-UD-4bit-fp16
🏠 Sage-A1.5 Homepage | 📄 Technical Report | 🏔 Base Model
This is a 4-bit quantized variant of the original InternScience/Sage-A1.5 (Apache 2.0), produced by per-layer affine INT4/INT8 quantization. The base model is a 35B mixture-of-experts agentic VLM built on Qwen3.6-35B-A3B + Agents-A1 from Shanghai AI Laboratory. This model preserves the original architecture, tokenizer and chat template — only weights are quantized, so it loads at roughly 20.6 GB instead of ~67 GB.
Model Description
Sage-A1.5-UD-4bit-fp16 inherits the full capability stack of Sage-A1.5 — agentic orchestration, verification mode, tool use, and open scientific discovery reasoning — while consuming a fraction of the memory. It is designed for long-horizon task execution with sub-agent delegation, evidence validation, and exploratory research across domains.
Base model
- InternScience/Sage-A1.5 — 35B MoE agentic model based on Qwen3.6-35B-A3B and Agents-A1, licensed under Apache 2.0.
Quantization details
- Scheme: per-layer affine INT4 (
mode: affine,group_size: 64) - Mixed precision: some blocks are kept at INT8 to preserve accuracy where it matters most:
- INT4:
switch_mlp(gating), plus MTP layers' gate/down/up — the largest memory savings come from the MoE switch FFN. - INT8:
lm_head,embed_tokens, alllinear_attnprojections, and allshared_expertMLP weights.
- INT4:
- Output size: ~20.6 GB (5 shards, 4 GiB each +
model-mtp.safetensors), vs ~67 GB full precision. - Activation dtype: the model itself runs in FP16/BF16 at runtime; only weights are quantized.
Architecture
| Parameter | Value |
|---|---|
| Architecture | Qwen3_5MoeForConditionalGeneration |
| Layer type | MoE Transformer with switch FFN + linear attention hybrid |
| Hidden size | 2048 |
| Number of layers | 40 (linear attention / full attention: 3/1 per block) |
| Attention heads | 16 (GQA, 2 KV heads) |
| Head dim | 256 (16 linear key heads @ 128 + 32 linear value heads @ 128) |
| Vocabulary size | 248,320 |
| Max sequence length | 262,144 (256K) |
| RoPE theta | 10,000,000 (partial rotary factor 0.25) |
| RoPE layout | mRoPE interleaved, sections [11, 11, 10] |
| MoE experts | 256 total, 8 active per token |
| Expert FFN hidden size | 512 (switch MLP) / 512 (shared expert) |
| Vision encoder hidden size | 1152 → 2048 (out) |
| Norm | RMSNorm, eps 1e-6 |
| Init std | 0.02 |
Capabilities
- Agentic Orchestration — delegates tasks to sub-agents with isolated contexts, decomposes complex problems and synthesizes results.
- Verification Mode — opt-in self-review mid-trajectory (requires
chat_template_kwargs: {"verification": true}and a non-empty system message). - Tool Use — native function calling / tool integration, API and code interpreter compatible.
- Vision & Video — image and video understanding via the Qwen3.5-style vision tower (image token 248056, video token 248057).
- Long context — supports up to 256K tokens with mRoPE (text/image/video).
- Scientific & professional reasoning — designed for long-horizon scientific discovery, code engineering, and research tasks.
Performance
Base model (unquantized)
The base model Sage-A1.5 (unquantized) achieves:
- 🥇 Overall SOTA on XBench-DS-2510 (92.0), IFBench (81.6), PinchBench (90.0), FrontierScience-Olympiad (81.0), FrontierScience-Research (48.3), CMT (80.0), OmniDocBench (91.5)
- 🟢 Best among comparable ~35B models on BrowseComp (81.7), SWE-bench Pro (61.2), MLE-Lite (65.2), SciCode (44.3), AA-LCR (81.0), HLE w/ tools (55.1), VitaBench (45.4), ChemCOTBench (66.5)
- 95.1 on GAIA — higher than every larger-scale model compared against
See the Sage-A1.5 README for the full evaluation table (GAIA, BrowseComp, DeepResearch-Bench2, SWE-bench Pro/Multilingual, HiPhO, CritPt, ALE-CLI, MatTools).
Quantization benchmark (this checkpoint)
Evaluated on oMLX v0.7.2 — macOS 27.0.1, M2 Max (30c), 32 GB, Affine4 KV cache 4-bit + Lightning MTP.
| Benchmark | Score | Details |
|---|---|---|
| MBPP | 81.0% | 81/100 correct · sampled 100 of 500 (seed 42, stratified) |
Sampling: deterministic · presence_penalty 1.5 · thinking enabled · batch size 1 · run time 2.7h.
This is the quantized checkpoint evaluated with KV cache quantization turned on. Actual performance may vary depending on your inference stack. View raw results
Usage
Load with Transformers (4.57+) in safetensors format:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"NapYang/Sage-A1.5-UD-4bit-fp16", # your repo name
device_map="auto",
torch_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained("NapYang/Sage-A1.5-UD-4bit-fp16")
Recommended sampling parameters (from base model card):
temperature: 1.0top_p: 0.95top_k: 20min_p: 0.0presence_penalty: 1.5repetition_penalty: 1.0
Verification Mode (self-review)
Pass a non-empty system message plus chat_template_kwargs: {"verification": true}; the model pauses mid-trajectory and reviews its own chain of thought. Read reasoning_content in addition to content.
message = model.chat(
tokenizer,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Find the population of Beijing and cross-check it."},
],
tools=TOOLS,
chat_template_kwargs={"verification": True},
)
print(message.reasoning_content) # self-review happens inside the chain of thought
print(message.content)
Limitations
- Quantized weights trade a small amount of accuracy (usually <1% on standard benchmarks) for ~3× lower memory footprint; report your use case-specific validation.
- The model is multimodal — image/video input requires the full processor (
PreTrainedProcessor) from the base repo, not just the tokenizer. - Tool use and verification mode rely on the base model's chat template (
chat_template.jinja); make sure to load it alongside this checkpoint. - This checkpoint is provided as-is; the base model license (Apache 2.0) applies to all derivatives.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{lou2026sagea15longhorizonexecutionscientific,
title={Sage-A1.5: From Long-Horizon Execution to Scientific Exploration with Capability Composition},
author={Sage-A1.5 Team},
year={2026},
eprint={2610.28578},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2610.28578},
}
Acknowledgements
This model is a derivative of InternScience/Sage-A1.5 (Shanghai AI Laboratory, Apache 2.0). Base model built on Qwen3.6 (Alibaba Cloud, Apache 2.0) and Agents-A1.
- Downloads last month
- 35