XHToken/Spark-X2.5-4B-GGUF — new model trending #30 on Hugging Face
XHToken released GGUF weights of Spark-X2.5-4B, a compact model with 1M-token context and 200+ language support, under Apache 2.0.
The Hugging Face repository provides BF16 GGUF conversions of Spark-X2.5-4B, a compact general-purpose language model for conversation, writing, translation, reasoning, coding, tool use, and agentic workflows. The model uses a hybrid attention architecture, supports a native context length up to 1M tokens, and covers more than 200 languages. Local inference is supported through Ollama and LM Studio via an XHToken llama.cpp fork, with a --think=false flag to disable thinking mode for faster responses. Released under Apache License 2.0; it was trending #30 on Hugging Face at publication.
- Hybrid attention architecture with native 1M-token context window
- Supports 200+ languages and agentic/tool-use workflows
- Runs locally via Ollama and LM Studio using a patched llama.cpp
- Apache 2.0 license; thinking mode can be disabled for direct responses
Full article327 words · extracted from huggingface.co · click to collapse
# 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).
Text extracted automatically; images, tables and formatting may be missing. Original: https://huggingface.co/XHToken/Spark-X2.5-4B-GGUF