Downloads · 30 days
528
12% of all-time downloads
eaddario/Devstral-Small-2505-GGUF
Devstral-Small-2505-GGUF is a text generation model from eaddario. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Using [LLaMA C++][llm] release [b5870][llm-rel] for quantization.
Downloads · 30 days
528
12% of all-time downloads
All-time downloads
4.5K
Public
Repo size
249 GB
Likes
0
Public
Click a slice to open those files.
.gguf210 GB · 84%
From the Hugging Face model README
Using LLaMA C++ release b5870 for quantization.
Original model: mistralai/Devstral-Small-2505
From the original model creators:
Devstral Small 1.0
Devstral is an agentic LLM for software engineering tasks built under a collaboration between Mistral AI and All Hands AI 🙌. Devstral excels at using tools to explore codebases, editing multiple files and power software engineering agents. The model achieves remarkable performance on SWE-bench which positionates it as the #1 open source model on this benchmark.
It is finetuned from Mistral-Small-3.1, therefore it has a long context window of up to 128k tokens. As a coding agent, Devstral is text-only and before fine-tuning from
Mistral-Small-3.1the vision encoder was removed.For enterprises requiring specialized capabilities (increased context, domain-specific knowledge, etc.), we will release commercial models beyond what Mistral AI contributes to the community.
Learn more about Devstral in our blog post.
An area of personal interest is finding ways to optimize the inference performance of LLMs when deployed in resource-constrained environments like commodity hardware, desktops, laptops, mobiles, edge devices, etc. There are many approaches to accomplish this, including architecture simplification and knowledge distillation, but my focus has been primarily on quantization and pruning.
The method used to produce these experimental versions is covered in Squeezing Tensor Bits: the quest for smaller LLMs, but at a high level it involves using a custom version of llama-imatrix to identify influential tensors, and the standard llama-quantize to quantize the most important layers to higher bit precision and the less important to lower bits. This process was partly inspired by Dumitru's et al Layer-Wise Quantization: A Pragmatic and Effective Method for Quantizing LLMs Beyond Integer Bit-Levels.
As of version b5125 llama-quantize can now perform tensor-wide quantization (TWQ), whereby user-defined tensors are quantized at a specific level, or perform layer-wise quantization (LWQ) by selecting different quantization types per tensor/layer. For example, --tensor-type attn_v=q6_k will quantize all Attention Value tensors at q6_k (TWQ), and --tensor-type "\.([0-9]|1[01257]|31)\.attn_k=q4_k" will quantize Attention Key tensors on layers 0 to 9, 10, 11, 12, 15, 17 and 31 at q4_k, leaving the remaining layers at their default value (LWQ).
The modified version of llama-imatrix generates useful statistics to guide the tensor selection process, --show-statistics will display:
Please note that statistics are calculated for each individial tensor and should be used to compare between tensors of the same type only. For example, assuming that attn_k in layer 10 has a higher influence during inference than attn_k in layer 7 because its Σ(Act²) is larger makes sense, whilst concluding the same between attn_k and ffn_down does not.
There’s a pull request to merge these changes back into the core llama.cpp project. This may or may not ever happen so, until then, the modified version will be available on GitHub.
For testing and comparison I use models produced by Unsloth (Daniel and Michael Han do some really advanced level stuff!) and Bartowski (see credits below) but when they don't provide versions of the required model, all tests and comparisons are done against naive quantizations obtained by simply running llama-quantize with no further optimization.
All experimental versions were generated using an appropriate imatrix created from calibration datasets available at eaddario/imatrix-calibration. At its core, an Importance Matrix (imatrix) is a table or, more broadly, a structured representation that scores the relative importance of different features or parameters in a machine learning model. It essentially quantifies the "impact" each feature has on a specific outcome, prediction, or relationship being modeled, and it helps to counterbalance the negative effects of quantization and pruning.
The process to generate these models is roughly as follows:
llama-imatrixllama-quantize*BF16 would be preferred, but Apple's GPUs don't support it yet, and therefore any operations are executed in the CPU, making it unacceptably slow. This is expected to change at some point but until then, if you are using Apple kit, avoid using any models tagged BF16
| Model | Bartowski | Unsloth | Repo | Shrinkage |
|---|---|---|---|---|
| Devstral-Small-2505-IQ3_M | 10.7 | N/A | 10.8 | -0.9% |
| Devstral-Small-2505-IQ3_S | 9.9 | N/A | 10.0 | -0.9% |
| Devstral-Small-2505-IQ4_NL | 13.5 | 13.5 | 13.1 | 3.0% |
| Devstral-Small-2505-Q3_K_L | 12.4 | N/A | 11.4 | 8.1% |
| Devstral-Small-2505-Q3_K_M | 11.5 | 11.5 | 10.4 | 9.6% |
| Devstral-Small-2505-Q3_K_S | 10.4 | 10.4 | 9.4 | 9.6% |
| Devstral-Small-2505-Q4_K_M | 14.3 | 14.3 | 13.1 | 8.4% |
| Devstral-Small-2505-Q4_K_S | 13.5 | 13.5 | 12.2 | 9.6% |
| Devstral-Small-2505-Q5_K_M | 16.8 | 16.8 | 16.0 | 4.8% |
| Devstral-Small-2505-Q5_K_S | 16.3 | 16.3 | 15.1 | 7.4% |
| Devstral-Small-2505-Q6_K | 19.3 | 19.3 | 19.8 | -2.6% |
| Devstral-Small-2505-Q8_0 | 25.1 | 25.1 | 21.2 | 15.5% |
| Model | BPW | μPPL | 𝜌PPL | μKLD | RMS Δp |
|---|---|---|---|---|---|
| Devstral-Small-2505-IQ3_M | 3.6679 | 5.878560 ±0.036852 | 96.11% | 0.154966 ±0.000919 | 11.912 ±0.065 |
| Devstral-Small-2505-IQ3_S | 3.3952 | 6.937376 ±0.048193 | 92.81% | 0.318622 ±0.001446 | 15.426 ±0.067 |
| Devstral-Small-2505-IQ4_NL | 4.4277 | 5.470581 ±0.030497 | 98.12% | 0.079381 ±0.000526 | 9.181 ±0.059 |
| Devstral-Small-2505-Q3_K_L | 3.8586 | 5.885790 ±0.036285 | 95.76% | 0.146794 ±0.001054 | 12.073 ±0.073 |
| Devstral-Small-2505-Q3_K_M | 3.2700 | 5.986799 ±0.037252 | 95.26% | 0.163669 ±0.001136 | 12.653 ±0.074 |
| Devstral-Small-2505-Q3_K_S | 2.9091 | 6.641115 ±0.043523 | 92.63% | 0.263208 ±0.001501 | 15.212 ±0.075 |
| Devstral-Small-2505-Q4_K_M | 4.4333 | 5.289606 ±0.030676 | 98.81% | 0.044568 ±0.000398 | 6.927 ±0.059 |
| Devstral-Small-2505-Q4_K_M-bartowski | 4.8620 | 5.151812 ±0.029360 | 99.47% | 0.020939 ±0.000193 | 4.633 ±0.046 |
| Devstral-Small-2505-Q4_K_M-unsloth | 4.8620 | 5.153395 ±0.029344 | 99.47% | 0.021015 ±0.000194 | 4.649 ±0.047 |
| Devstral-Small-2505-Q4_K_S | 4.1234 | 5.374900 ±0.031419 | 98.41% | 0.058614 ±0.000476 | 7.763 ±0.060 |
| Devstral-Small-2505-Q5_K_M | 5.4420 | 5.105346 ±0.028949 | 99.73% | 0.011102 ±0.000109 | 3.461 ±0.039 |
| Devstral-Small-2505-Q5_K_S | 5.1326 | 5.121061 ±0.029110 | 99.64% | 0.014190 ±0.000135 | 3.858 ±0.041 |
| Devstral-Small-2505-Q6_K | 6.7081 | 5.065320 ±0.028550 | 99.93% | 0.002934 ±0.000029 | 1.781 ±0.021 |
| Devstral-Small-2505-Q8_0 | 7.2051 | 5.056784 ±0.028522 | 99.96% | 0.001449 ±0.000015 | 1.238 ±0.016 |
| Devstral-Small-2505-F16 | 16.0003 | 5.050590 ±0.028422 | 100% | N/A | N/A |
Scores generated using llama-perplexity with 750 tasks per test, and a context size of 768 tokens.
For the test data used in the generation of these scores, follow the appropiate links: HellaSwag, ARC, MMLU, Truthful QA and WinoGrande
| Model | ARC | HellaSwag | MMLU | Truthful QA | WinoGrande | Avg Score |
|---|---|---|---|---|---|---|
| Devstral-Small-2505-IQ3_M | 67.7333 ±1.7082 | 83.33 | 42.2667 ±1.8050 | 32.0000 ±1.7045 | 77.4667 ±1.5266 | 60.56 |
| Devstral-Small-2505-IQ3_S | 64.4000 ±1.7496 | 82.53 | 41.8667 ±1.8026 | 31.8667 ±1.7026 | 75.2000 ±1.5780 | 59.17 |
| Devstral-Small-2505-IQ4_NL | 67.6000 ±1.7100 | 83.87 | 43.4667 ±1.8113 | 35.6000 ±1.7496 | 79.6000 ±1.4724 | 62.03 |
| Devstral-Small-2505-Q3_K_L | 64.4000 ±1.7496 | 81.33 | 42.9333 ±1.8086 | 34.6667 ±1.7389 | 78.5333 ±1.5003 | 60.37 |
| Devstral-Small-2505-Q3_K_M | 64.1333 ±1.7525 | 80.80 | 42.9333 ±1.8086 | 34.0000 ±1.7309 | 79.4667 ±1.4760 | 60.27 |
| Devstral-Small-2505-Q3_K_S | 61.6000 ±1.7771 | 81.33 | 41.7333 ±1.8018 | 34.6667 ±1.7389 | 77.0667 ±1.5361 | 59.28 |
| Devstral-Small-2505-Q4_K_M | 67.3333 ±1.7137 | 82.53 | 44.9333 ±1.8176 | 35.0667 ±1.7436 | 80.0000 ±1.4616 | 61.97 |
| Devstral-Small-2505-Q4_K_M-bartowski | 66.9333 ±1.7190 | 82.80 | 43.2000 ±1.8100 | 35.8667 ±1.7525 | 79.8667 ±1.4652 | 61.73 |
| Devstral-Small-2505-Q4_K_M-unsloth | 66.9333 ±1.7190 | 82.80 | 43.6000 ±1.8119 | 36.4000 ±1.7581 | 79.8667 ±1.4652 | 61.92 |
| Devstral-Small-2505-Q4_K_S | 68.5333 ±1.6968 | 82.40 | 43.6000 ±1.8119 | 34.9333 ±1.7420 | 79.4667 ±1.4760 | 61.79 |
| Devstral-Small-2505-Q5_K_M | 65.3333 ±1.7389 | 82.93 | 43.7333 ±1.8126 | 35.7333 ±1.7510 | 79.8667 ±1.4652 | 61.52 |
| Devstral-Small-2505-Q5_K_S | 65.0667 ±1.7420 | 83.07 | 43.8667 ±1.8132 | 35.7333 ±1.7510 | 79.4667 ±1.4760 | 61.44 |
| Devstral-Small-2505-Q6_K | 66.6667 ±1.7225 | 83.20 | 44.2667 ±1.8149 | 35.4667 ±1.7481 | 80.1333 ±1.4579 | 61.95 |
| Devstral-Small-2505-Q8_0 | 66.4000 ±1.7259 | 83.20 | 43.7333 ±1.8126 | 35.6000 ±1.7496 | 80.1333 ±1.4579 | 61.81 |
| Devstral-Small-2505-F16 | 66.8000 ±1.7207 | 83.47 | 43.7333 ±1.8126 | 36.0000 ±1.7539 | 79.7333 ±1.4688 | 61.95 |
Scores generated using llama-bench. Naive (llama-quantize with no optimization) Q4_K_M quantization included for comparison.
| model | size | params | backend | threads | test | t/s |
|---|---|---|---|---|---|---|
| Devstral-Small-2505-Q4_K_M | 12.17 GiB | 23.57 B | Metal,BLAS | 12 | pp512 | 249.28 ±9.31 |
| Devstral-Small-2505-Q4_K_M | 12.17 GiB | 23.57 B | Metal,BLAS | 12 | tg128 | 26.61 ±0.31 |
| Devstral-Small-2505-Q4_K_M | 12.17 GiB | 23.57 B | Metal,BLAS | 12 | pp1024+tg1024 | 44.85 ±0.40 |
| Devstral-Small-2505-Q4_K_M-bartowski | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | pp512 | 254.77 ±13.57 |
| Devstral-Small-2505-Q4_K_M-bartowski | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | tg128 | 27.64 ±0.39 |
| Devstral-Small-2505-Q4_K_M-bartowski | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | pp1024+tg1024 | 45.62 ±0.16 |
| Devstral-Small-2505-Q4_K_M-unsloth | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | pp512 | 259.37 ±5.28 |
| Devstral-Small-2505-Q4_K_M-unsloth | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | tg128 | 28.43 ±0.23 |
| Devstral-Small-2505-Q4_K_M-unsloth | 13.34 GiB | 23.57 B | Metal,BLAS | 12 | pp1024+tg1024 | 45.62 ±0.15 |
Perplexity: one of the key metrics used in NLP evaluation. It measures the quality of a language model by evaluating how well it predicts the next token given a particular sequence of words. A PPL of 1 indicates an exact match between predicted and actual, whereas values greater than one indicate a degree of "surprise" the generated token differs from the expected.
Kullback–Leibler (KL) Divergence: a statistical measure of how much a probability distribution differs from another. When quantizing models (or altering the original tensors in any way for that matter), the closest we can preserve the weights' probability distribution to the original model the better, thus the closest to 0 the better.
AI2 Reasoning Challenge (ARC): a benchmark to evaluate the ability of AI models to answer complex science questions that require logical reasoning beyond pattern matching.
HellaSwag: the Harder Endings, Longer contexts, and Low-shot Activities for Situations With Adversarial Generations (bit of a mouthful!) is a benchmark designed to test commonsense natural language inference. It requires the model to predict the most likely ending of a sentence.
MMLU: the Massive Multitask Language Understanding evaluates LLMs’ general knowledge and problem-solving abilities across 57 subjects, including elementary mathematics, US history, computer science, and law.
Truthful QA: evaluates how well LLMs generate truthful responses to questions. It identifies whether AI models can avoid generating false or misleading information, particularly in areas where human knowledge is prone to misconceptions.
Winogrande: based on the Winograd Schema Challenge, is a natural language understanding task requiring models to resolve ambiguities in sentences involving pronoun references.
LLaMa C++ has a large and vibrant community of contributors (~1,200 last time I checked) that actively maintain and extend its functionality, adding new models and architectures almost as fast as they appear (considering the breakneck speed at which the AI/ML field is advancing, this alone is a remarkable feat!), and whilst I'm grateful to each and everyone of them, I want to recognise three people in particular: Thank You! Colin Kealty for the many contributions and for being one of the best sources of high quality quantized models available on Hugging Face, and a really big Thank You! to Georgi Gerganov for his amazing work with llama.cpp and the ggml/gguf libraries, and Iwan Kawrakow for being one of the key authors behind the many quantisation algorithms and the imatrix functionality.