Spark-X2.5

[![Slack](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/tokenspark/shared_invite/zt-432qf8l2f-5~dLyXv8uETr0P0UuC07nw) [![Discord](https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white)](https://discord.gg/kTDE2Hg8aw) [![YouTube](https://img.shields.io/badge/YouTube-Subscribe-FF0000?logo=youtube&logoColor=white)](https://www.youtube.com/@SparkLLM) [![dev.to](https://img.shields.io/badge/dev.to-Follow-0A0A0A?logo=devdotto&logoColor=white)](https://dev.to/sparkllm) [![Bluesky](https://img.shields.io/badge/Bluesky-Follow-0285FF?logo=bluesky&logoColor=white)](https://bsky.app/profile/sparkllm.bsky.social) [![X](https://img.shields.io/badge/X-Follow-000000?logo=x&logoColor=white)](https://x.com/sparkllm) [![Zhihu](https://img.shields.io/badge/Zhihu-Follow-0084FF?logo=zhihu&logoColor=white)](https://www.zhihu.com/people/zhiikz7qh7m) [![WeChat](https://img.shields.io/badge/WeChat-Join-07C160?logo=wechat&logoColor=white)](https://github.com/XHToken/community/blob/main/docs/images/xhtoken-wechat.jpg)

English | 中文

Welcome to the GitHub repository of Spark-X2.5 open model series. You can find official information about Spark-X2.5, and post your questions [here(Issues)](https://github.com/XHToken/Spark-X2.5/issues). ## Introduction Today, we are introducing Spark-X2.5-4B and Spark-X2.5-1.7B, two compact, general-purpose language models designed to make capable AI more practical, efficient, and accessible. The models deliver strong performance across a broad range of everyday tasks—including conversation, writing, translation, reasoning, coding, tool use, and agentic workflows—achieving leading results among open-source models of comparable size. Spark-X2.5 combines an efficiency-oriented architecture with native context windows of up to 1M tokens, and support for more than 200 languages. **Technical Highlights**: - **Efficient Architecture and Native 1M-token Context**: The models use a hybrid attention architecture that combines one full-attention layer with three sliding-window attention layers. This design substantially reduces the computational overhead typically associated with long-context models while natively supporting a context window of up to 1M tokens. - **Strong Coding and Agent Capabilities**: The models are deeply integrated with popular agent harnesses, including Codex, Claude Code, OpenClaw, and Hermes. They deliver state-of-the-art performance among models of comparable size across everyday coding, agentic workflows, reasoning, and instruction-following tasks. - **Broad Hardware and Software Compatibility**: The models support a wide range of hardware platforms, including NVIDIA, Huawei, Hygon, HOUMO.AI, etc. It is compatible with leading inference frameworks such as vLLM, SGLang, llama.cpp, MLX, and can be deployed quickly through platforms including Ollama and LM Studio. The models can also be customized using popular fine-tuning frameworks such as LLaMA-Factory. Across multiple hardware platforms, they deliver superior TTFT, TOPT, and overall inference efficiency compared with similarly sized models. - **Advanced Training Algorithms**: The models were trained on Huawei Ascend clusters. Large-scale reinforcement learning and post-training techniques such as MOPD significantly enhance its reasoning, coding, agentic, and instruction-following capabilities.

## Model Downloads The Spark-X2.5-4B and Spark-X2.5-1.7B are available on the following platforms. Choose the most suitable download source for your region and environment: | Platform | Download | Description | | --- | --- | --- | | Hugging Face | [Spark-X2.5 in Huggingface](https://huggingface.co/collections/XHToken/spark-x25) | Official Hugging Face model collection for Spark-X2.5 | | ModelScope | [Spark-X2.5 in ModelScope](https://www.modelscope.cn/collections/XHToken/Spark-X25) | Recommended download source for users in China | | Modelers | [Spark-X2.5 in Modelers](https://modelers.cn/user/XHToken) | Recommended download source for users with Ascend chips | | Ollama | [Spark-X2.5 in Ollama](https://ollama.com/SparkLLM) | Download and run the model locally with Ollama | | SCNet | [Spark-X2.5 in SCNet](https://www.scnet.cn/ui/aihub/models/XHToken/Spark-X2.5-4B) | Recommended download source for users with Hygon chips | | AtomGit | [Spark-X2.5 in AtomGit](https://ai.atomgit.com/collections/2095030878254981121) | Recommended download source for users in China | > If Hugging Face is slow or unavailable in your region, try ModelScope, Modelers, SCNet or AtomGit instead. ## Benchmarks
Benchmark Spark‑X2.5‑4B Spark‑X2.5‑1.7B Qwen3.5‑9B Qwen3.5‑4B Qwen3.5‑2B Gemma4‑12B Gemma4‑E4B Gemma4‑E2B
Agent
BFCL‑V465.146.966.1*50.3*43.6*37.436.930.2
τ²‑bench75.165.379.1*79.9*48.8*69.0*42.2*24.5*
τ³‑bench30.420.19.36.74.113.310.18.8
MCP‑Atlas54.623.447.4*40.8*14.830.5*15.0*12.6
MCP‑Mark14.22.313.412.5
Workspace Bench31.218.925.521.37.7
VitaBench2.025.28.315.618.25.212.44.84.4
BrowseComp40.929.78.314.33.110.08.33.7
Code
SWE‑Bench Pro44.410.433.8*29.4*1.921.9*4.0*
SWE‑Bench Verified41.628.353.1*38.8*6.844.2*14.0*
SWE‑Bench Multilingual53.323.343.327.75.032.5*
SciCode34.718.232.7*24.06.039.827.520.5
Math
Gaokao 2026133.4114.8135.5130.394.0130.6102.481.8
AIME 202690.769.488.283.030.882.1*42.5*37.5*
HMMT Feb 202681.248.470.869.721.565.634.220.5
IMO‑AnswerBench74.245.469.868.557.226.922.6
General & Knowledge
IFEval93.089.591.5*89.8*78.6*94.845.334.8
IFBench75.066.364.559.241.3*73.5*44.0*22.7
AA‑LCR56.324.363.0*57.0*25.6*55.3*34.718.3
HLE12.36.314.38.62.113.13.92.5
GPQA67.443.877.267.244.672.854.543.8
> - \* denotes reported results from publicly‑released model cards / papers and - denotes scores not yet available. > - All evaluations are conducted in thinking mode. The recommended sampling parameters for Spark-X2.5 are temperature=1.0, top_p=0.95, and top_k=-1. > - Gaokao 2026 consists of the five 2026 Chinese GAOKAO examinations (National I,National II, Beijing, Shanghai, Tianjin), each graded out of 150 points. ## Quickstart ### SGLang #### Install SGLang Use the pre-built image that tracks the Spark-X2.5 runtime: ```bash docker pull lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1 ``` #### Run Inference The following command can be used to start an OpenAI-compatible API server on a single GPU with maximum context length 1,048,576 tokens. #### Server ```bash docker run -it \ --gpus '"device=0"' \ --ipc=host \ -p 30000:30000 \ -v "$MODEL_PATH":/root/Spark-X2.5-4B \ lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1 \ python -m sglang.launch_server \ --model-path /root/Spark-X2.5-4B \ --served-model-name spark2.5 \ --tool-call-parser spark25 \ --reasoning-parser qwen3 \ --tp-size 1 \ --mem-fraction-static 0.8 \ --context-length 1048576 \ --chat-template /root/Spark-X2.5-4B/chat_template.jinja \ --host 0.0.0.0 \ --port 30000 ``` #### Client Thinking is enabled by default by both the chat template and the qwen3 reasoning parser. To disable thinking for a specific request, set "chat_template_kwargs": {"enable_thinking": false}. ```bash curl -s http://localhost:30000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "spark2.5", "messages": [ { "role": "user", "content": "安徽的省会在哪里?" } ], "max_tokens": 131072, "temperature": 1, "top_k": -1, "top_p": 0.95, "repetition_penalty": 1, "presence_penalty": 0, "frequency_penalty": 0 }' ``` ### vLLM #### Install vLLM ```bash pip install uv uv venv ~/spark2_5 source ~/spark2_5/bin/activate git clone https://github.com/XHToken/Spark-plugin.git cd ./Spark-plugin uv pip install . ``` #### Server ```bash vllm serve "./Spark-X2.5-4B" \ --port "30000" \ --trust-remote-code \ --served-model-name spark25 \ --tensor-parallel-size 1 \ --gpu-memory-utilization 0.7 \ --enable-prefix-caching \ --chat-template Spark-X2.5-4B/chat_template.jinja ``` #### Client ```bash curl -s http://127.0.0.1:30000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "spark25", "messages": [{"role": "user", "content": "安徽的省会在哪里?"}], "temperature": 1.0, "top_k": -1, "top_p": 0.95 }' ``` ### MLX Spark-MLX-LLM runs the original Spark-X2.5 Hugging Face checkpoints locally. It supports Apple silicon GPU, Linux CPU, and NVIDIA CUDA on Linux. No GGUF conversion is required. #### Installation ```bash git clone https://github.com/XHToken/Spark-MLX-LLM.git cd Spark-MLX-LLM python3 -m venv .venv source .venv/bin/activate # Apple silicon python -m pip install -e . # Linux cpu python -m pip install -e '.[cpu]' # Linux with cuda12 python -m pip install -e '.[cuda12]' # Linux with cuda13 python -m pip install -e '.[cuda13]' ``` Run Spark-X2.5 ```bash spark-mlx-generate \ --device gpu \ --dtype bfloat16 \ --model XHToken/Spark-X2.5-1.7B \ --prompt "安徽的省会在哪里?" \ --max-tokens 512 \ --temp 0 ``` ### Ollama #### Build ```bash git clone https://github.com/XHToken/llama.cpp.git llama.cpp-spark git clone https://github.com/ollama/ollama.git ollama-spark cd ollama-spark export OLLAMA_LLAMA_CPP_SOURCE="$(cd ../llama.cpp-spark && pwd)" cmake -S . -B build cmake --build build --parallel 8 ``` #### Create and Run ```bash printf 'FROM /absolute/path/to/your.gguf\n' > ./Modelfile.spark ./ollama serve ./ollama create Spark-X2.5-1.7B -f ./Modelfile.spark ./ollama run Spark-X2.5-1.7B ``` ### LM Studio #### Build ```bash git clone https://github.com/XHToken/llama.cpp.git llama.cpp-spark cd llama.cpp-spark cmake -S . -B build cmake --build build --parallel 8 ``` #### Set Up LM Studio 1. Close LM Studio. 2. Back up the selected runtime directory: ```text /extensions/backends// ``` 3. Copy the `llama.cpp-spark` build output into the selected runtime directory, overwriting the existing files. 4. Place the GGUF model in the following directory: ```text /models/// ``` Example runtime directory on macOS: ```text ./build/bin/* -> ~/.lmstudio/extensions/backends/llama.cpp-mac-arm64-apple-metal-advsimd-/ ``` #### Run with LM Studio Open My Models, select the Spark-X2.5 model, click Load, then start a new Chat. #### Run with lms cli ```bash # Replace `` with a model listed by `lms ls` lms load lms chat ``` ### Finetuning We advise you to use [Llama-Factory](https://github.com/XHToken/LlamaFactory) to finetune your models. ## License The Spark-X2.5 model series is licensed under the [Apache 2.0 License](LICENSE). ## Citation If you find our work helpful, feel free to give us a cite. ```bibtex @misc{sparkx2.5, title = {Spark-X2.5 4B&1.7B: Pushing the Limits of Agentic Capabilities in On-Device Models}, author = {SparkLLM Team}, year = {2026} } ```