Downloads · 30 days
598
7% of all-time downloads
miifanboy/Spark-X2.5-4B-i1-GGUF
Spark-X2.5-4B-i1-GGUF is a text generation model from miifanboy. Use it when you need the model to write or continue text. It is set up for gguf. The card lists the license as apache-2.0.
Most of this README.md and the plots are generated by the Spark-X2.5-4B-IQ4XS quant.
Downloads · 30 days
598
7% of all-time downloads
All-time downloads
8.6K
Public
Repo size
31.4 GB
Likes
3
Public
Click a slice to open those files.
.gguf31.4 GB · 100%
From the Hugging Face model README
Most of this README.md and the plots are generated by the Spark-X2.5-4B-IQ4_XS quant.
This repository provides the imatrix quantized variants of Spark-X2.5-4B, a compact, general-purpose language model designed for conversation, writing, translation, reasoning, coding, tool use, and agentic workflows. The model uses a hybrid attention architecture, supports a native context length of up to 1M tokens, and covers more than 200 languages. The quantized variants in this repository were created following the imatrix methodology, preserving high quality while offering flexible deployment across a range of precision levels.
<img src="plots/Same_Top-1.png" width="100%" /> <img src="plots/Median_KLD.png" width="100%" />
The table below lists each quantized variant, its file size, and its recommendation status.
| Quant | File Size (GB) | Recommendation |
|---|---|---|
| IQ3_XXS | 1.68 | Not Recommended, need detailed system prompts. |
| Q3_K_S | 1.77 | Not Recommended, need detailed system prompts. |
| IQ3_M | 1.90 | Not Recommended, need detailed system prompts. |
| Q3_K_M | 2.02 | Not Recommended, need detailed system prompts. |
| IQ4_XS | 2.21 | Recommended, if VRAM constrained. |
| Q4_K_S | 2.26 | Recommended for CPU, otherwise use IQ4_XS. |
| IQ4_NL | 2.31 | Not Recommended, use Q4_K_M instead. |
| Q4_K_M | 2.42 | Highly Recommended but use Q5_K_S if you have memory. |
| Q5_K_S | 2.68 | Highly Recommended |
| Q5_K_M | 2.77 | Highly Recommended |
| Q6_K | 3.15 | Highly Recommended |
| Q8_0 | 4.07 | Overkill |
Note: Recommendations are written by Mii Fanboy.
| Use Case | 4 GB | 8 GB | 12+ GB |
|---|---|---|---|
| Classification (16k-32k) | Q5_K_S | Q6_K | Q6_K |
| Summarization (16k-32k) | Q5_K_S | Q6_K | Q6_K |
| Agentic Coding (64k-128k) | Q3_K_M | Q6_K | Q8_0 |
| Agentic Coding (128k-200k) | N/A | Q5_K_S | Q8_0 |
| Agentic Coding (Max ctx) | Q3_K_M (72k) | IQ4_XS (235k) | IQ4_XS (332k) |
Note: If you are using CPU, stick with Q quants. IQ quants would be much slower on CPU.
The table below reproduces the KLD benchmark results for all quantized variants. It aggregates the evaluation measurements across KLD, perplexity, and accuracy metrics for every variant.
| Quantization | Mean PPL(Q) | Mean KLD | Median KLD | 95.0% KLD | 99.0% KLD | 99.9% KLD | Max KLD | Same Top-1 % | StdErr KLD | Mean PPL(base) |
|---|---|---|---|---|---|---|---|---|---|---|
| IQ3_XXS | 9.58501 | 0.379812 | 0.174314 | 1.406048 | 3.012523 | 7.911747 | 20.635216 | 76.115 | 0.00294 | 8.627627 |
| Q3_K_S | 11.330044 | 0.451257 | 0.195298 | 1.751433 | 3.686294 | 8.062553 | 18.686701 | 74.55 | 0.00335 | 8.627627 |
| IQ3_M | 9.260718 | 0.242364 | 0.101996 | 0.889632 | 2.164045 | 5.672116 | 17.106005 | 81.011 | 0.002141 | 8.627627 |
| Q3_K_M | 9.382812 | 0.213687 | 0.080069 | 0.829739 | 1.998638 | 5.218887 | 20.486629 | 82.227 | 0.002007 | 8.627627 |
| IQ4_XS | 8.844403 | 0.116513 | 0.038128 | 0.449686 | 1.162122 | 4.328389 | 21.463402 | 86.877 | 0.00149 | 8.627627 |
| Q4_K_S | 8.824878 | 0.108577 | 0.036529 | 0.394479 | 1.01788 | 4.604871 | 19.595642 | 87.503 | 0.0015 | 8.627627 |
| IQ4_NL | 8.922096 | 0.10908 | 0.036719 | 0.413782 | 1.040638 | 3.82002 | 19.504448 | 87.114 | 0.001371 | 8.627627 |
| Q4_K_M | 8.723486 | 0.095576 | 0.0316 | 0.348488 | 0.900792 | 4.245613 | 18.727919 | 88.16 | 0.001343 | 8.627627 |
| Q5_K_S | 8.736202 | 0.039046 | 0.011189 | 0.135688 | 0.38277 | 2.074362 | 19.152548 | 92.482 | 0.000852 | 8.627627 |
| Q5_K_M | 8.730676 | 0.03115 | 0.009267 | 0.105685 | 0.297142 | 1.613208 | 21.262571 | 93.141 | 0.00077 | 8.627627 |
| Q6_K | 8.624443 | 0.012814 | 0.00292 | 0.03926 | 0.130832 | 0.934402 | 13.417367 | 95.867 | 0.000481 | 8.627627 |
| Q8_0 | 8.620091 | 0.00304 | 0.000567 | 0.00757 | 0.027135 | 0.246543 | 4.118722 | 98.075 | 0.000179 | 8.627627 |
The imatrix quants were created by converting the base Spark-X2.5-4B model into a range of quantized variants, including the IQ3, Q3, IQ4, Q4, Q5, Q6, and Q8 series. Each quantized model is evaluated to verify its accuracy, quality, and overall performance before being included in this collection.
We used the bartowski-imatrix-v5-semantic calibration dataset as the input data. The dataset was split into two parts: a 70% imatrix calibration portion and a 30% KLD evaluation portion, using a fixed seed to ensure reproducibility. The 70% portion is used for imatrix quantization calibration, while the 30% portion is reserved for KL divergence evaluation.
For KLD measurements, we first generated the baseline logits from the original base Spark-X2.5-4B model and saved them as the reference. Then, for each quantized model, we computed the KL divergence between the model's outputs and the baseline logits using the perplexity tool. The KLD measurements were performed with a context length (ctx) of 4096, a batch of 2048, and an ub of 512. The evaluation results, including Mean KLD, Median KLD, and accuracy metrics such as Mean PPL and Same Top-1 %, were aggregated and saved into the kld_benchmark_summary table.
The GGUF file can be used for local inference with Ollama and LM Studio. Spark-X2.5 support is provided by XHToken/llama.cpp, so the Quick Starts below use this compatible implementation.
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
Replace the model path below with the absolute path to the downloaded GGUF file:
printf 'FROM /absolute/path/to/Spark-X2.5-4B.gguf\n' > ./Modelfile.spark
Start the Ollama server in the first terminal:
./ollama serve
Open a second terminal in the same ollama-spark directory:
./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.
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
Close LM Studio.
Back up the selected LM Studio runtime directory:
<LM_STUDIO_HOME>/extensions/backends/<selected-runtime>/
Copy the llama.cpp-spark build output into the selected runtime directory, replacing the existing runtime files.
Place Spark-X2.5-4B.gguf in:
<LM_STUDIO_HOME>/models/<org>/<name>/
Example runtime directory on Apple Silicon:
./build/bin/* -> ~/.lmstudio/extensions/backends/llama.cpp-mac-arm64-apple-metal-advsimd-<version>/
Open LM Studio, select the model under My Models, click Load, and start a new chat.
You can also use the lms CLI:
lms ls
lms load <model>
lms chat <model>
Released under the Apache License 2.0.