Instructions to use XHToken/Spark-X2.5-4B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use XHToken/Spark-X2.5-4B-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use XHToken/Spark-X2.5-4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XHToken/Spark-X2.5-4B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XHToken/Spark-X2.5-4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
- Ollama
How to use XHToken/Spark-X2.5-4B-GGUF with Ollama:
ollama run hf.co/XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use XHToken/Spark-X2.5-4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "XHToken/Spark-X2.5-4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use XHToken/Spark-X2.5-4B-GGUF with Docker Model Runner:
docker model run hf.co/XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
- Lemonade
How to use XHToken/Spark-X2.5-4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Spark-X2.5-4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use XHToken/Spark-X2.5-4B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use XHToken/Spark-X2.5-4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XHToken/Spark-X2.5-4B-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "XHToken/Spark-X2.5-4B-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Local AI on Phones: Spark-X2.5 on OnePlus 8 Pro and Galaxy S26

Running AI locally on a phone provides privacy, offline access, predictable availability and freedom from cloud inference fees. Modern phones already contain powerful CPUs, GPUs and enough memory to become useful personal AI computers. The model and conversations remain on the device, while a local web server makes the AI accessible through an ordinary browser.
Spark-X2.5 is particularly interesting because its compact 4B size delivers capabilities normally associated with larger models: reasoning, coding, writing, translation, tool use and agentic workflows. It supports more than 200 languages and has a native context window of up to one million tokens, although usable phone context remains limited by memory, speed and battery consumption.
Its published scores are unusually strong for a model of this size. Spark-X2.5-4B scored 90.7 on AIME 2026 for mathematical reasoning and 65.1 on BFCL-V4 for tool calling. It also scored 54.6 on MCP-Atlas and 14.2 on MCP-Mark. MCP performance is important because it measures the model’s ability to work with external tools and data rather than functioning only as a chatbot.
We ran the approximately 2.6 GB Q4_K_M version entirely inside Termux, a Linux-style command-line environment for Android. The developer’s XHToken llama.cpp fork was cloned and compiled directly on both phones. This special fork was necessary because standard llama.cpp did not yet recognize the model’s spark2_5 architecture. Vulkan support was compiled into llama.cpp to use the phones’ Adreno GPUs.
On the OnePlus 8 Pro, CPU inference worked at approximately 12 prompt tokens/s and 4.6 generation tokens/s. Both the command-line interface and local web server worked, and the model successfully solved a second-order differential equation. Vulkan repeatedly crashed, even with only one layer offloaded. The likely limitation was the phone’s Adreno 650 and its old April 2022 Qualcomm Vulkan driver.
On the Galaxy S26, the same model ran successfully on both CPU and the Adreno 840 GPU. CPU performance reached approximately 37 prompt and 14 generation tokens/s. Full Vulkan offloading reached about 36 prompt and 20 generation tokens/s in the short test. Running through the web server with a 16K context produced approximately 33 prompt and 15 generation tokens/s.
The S26 CPU was roughly three times faster than the OnePlus CPU, while Vulkan produced more than four times the OnePlus generation speed. The relatively small difference between partial and full GPU offloading suggests that Spark-X2.5’s hybrid attention architecture is not yet fully optimized for Vulkan.
The experiment demonstrates that a capable reasoning and tool-oriented AI model can run completely locally on Android. The older OnePlus 8 Pro can operate it slowly through CPU inference, while the Galaxy S26 delivers practical interactive performance through Vulkan—without cloud inference, an internet connection or Qualcomm NPU execution.
https://huggingface.co/XHToken/Spark-X2.5-4B — Official Spark-X2.5 model page with architecture, capabilities, benchmark scores and deployment information.
https://huggingface.co/XHToken/Spark-X2.5-4B-GGUF — Quantized GGUF versions, including the approximately 2.6 GB Q4_K_M model used on both phones.
https://github.com/XHToken/llama.cpp — Developer’s compatible llama.cpp fork required to run the spark2_5 architecture.
https://artificialanalysis.ai/hardware-inference-stack/mobile-phones — Artificial Analysis benchmark comparing the intelligence, speed and memory requirements of small models running on phones.
now latest llama cpp loads model without custom fork!!
Good performance, though some may prefer an aggressive quant of a MoE model


