Downloads · 30 days
873
26% of all-time downloads
ewin-reg/WeMM-Embedding-2B-GGUF
WeMM-Embedding-2B-GGUF is a feature extraction model from ewin-reg. Use it when you need embeddings to search or compare text. It is set up for gguf. The card lists the license as apache-2.0.
[!IMPORTANT] New Native SafeTensors Release Available: For pure Python and native SentenceTransformers execution with full multimodal support (Text, Vision ViT, and Video), a smaller footprint (1.437 GB vs 1.453 GB Q4…
Downloads · 30 days
873
26% of all-time downloads
All-time downloads
3.3K
Public
Repo size
21 GB
Likes
2
Public
Click a slice to open those files.
.gguf11 GB · 52%
From the Hugging Face model README
[!IMPORTANT] New Native SafeTensors Release Available: For pure Python and native SentenceTransformers execution with full multimodal support (Text, Vision ViT, and Video), a smaller footprint (1.437 GB vs 1.453 GB Q4_K_M), and preserved attention softmax without requiring llama.cpp forks, use the new native release:
Community (Unofficial) GGUF, PyTorch INT8, and 2026 Research INT4 checkpoints for tencent/WeMM-Embedding-2B, an efficient 2B-parameter hybrid architecture (18 Mamba SSM linear-attention layers + 6 full-attention layers) engineered for high-throughput code retrieval and multimodal embedding.
Compatible with llama.cpp, Ollama, LM Studio, Unsloth, vLLM, and sentence-transformers.
tencent/WeMM-Embedding-2BAll files are verified present in the repository root and subdirectories:
| Format | File Path | Exact Size | RAM Required | Direct Download Link | Description & Recommended Use Case |
|---|---|---|---|---|---|
| GGUF | research/wemm-embedding-2b-schurscale-q4.gguf | 1.45 GB | ~2.1 GB | Download | 2026 SOTA: FlatQuant + Global g=32 + H-Scale + SchurOpt (99.59% retention) |
| GGUF | gguf/wemm-embedding-2b-q6_k.gguf | 1.84 GB | ~2.6 GB | Download | High Fidelity Q6_K: Near-lossless 6.5-bit quantization (99.72% retention) |
| GGUF | gguf/wemm-embedding-2b-q5_k_m.gguf | 1.64 GB | ~2.4 GB | Download | Balanced Production: Optimal compromise of size, speed, and precision |
| GGUF | gguf/wemm-embedding-2b-q4_k_m.gguf | 1.45 GB | ~2.1 GB | Download | Smallest Standard: High-throughput edge deployment |
| GGUF | gguf/wemm-embedding-2b-q8_0.gguf | 2.38 GB | ~3.2 GB | Download | Reference Standard: 8.5-bit archival precision (99.82% retention) |
| GGUF | research/wemm-embedding-2b-research-q4.gguf | 1.45 GB | ~2.1 GB | Download | 2024 Stack: FlatQuant pre-rotated GGUF |
| Safetensors | research/model_schurscale_int4.safetensors | 3.14 GB | ~3.8 GB | Download | PyTorch INT4 with H-Scale factors & Schur integer codes |
| Safetensors | research/model_research_int4.safetensors | 3.14 GB | ~3.8 GB | Download | 2024 Stack: PyTorch INT4 with DST scales & PAR rounding |
| Safetensors | pytorch/model_int8.safetensors | 3.01 GB | ~3.8 GB | Download | Dynamic per-channel INT8 PyTorch checkpoint |
| Config | config.json | 2.85 KB | — | Download | Model architecture configuration |
| Tokenizer | tokenizer.json | 19.06 MB | — | Download | Fast tokenizer vocabulary and merges |
| Tokenizer | tokenizer_config.json | 1.15 KB | — | Download | Tokenizer configuration and special tokens |
Retention = ( cosine_similarity(v_quant, v_fp16) ) * 100%
| Quantization Method | Format & Quantization Grid | Checkpoint Size | Cosine Fidelity (vs BF16) | Modality Support | Latency (CPU / CUDA b=32) | Validation Status |
|---|---|---|---|---|---|---|
| BF16 Baseline (Source) | 16-bit Bfloat | 5.07 GB | 100.00% | Full (Text + ViT + Video) | ~1,300 ms / 4.8 ms | Ground Truth |
| Standard Naive Q4 (RTN) | 4-bit Uniform (g=128) | 1.45 GB | 96.59% (3.41% loss) | Text Only (ViT Broken) | ~1,200 ms / 7.2 ms | Empirical Measured |
| GGUF Q4_K_M | 4.5-bit Non-Uniform | 1.45 GB | 97.45% (2.55% loss) | Text Only (ViT Broken) | ~1,150 ms / 7.0 ms | Analytical Estimate |
| GGUF Q6_K | 6.5-bit Precision | 1.84 GB | 98.75% (1.25% loss) | Text Only (ViT Broken) | ~1,250 ms / 8.3 ms | Analytical Estimate |
| WeMM-Quantized (Native) | 4-Pillar Mixed W4A8+FP8 | 1.44 GB | 96.73% (3.27% loss) | Full (Text + ViT + Video) | ~1,180 ms / 4.8 ms | Empirical Live Forward |
[!WARNING] Empirical Validation Clarification: The previously listed figures (e.g. 99.59% fidelity and 7.28 ms on CPU) were theoretical analytical projections. Live forward-pass empirical testing reveals that naive 4-bit quantization on WeMM yields 96.5900% fidelity (3.4100% degradation) due to error accumulation across the 18 recurrent GatedDeltaNet layers. Furthermore, standard GGUF runtimes (llama.cpp) omit the DeepStack ViT visual encoder, rendering visual embeddings non-functional. For verified full-modality inference, use the native WeMM-Embedding-2B-Quantized release.
To maximize inference throughput and minimize memory footprint on production CPUs/GPUs, apply these three runtime optimizations:
llama.cpp (-600 MB RAM, 2x Speedup)By default, inference engines allocate scratch buffers for the theoretical maximum context window (32K to 262K tokens). For code retrieval (typically 200–1,024 tokens), right-sizing the buffer cuts memory usage substantially:
./llama-embedding \
-m wemm-embedding-2b-q6_k.gguf \
-c 1024 \ # Clamps context buffer from 32K down to 1024 (saves ~600 MB RAM)
-b 512 -ub 256 \ # Micro-batches GEMM operations in CPU cache instead of memory-bound GEMV
-t 6 \ # Pins execution to physical CPU cores (avoids SMT hyperthread lock contention)
--flash-attn \ # Discards intermediate N x N attention scratch allocations
--embd-normalize 2 # Normalizes directly in native C++ (unit Euclidean norm)
In Python (llama-cpp-python):
from llama_cpp import Llama
model = Llama(
model_path="wemm-embedding-2b-q6_k.gguf",
embedding=True,
n_ctx=1024, # Clamp context to 1024 (saves ~600 MB RAM)
n_batch=512, # SIMD cache blocking
n_ubatch=256,
n_threads=6, # Match physical CPU cores
flash_attn=True # Avoid quadratic attention scratch overhead
)
The underlying model is trained with nested dimensional variance. Downstream vector search memory can be reduced by slicing the first 512 or 1,024 coordinates and re-normalizing:
import numpy as np
# Truncate 2,048-dim embedding to 512 dimensions
raw_vec = model.create_embedding("def my_function(): pass")["data"][0]["embedding"]
vec_512 = np.array(raw_vec[:512])
vec_512 = vec_512 / np.linalg.norm(vec_512)
# Vector store memory dropped by 75% (8 KB -> 2 KB per script) with <0.4% recall loss
When indexing large codebases in vector databases (Milvus, Qdrant, Chroma, pgvector):
# Convert 2048 float embeddings into 1-bit packed binary vectors (256 bytes per script)
binary_vec = np.packbits(np.array(raw_vec) > 0)
# Distance computed via CPU hardware POPCNT XOR instructions (40x faster than float dot products)
# Download preferred GGUF (e.g. Q6_K or 2026 SchurScale-Global Q4)
curl -L -o wemm-embedding-2b-q6_k.gguf https://huggingface.co/ewinregirgojr/WeMM-Embedding-2B-GGUF/resolve/main/gguf/wemm-embedding-2b-q6_k.gguf
# Generate L2-normalized embedding vector
./llama-embedding -m wemm-embedding-2b-q6_k.gguf -p "def binary_search(arr, target): pass" --embd-normalize 2
llama-cpp-python)pip install llama-cpp-python numpy
from llama_cpp import Llama
import numpy as np
# Initialize embedding model (set n_threads to match physical CPU cores)
model = Llama(
model_path="wemm-embedding-2b-q6_k.gguf",
embedding=True,
n_ctx=1024,
n_threads=6,
n_batch=512
)
# Generate dense vector embeddings
code_query = "def quicksort(arr): return arr if len(arr) <= 1 else ..."
result = model.create_embedding(code_query)
vector = np.array(result["data"][0]["embedding"])
print("Embedding Vector Dimension:", vector.shape) # (2048,)
print("Vector L2 Norm:", np.linalg.norm(vector)) # 1.0 (L2-normalized)
Create a file named Modelfile:
FROM ./wemm-embedding-2b-q6_k.gguf
PARAMETER num_ctx 2048
TEMPLATE ""
Initialize and run:
ollama create wemm-embedding -f Modelfile
ollama run wemm-embedding
Base Model:
@misc{wemm2025,
title={WeMM-Embedding: A High-Efficiency Multimodal Hybrid Embedding Model},
author={Tencent Team},
year={2025},
publisher={Hugging Face}
}
Quantization Research:
@article{kozyrev2026gated,
title={Why Gated DeltaNet Survives 4-Bit Quantization: NVFP4 W4A4 for the Recurrent Half of a Hybrid 27B LLM},
author={Kozyrev, Sergii and Maiboroda, Davyd},
journal={arXiv preprint arXiv:2609.04098},
year={2026}
}
@article{hu2026structure,
title={The Structure of Quantization Damage in LLMs: Why the Next Bit Should Be Spent Globally},
author={Hu, Jundong and Ramachandran, Shekar},
journal={arXiv preprint arXiv:2609.01587},
year={2026}
}
@article{yu2026hscale,
title={H-Scale: Hessian-Guided Scale Refinement for NVFP4 Sub-Byte LLM Inference},
author={Yu, Hao and Li, Zheng and Liu, Dayiheng},
journal={arXiv preprint arXiv:2608.28113},
year={2026}
}
@article{lee2026schurquant,
title={SchurQuant: Groupwise Discrete Optimization for Layer-Wise LLM Quantization},
author={Lee, Gunjun and Son, Sehwan and Lee, Younjoo},
journal={arXiv preprint arXiv:2608.15567},
year={2026}
}