Spark-X2.5-4B is a compact, open-weight general-purpose language model from XHToken (the SparkLLM / TokenSpark teams), published on Hugging Face under the Apache 2.0 license on August 31, 2026. It is the 4B flagship of a pair that also includes a 1.7B sibling. The pitch is efficiency: a hybrid attention design that mixes full attention with sliding-window attention to deliver a native 1M-token context window without the compute cost usually associated with long-context models. For practitioners who want an agent-friendly model they can actually run locally, it is worth a close look.
Compare Qwen3.8-27B for a larger dense open-weight option, GLM-5.3-Flash for a Chinese open-weight fast model, or OpenCode for an open-source agent harness to pair with it.
Model Specifications
| Specification | Spark-X2.5-4B |
|---|---|
| Total parameters | ~4B |
| Models in family | Spark-X2.5-4B, Spark-X2.5-1.7B |
| Architecture | Hybrid attention (1 full-attention + 3 sliding-window per block) |
| Context window | Up to 1M tokens (native) |
| Languages | English, Chinese + 200+ languages |
| License | Apache 2.0 |
| Base model | XHToken/Spark-X2.5-4B-Base |
Key Features
- Native 1M-token context: efficient because of the hybrid attention mix, which keeps the KV cache small while still letting the model follow long, tool-heavy conversations.
- Agent-native: the model is integrated with popular agent harnesses including Codex, Claude Code, OpenClaw, and Hermes, and reports strong results among comparable-size models on coding, agentic, and reasoning tasks.
- Broad deployment surface: runs on NVIDIA, Huawei, Hygon, and HOUMO.AI hardware; works with vLLM, SGLang, llama.cpp, and MLX, and is easy to spin up through Ollama and LM Studio.
- Open and fine-tunable: Apache 2.0 plus LLaMA-Factory support means you can self-host, customize, and ship commercially.
- Efficiency-first training: trained on Huawei Ascend clusters with large-scale RL and MOPD post-training to sharpen reasoning, coding, and instruction following.
Use Cases
Who Should Use This Tool?
- Local-first developers: a 4B model you can run on a consumer GPU or an Apple Silicon Mac through MLX.
- Agent builders: a small, fast model that still follows tool-calling and long contexts.
- Multilingual teams: broad language coverage without deploying a large open model.
Problems It Solves
- Long-context cost: the hybrid attention design reduces the memory and latency overhead that usually forces teams to context-trim.
- Self-hosting constraints: a compact size plus broad framework support makes it practical on modest hardware.
- Commercial deployment: Apache 2.0 removes licensing friction for shipping a custom build.
Pricing
Spark-X2.5-4B is free and open source under Apache 2.0. You pay only for the hardware or cloud inference you run. There is no official hosted API pricing published by XHToken at the time of writing.
Getting Started
- Download weights: pull
XHToken/Spark-X2.5-4B(or the smaller 1.7B) from Hugging Face. - Run it locally: load with llama.cpp, MLX, or vLLM, or one-click-launch via Ollama or LM Studio.
- Connect an agent harness: point Codex, Claude Code, OpenClaw, or Hermes at your local endpoint.
- Fine-tune if needed: use LLaMA-Factory to adapt it to your domain.
Frequently Asked Questions
Is it a reasoning model?
It emphasizes reasoning, coding, and instruction-following capabilities, and it is tuned with reinforcement learning, though Anthropic-style always-on thinking is not claimed.
Can I use it commercially?
Yes. Apache 2.0 grants that right.
How does it handle the 1M context?
It does not pay the full-attention cost across all 1M tokens; it alternates full attention with sliding-window layers, which keeps compute and memory manageable.
Alternatives
- Qwen3.8-27B: a denser 27B Apache 2.0 model with more capacity.
- GLM-5.3-Flash: a Zhipu free/fast model.
- OpenCode: an open-source agent runtime to pair with the local model.
Tips & Best Practices
- Match size to hardware: start with the 1.7B if you are on a small GPU; step up to the 4B when you need more capability.
- Use the hybrid context wisely: long sessions and multi-turn tool use are where the attention mix pays off.
- Check the license before shipping: confirm your fine-tune and hosting plan sit comfortably inside Apache 2.0.
Conclusion
Spark-X2.5-4B is a well-engineered, compact open-weight model that solves the long-context cost problem with a hybrid attention design, delivers strong coding and agent performance, and stays freely usable under Apache 2.0. It is a strong candidate for anyone who wants a local, agent-ready model that is cheap to run and legal to ship.
Comments
No comments yet. Be the first to comment!
Related Tools
NVIDIA Nemotron 3.5 Lightning 30B A3B
build.nvidia.com/nvidia/nemotron-3.5-lightning-30b-a3b
NVIDIA's efficient open-weight 30B MoE hybrid model with 3B active parameters, 1M-token context, and single-GPU deployment for local reasoning and coding.
LongCat 2.0
longcat.chat
Meituan's open-weight MoE model: 1.6T total / ~48B active params, 1M context, MIT. Strong on coding and agentic tasks (2026-08-25).
DeepSeek V4 Pro 0813
www.deepseek.com
DeepSeek flagship 1.6T MoE with 49B active, 1M context, MIT weights. API $0.29/$1.20 cached $0.03.
Related Insights

Grok Bot and Hermes Bot: one person finally gets a think tank and a secretariat
Grok Bot now ships with Cursor Pro+. Hermes Bot runs on a VPS. They are not smarter chat boxes. The think tank advises, the secretariat executes, and you still make the call.
Hook OpenCode Go into Codex on Windows. Do Not Open a Second Toolkit.
A ChatGPT-signed Codex desktop app still shows mostly GPT in the picker. On Windows, enable only OpenCode Go and the Grok, GLM, Kimi, DeepSeek, and MiniMax models you already pay for appear in the same selector. Keys stay local. Native GPT stays put.
What Locks Codex Is the Picker, Not the Models
You already pay for OpenCode Go, Grok, and Z.ai, but the Codex picker still shows mostly GPT. The community project codex-router does not teach another install ritual. It puts subscriptions you already bought back into the selector, keeps keys on the machine, and leaves native GPT alone.