Downloads · 30 days
13
15% of all-time downloads
fabbagar83/Codestral-Mamba-7B-v0.1-Q4_0-GGUF
Codestral-Mamba-7B-v0.1-Q4_0-GGUF is a machine learning model from fabbagar83. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Cuantización Q40 de mistralai/Mamba-Codestral-7B-v0.1 en formato GGUF para llama.cpp.
Downloads · 30 days
13
15% of all-time downloads
All-time downloads
87
Public
Repo size
4.1 GB
Likes
0
Public
Click a slice to open those files.
.gguf4.1 GB · 100%
From the Hugging Face model README
Cuantización Q4_0 de mistralai/Mamba-Codestral-7B-v0.1 en formato GGUF para llama.cpp.
El archivo original (3.9 GB) está dividido en 3 partes porque GitHub LFS limita a 2 GB por archivo.
| Archivo | Tamaño |
|---|---|
Mamba-Codestral-7B-v0.1-Q4_0-00001-of-00003.gguf | 1.8 GB |
Mamba-Codestral-7B-v0.1-Q4_0-00002-of-00003.gguf | 1.7 GB |
Mamba-Codestral-7B-v0.1-Q4_0-00003-of-00003.gguf | 354 MB |
git lfs install
git clone https://github.com/fabian-bautista/codestral-Mamba-7b-q4.git
cd codestral-Mamba-7b-q4
llama-gguf-split --merge \
Mamba-Codestral-7B-v0.1-Q4_0-00001-of-00003.gguf \
Mamba-Codestral-7B-v0.1-Q4_0.gguf
llama.cpp también acepta cargar el primer split directamente — auto-detecta y carga los demás.
# CLI interactivo
llama-cli -m Mamba-Codestral-7B-v0.1-Q4_0-00001-of-00003.gguf \
-c 16384 -n 512 -t 8 --color -cnv
# Servidor HTTP (API compatible OpenAI)
llama-server -m Mamba-Codestral-7B-v0.1-Q4_0-00001-of-00003.gguf \
-c 16384 -t 8 --host 127.0.0.1 --port 8080
llama.cpp aún no tiene kernels Metal optimizados para operaciones SSM/Mamba2, por lo que en Mac la inferencia corre solo en CPU y es muy lenta (~17 seg/token en un M2 con 8 hilos). Para uso práctico de generación de código en Mac, hoy es preferible un Transformer como Qwen2.5-Coder con -ngl 99.
Este GGUF se generó con un patch local en conversion/mamba.py de llama.cpp (build 9330). El converter upstream escribe n_head=0 para Mamba2, lo cual hace que el runtime calcule d_in_proj con la fórmula incorrecta y rechace cargar el modelo:
error: tensor 'blk.0.ssm_in.weight' has wrong shape; expected 4096, 18432, got 4096, 18560
Fix aplicado:
# conversion/mamba.py, en Mamba2Model.set_gguf_parameters()
# Antes:
self.gguf_writer.add_head_count(0) # unused, but seemingly required when loading
# Después:
self.gguf_writer.add_head_count(self.d_inner // head_dim) # = num_heads real (128 para Codestral)
El runtime calcula d_in_proj = 2*d_inner + 2*n_group*d_state + n_head. Sin el fix, n_head=0 → d_in_proj=18432. Con el fix, n_head=128 → d_in_proj=18560, que coincide con la forma real del tensor.
El modelo original es de Mistral AI bajo Apache-2.0. Esta cuantización mantiene la misma licencia.