模型概述
模型特點
模型能力
使用案例
🚀 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)



