模型简介
模型特点
模型能力
使用案例
🚀 MistralAI的Devstral - Small - 2505的Llamacpp imatrix量化版本
本项目是MistralAI的Devstral - Small - 2505模型的量化版本,借助特定工具和方法实现了不同量化格式,支持多语言,可在多种环境下运行,为用户提供了多样化的选择。
🚀 快速开始
模型创建
本量化模型使用Unsloth的转换方法创建(非常感谢其上传该方法),具体可参考:[https://huggingface.co/unsloth/Devstral - Small - 2505](https://huggingface.co/unsloth/Devstral - Small - 2505)。使用 llama.cpp 发布版本 b5432 进行量化。原始模型可访问:[https://huggingface.co/mistralai/Devstral - Small - 2505](https://huggingface.co/mistralai/Devstral - Small - 2505)。所有量化均使用imatrix选项,并采用来自 此处 的数据集。
运行方式
✨ 主要特性
视觉支持
感谢ngxson的贡献,他展示了Mistral Small 3.1的原始mmproj与Devstral Small无缝兼容,因此这里提供了用于视觉应用的mmproj文件。需要注意的是,这并非官方支持,可能无法完美运行,但在实践中似乎是可行的。
多语言支持
支持多种语言,包括英语(en)、法语(fr)、德语(de)、西班牙语(es)、葡萄牙语(pt)、意大利语(it)、日语(ja)、韩语(ko)、俄语(ru)、中文(zh)、阿拉伯语(ar)、波斯语(fa)、印尼语(id)、马来语(ms)、尼泊尔语(ne)、波兰语(pl)、罗马尼亚语(ro)、塞尔维亚语(sr)、瑞典语(sv)、土耳其语(tr)、乌克兰语(uk)、越南语(vi)、印地语(hi)和孟加拉语(bn)。
📦 安装指南
安装huggingface - cli
首先,确保你已安装huggingface - cli:
pip install -U "huggingface_hub[cli]"
下载特定文件
你可以指定要下载的特定文件:
huggingface-cli download bartowski/mistralai_Devstral - Small - 2505 - GGUF --include "mistralai_Devstral - Small - 2505 - Q4_K_M.gguf" --local - dir ./
下载大模型(大于50GB)
如果模型大于50GB,它会被分割成多个文件。要将它们全部下载到本地文件夹,请运行:
huggingface-cli download bartowski/mistralai_Devstral - Small - 2505 - GGUF --include "mistralai_Devstral - Small - 2505 - Q8_0/*" --local - dir ./
你可以指定一个新的本地目录(如mistralai_Devstral - Small - 2505 - Q8_0),也可以将它们全部下载到当前目录(./)。
💻 使用示例
提示格式
<s>[SYSTEM_PROMPT]{system_prompt}[/SYSTEM_PROMPT][INST]{prompt}[/INST]
📚 详细文档
下载文件选择
文件名 | 量化类型 | 文件大小 | 分割情况 | 描述 |
---|---|---|---|---|
[Devstral - Small - 2505 - bf16.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - bf16.gguf) | bf16 | 47.15GB | 否 | 完整的BF16权重。 |
[Devstral - Small - 2505 - Q8_0.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q8_0.gguf) | Q8_0 | 25.05GB | 否 | 极高质量,通常不需要,但为最大可用量化。 |
[Devstral - Small - 2505 - Q6_K_L.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q6_K_L.gguf) | Q6_K_L | 19.67GB | 否 | 嵌入和输出权重使用Q8_0。非常高质量,接近完美,推荐。 |
[Devstral - Small - 2505 - Q6_K.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q6_K.gguf) | Q6_K | 19.35GB | 否 | 非常高质量,接近完美,推荐。 |
[Devstral - Small - 2505 - Q5_K_L.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q5_K_L.gguf) | Q5_K_L | 17.18GB | 否 | 嵌入和输出权重使用Q8_0。高质量,推荐。 |
[Devstral - Small - 2505 - Q5_K_M.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q5_K_M.gguf) | Q5_K_M | 16.76GB | 否 | 高质量,推荐。 |
[Devstral - Small - 2505 - Q5_K_S.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q5_K_S.gguf) | Q5_K_S | 16.30GB | 否 | 高质量,推荐。 |
[Devstral - Small - 2505 - Q4_1.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q4_1.gguf) | Q4_1 | 14.87GB | 否 | 旧格式,性能与Q4_K_S相似,但在苹果硅芯片上每瓦处理的令牌数有所提高。 |
[Devstral - Small - 2505 - Q4_K_L.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q4_K_L.gguf) | Q4_K_L | 14.83GB | 否 | 嵌入和输出权重使用Q8_0。质量良好,推荐。 |
[Devstral - Small - 2505 - Q4_K_M.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q4_K_M.gguf) | Q4_K_M | 14.33GB | 否 | 质量良好,是大多数用例的默认大小,推荐。 |
[Devstral - Small - 2505 - Q4_K_S.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q4_K_S.gguf) | Q4_K_S | 13.55GB | 否 | 质量稍低,但节省更多空间,推荐。 |
[Devstral - Small - 2505 - Q4_0.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q4_0.gguf) | Q4_0 | 13.49GB | 否 | 旧格式,为ARM和AVX CPU推理提供在线重新打包功能。 |
[Devstral - Small - 2505 - IQ4_NL.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ4_NL.gguf) | IQ4_NL | 13.47GB | 否 | 与IQ4_XS相似,但稍大。为ARM CPU推理提供在线重新打包功能。 |
[Devstral - Small - 2505 - Q3_K_XL.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q3_K_XL.gguf) | Q3_K_XL | 12.99GB | 否 | 嵌入和输出权重使用Q8_0。质量较低但可用,适合低内存情况。 |
[Devstral - Small - 2505 - IQ4_XS.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ4_XS.gguf) | IQ4_XS | 12.76GB | 否 | 质量不错,比Q4_K_S小,性能相似,推荐。 |
[Devstral - Small - 2505 - Q3_K_L.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q3_K_L.gguf) | Q3_K_L | 12.40GB | 否 | 质量较低但可用,适合低内存情况。 |
[Devstral - Small - 2505 - Q3_K_M.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q3_K_M.gguf) | Q3_K_M | 11.47GB | 否 | 质量较低。 |
[Devstral - Small - 2505 - IQ3_M.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ3_M.gguf) | IQ3_M | 10.65GB | 否 | 中低质量,新方法,性能与Q3_K_M相当。 |
[Devstral - Small - 2505 - Q3_K_S.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q3_K_S.gguf) | Q3_K_S | 10.40GB | 否 | 质量较低,不推荐。 |
[Devstral - Small - 2505 - IQ3_XS.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ3_XS.gguf) | IQ3_XS | 9.91GB | 否 | 质量较低,新方法,性能不错,略优于Q3_K_S。 |
[Devstral - Small - 2505 - Q2_K_L.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q2_K_L.gguf) | Q2_K_L | 9.55GB | 否 | 嵌入和输出权重使用Q8_0。质量非常低,但出人意料地可用。 |
[Devstral - Small - 2505 - IQ3_XXS.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ3_XXS.gguf) | IQ3_XXS | 9.28GB | 否 | 质量较低,新方法,性能不错,与Q3量化相当。 |
[Devstral - Small - 2505 - Q2_K.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - Q2_K.gguf) | Q2_K | 8.89GB | 否 | 质量非常低,但出人意料地可用。 |
[Devstral - Small - 2505 - IQ2_M.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ2_M.gguf) | IQ2_M | 8.11GB | 否 | 质量相对较低,使用了最先进的技术,出人意料地可用。 |
[Devstral - Small - 2505 - IQ2_S.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ2_S.gguf) | IQ2_S | 7.48GB | 否 | 质量较低,使用了最先进的技术,可用。 |
[Devstral - Small - 2505 - IQ2_XS.gguf](https://huggingface.co/bartowski/mistralai_Devstral - Small - 2505 - GGUF/blob/main/mistralai_Devstral - Small - 2505 - IQ2_XS.gguf) | IQ2_XS | 7.21GB | 否 | 质量较低,使用了最先进的技术,可用。 |
嵌入/输出权重
部分量化(如Q3_K_XL、Q4_K_L等)采用标准量化方法,将嵌入和输出权重量化为Q8_0,而非通常的默认值。
ARM/AVX信息
以前,你会下载Q4_0_4_4/4_8/8_8,这些文件的权重会在内存中交错排列,以便通过一次加载更多数据来提高ARM和AVX机器的性能。
然而,现在有了一种称为“在线重新打包”的权重处理方式,详情见 此PR。如果你使用Q4_0,并且你的硬件能从重新打包权重中受益,它将自动实时进行处理。
从llama.cpp构建版本 b4282 开始,你将无法运行Q4_0_X_X文件,而需要使用Q4_0。
此外,如果你想获得稍好的质量,可以使用IQ4_NL,感谢 此PR,它也会为ARM重新打包权重,不过目前仅支持4_4。加载时间可能会更长,但总体速度会提高。
如何选择文件
Artefact2 提供了一篇很棒的文章,带有展示各种性能的图表,可参考 此处。
首先,你需要确定能运行多大的模型。为此,你需要了解自己有多少内存(RAM)和/或显存(VRAM)。
如果你希望模型运行得尽可能快,你需要将整个模型放入GPU的显存中。选择文件大小比GPU总显存小1 - 2GB的量化版本。
如果你追求绝对的最高质量,将系统内存和GPU显存相加,然后选择文件大小比该总和小1 - 2GB的量化版本。
接下来,你需要决定是使用“I - 量化”还是“K - 量化”。
如果你不想考虑太多,选择K - 量化版本,格式为“QX_K_X”,如Q5_K_M。
如果你想深入了解,可以查看这个非常有用的特性图表:[llama.cpp特性矩阵](https://github.com/ggerganov/llama.cpp/wiki/Feature - matrix)。
但基本上,如果你目标是低于Q4的量化,并且使用cuBLAS(Nvidia)或rocBLAS(AMD),你应该考虑I - 量化版本,格式为IQX_X,如IQ3_M。这些是较新的版本,在相同大小下性能更好。
这些I - 量化版本也可在CPU上使用,但比相应的K - 量化版本慢,因此你需要在速度和性能之间做出权衡。
🔧 技术细节
隐私政策
如果你想了解我们如何处理你的个人数据,请阅读我们的 隐私政策。
许可证
本项目采用Apache 2.0许可证。
📄 许可证
本项目使用的许可证为Apache 2.0。
致谢
感谢kalomaze和Dampf在创建imatrix校准数据集方面提供的帮助。
感谢ZeroWw在嵌入/输出实验方面提供的灵感。
感谢LM Studio对我工作的赞助。
如果你想支持我的工作,请访问我的ko - fi页面:[https://ko - fi.com/bartowski](https://ko - fi.com/bartowski)



