by XHToken
Spark-x2.6 open model series. Pushing the Limits of Agentic Capabilities in On-Device Models
# Add to your Claude Code skills
git clone https://github.com/XHToken/Spark-X2.6Last scanned: 11/29/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-11-29T13:28:49.892Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}Spark-X2.6 is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by XHToken. Spark-x2.6 open model series. Pushing the Limits of Agentic Capabilities in On-Device Models. It has 946 GitHub stars.
Yes. Spark-X2.6 passed AgentsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/XHToken/Spark-X2.6" and add it to your Claude Code skills directory (see the Installation section above).
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Spark-X2.6 against similar tools.
No comments yet. Be the first to share your thoughts!
Welcome to the GitHub repository of Spark-X2.6 open model series. You can find official information about Spark-X2.6, and post your questions here(Issues).
See the Spark-X2.6 FAQ / 常见问题 for image-input support, local runtime choices, DSpark requirements and final-result validation.
Building on the Spark-X2.5, we introduce Spark-X2.6-4B&1.7B, the latest generation of our compact, general-purpose language models for on-device deployment. Spark-X2.6 retains exactly the same architecture as Spark-X2.5, achieving its capability gains through improved post-training. It delivers substantial improvements in coding, agent, long-context, multilingual, reasoning, etc. These advances enable more capable and practical on-device AI for developers and users tackling real-world tasks.
Technical Highlights:
Spark-X2.6-4B&1.7B is available on the following platforms. Choose the most suitable download source for your region and environment:
| Platform | Download | Description |
|---|---|---|
| Hugging Face | Spark-X2.6 in Huggingface | Official Hugging Face model collection for Spark-X2.6 |
| ModelScope | Spark-X2.6 in ModelScope | Recommended download source for users in China |
| Ollama | Spark-X2.6 in Ollama | Download and run the model locally with Ollama |
We evaluate our models and compare them with leading on-device models of similar size across a broad range of tasks, including agent, code, math, general and knowledge.
Spark-X2.6-4B achieves best-in-class performance among models of comparable size, while matching or exceeding the performance of larger 9B models on several benchmarks.
Spark-X2.6-1.7B surpasses models of comparable size on most benchmarks, delivering state-of-the-art results.
Spark-X2.6-4B delivers inference efficiency on par with or better than comparable on-device models, including Qwen3.5-4B and Gemma-E4B. It combines this efficiency with stronger capabilities, making it a practical choice for responsive, resource-conscious on-device AI.
Spark-X2.6-1.7B delivers leading decoding throughput at shorter context lengths among the on-device models we evaluated, including Qwen3.5-2B, MiniCPM-2B, and LFM2.5-2.6B. Moreover, our optimized llama.cpp implementation(https://github.com/XHToken/llama.cpp) amplifies this performance advantage across all tested context lengths on the RTX 4090, underscoring its strong efficiency for responsive local AI.
Install the required version with pip install transformers==4.57.1.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "XHToken/Spark-X2.6-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=131072,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=0,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
The examples below serve a local Spark-X2.6-4B checkpoint. Set MODEL_PATH to its absolute path before starting a container:
export MODEL_PATH=/absolute/path/to/Spark-X2.6-4B
Use the pre-built image that tracks the Spark-X2.6 runtime:
docker pull lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1
# A3 daily build
export SGLANG_IMAGE=quay.io/ascend/sglang:main-cann9.0.0-a3
# A2 daily build (use this instead on A2 hardware)
export SGLANG_IMAGE=quay.io/ascend/sglang:main-cann9.0.0-910b
docker pull "$SGLANG_IMAGE"
The following commands start an OpenAI-compatible API server configured for a maximum context length of 1,048,576 tokens. This setting requires sufficient device memory; reduce --context-length when necessary.
docker run --rm -it \
--gpus '"device=0"' \
--ipc=host \
-p 30000:30000 \
-v "$MODEL_PATH:/root/Spark-X2.6-4B:ro" \
lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1 \
python -m sglang.launch_server \
--model-path /root/Spark-X2.6-4B \
--served-model-name spark2.6 \
--tool-call-parser spark25 \
--reasoning-parser qwen3 \
--tp-size 1 \
--mem-fraction-static 0.8 \
--context-length 1048576 \
--chat-template /root/Spark-X2.6-4B/chat_template.jinja \
--host 0.0.0.0 \
--port 30000
docker run -it --rm -e ASCEND_USE_FIA=1 --network=host --ipc=host --shm-size=16g \
--device=/dev/davinci0 --device=/dev/davinci1 --device=/dev/davinci2 --device=/dev/davinci3 \
--device=/dev/davinci4 --device=/dev/davinci5 --device=/dev/davinci6 --device=/dev/davinci7 \
--device=/dev/davinci8 --device=/dev/davinci9 --device=/dev/davinci10 --device=/dev/davinci11 \
--device=/dev/davinci12 --device=/dev/davinci13 --device=/dev/davinci14 --device=/dev/davinci15 \
--device=/dev/davinci_manager \
--device=/dev/devmm_svm \
--device=/dev/hisi_hdc \
--volume /usr/local/sbin:/usr/local/sbin \
--volume /usr/local/Ascend/driver:/usr/local/Ascend/driver \
--volume /usr/local/Ascend/firmware:/usr/local/Ascend/firmware \
--volume /etc/ascend_install.info:/etc/ascend_install.info \
--volume /var/queue_schedule:/var/queue_schedule \
--volume ~/.cache/:/root/.cache/ \
--volume "$MODEL_PATH:/root/Spark-X2.6-4B:ro" \
--entrypoint=python \
"$SGLANG_IMAGE" \
-m sglang.launch_server \
--model-path /root/Spark-X2.6-4B \
--served-model-name spark2.6 \
--tool-call-parser spark25 \
--reasoning-parser qwen3 \
--tp-size 1 \
--mem-fraction-static 0.8 \
--context-length 1048576 \
--chat-template /root/Spark-X2.6-4B/chat_template.jinja \
--host 0.0.0.0 \
--port 30000
Thinking is enabled by default by both the chat template and the Qwen3 reasoning parser. To disable