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 # Run inference directly in the terminal: llama cli -hf XHToken/Spark-X2.5-4B-GGUF
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 # Run inference directly in the terminal: llama cli -hf XHToken/Spark-X2.5-4B-GGUF
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 # Run inference directly in the terminal: ./llama-cli -hf XHToken/Spark-X2.5-4B-GGUF
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 # Run inference directly in the terminal: ./build/bin/llama-cli -hf XHToken/Spark-X2.5-4B-GGUF
Use Docker
docker model run hf.co/XHToken/Spark-X2.5-4B-GGUF
- 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
- Ollama
How to use XHToken/Spark-X2.5-4B-GGUF with Ollama:
ollama run hf.co/XHToken/Spark-X2.5-4B-GGUF
- 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
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" } ] } } }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
- 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
Run and chat with the model
lemonade run user.Spark-X2.5-4B-GGUF-{{QUANT_TAG}}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
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
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
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" \ --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"
File size: 2,878 Bytes
80e7e59 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | ---
license: apache-2.0
language:
- en
- zh
library_name: gguf
pipeline_tag: text-generation
base_model: XHToken/Spark-X2.5-4B
tags:
- gguf
- llama.cpp
- ollama
- lm-studio
- sparkx2_5
---
# Spark-X2.5-4B-GGUF
> [!NOTE]
> This repository provides a BF16 GGUF conversion of Spark-X2.5-4B.
Spark-X2.5 is a compact, general-purpose language model for conversation, writing, translation, reasoning, coding, tool use, and agentic workflows. It uses a hybrid attention architecture, supports a native context length of up to 1M tokens, and covers more than 200 languages. For its architecture, training methods, benchmark results, fine-tuning, and citation, see the [Spark-X2.5-4B](https://huggingface.co/XHToken/Spark-X2.5-4B).
## Local Deployment
The GGUF file can be used for local inference with **Ollama** and **LM Studio**. Spark-X2.5 support is provided by [XHToken/llama.cpp](https://github.com/XHToken/llama.cpp), so the Quick Starts below use this compatible implementation.
## Ollama Quick Start
### 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
```
### Import the GGUF
Replace the model path below with the absolute path to the downloaded GGUF file:
```bash
printf 'FROM /absolute/path/to/Spark-X2.5-4B.gguf\n' > ./Modelfile.spark
```
### Create and Run
Start the Ollama server in the first terminal:
```bash
./ollama serve
```
Open a second terminal in the same `ollama-spark` directory:
```bash
./ollama create Spark-X2.5-4B -f ./Modelfile.spark
./ollama run Spark-X2.5-4B --think=false
```
`--think=false` disables thinking mode for faster, direct responses.
## LM Studio Quick Start
### Build the Compatible llama.cpp Runtime
```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
```
### Configure LM Studio
1. Close LM Studio.
2. Back up the selected LM Studio runtime directory:
```text
<LM_STUDIO_HOME>/extensions/backends/<selected-runtime>/
```
3. Copy the `llama.cpp-spark` build output into the selected runtime directory, replacing the existing runtime files.
4. Place `Spark-X2.5-4B.gguf` in:
```text
<LM_STUDIO_HOME>/models/<org>/<name>/
```
Example runtime directory on Apple Silicon:
```text
./build/bin/* -> ~/.lmstudio/extensions/backends/llama.cpp-mac-arm64-apple-metal-advsimd-<version>/
```
### Run
Open LM Studio, select the model under My Models, click Load, and start a new chat.
You can also use the `lms` CLI:
```bash
lms ls
lms load <model>
lms chat <model>
```
## License
Released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|