Updated 2 days ago
ollama pull aiconjured/embeddinggemma-300M-NVFP4-Q8-GGUF
A high-fidelity mixed-precision requantization of Google’s EmbeddingGemma-300M embedding model, optimized for Blackwell GPU tensor-core inference while preserving near-8-bit embedding quality.
| Attribute | Value |
|---|---|
| Base Model | ggml-org/embeddinggemma-300M-GGUF |
| Original Architecture | google/embedding-gemma-300m |
| Architecture | gemma-embedding (pure transformer) |
| Parameters | 300M dense |
| Layers | 24 transformer blocks |
| Embedding Dimension | 768 |
| FFN Dimension | 1,152 |
| Attention Heads | 3 (GQA: 1 KV head) |
| Context Length | 2,048 tokens |
| Quantization | NVFP4 + Q8_0 mixed |
| File Size | 286 MB (down from 333 MB Q8_0) |
| Bits per Weight | 7.62 |
| Size Reduction | 14% |
This build uses a conservative mixed-precision recipe that prioritizes embedding quality while still leveraging Blackwell’s native NVFP4 tensor-core operations for the compute-heavy FFN layers.
| Type | Tensor Count | Purpose |
|---|---|---|
| F32 | 145 | Norms (attn_norm, post_attention_norm, attn_q_norm, attn_k_norm, ffn_norm, post_ffw_norm, output_norm) — required by CUDA kernel constraints |
| Q8_0 | 97 | Attention weights (attn_q, attn_k, attn_v, attn_output) + token embedding — most sensitive to quantization |
| NVFP4 | 74 | FFN weights (ffn_gate, ffn_up, ffn_down) + dense_2, dense_3 — compute-heavy, tolerant to 4-bit |
| Total | 316 | — |
# F32 protections (CUDA kernel requirements)
^blk\.\d+\.attn_norm\.weight$=f32
^blk\.\d+\.post_attention_norm\.weight$=f32
^blk\.\d+\.attn_q_norm\.weight$=f32
^blk\.\d+\.attn_k_norm\.weight$=f32
^blk\.\d+\.ffn_norm\.weight$=f32
^blk\.\d+\.post_ffw_norm\.weight$=f32
^output_norm\.weight$=f32
# Q8_0 protections (most sensitive to quantization)
^token_embd\.weight$=q8_0
^blk\.\d+\.attn_q\.weight$=q8_0
^blk\.\d+\.attn_k\.weight$=q8_0
^blk\.\d+\.attn_v\.weight$=q8_0
^blk\.\d+\.attn_output\.weight$=q8_0
# NVFP4 on FFN weights (compute-heavy, tolerant)
^blk\.\d+\.ffn_gate\.weight$=nvfp4
^blk\.\d+\.ffn_up\.weight$=nvfp4
^blk\.\d+\.ffn_down\.weight$=nvfp4
^dense_2\.weight$=nvfp4
^dense_3\.weight$=nvfp4
Embedding quality was measured by computing cosine similarity between embeddings generated by the Q8_0 original and this NVFP4+Q8 mixed version across 10 diverse prompts covering multiple semantic domains (animals, food, repairs, science, weather, entertainment, baking).
Results: - Average cosine similarity: 0.9703 - Minimum: 0.9653 - Maximum: 0.9756
All 10 prompts achieved ≥0.965 similarity, well above the 0.95 threshold generally considered acceptable for embedding models. This confirms that the conservative mixed-precision strategy preserves embedding quality effectively.
A more aggressive recipe (NVFP4 on all compute weights including attention) was also tested: - Average cosine similarity: 0.9517 - Minimum: 0.9401
While still acceptable, the mild version provides measurably better quality with only a 18 MB size difference, making it the preferred choice for most use cases.
NVFP4 FFN layers leverage Blackwell’s native FP4 tensor-core operations, delivering faster inference on RTX 50-series GPUs. Actual speedup varies by hardware and workload, but NVFP4 operations are significantly faster than Q8_0 on compatible hardware.
| Configuration | VRAM Needed | Feasibility |
|---|---|---|
| Any modern GPU | ~300 MB | ✅ Easily fits |
| CPU only | ~300 MB RAM | ✅ Works |
At 286 MB, this model is extremely lightweight and will run on virtually any hardware.
# Pull the model
ollama pull aiconjured/embeddinggemma-300M-NVFP4-Q8-GGUF
# Use as embedding model
ollama embed --model aiconjured/embeddinggemma-300M-NVFP4-Q8-GGUF "Your text here"
# Embedding inference
./llama-embed -m embeddinggemma-300M-NVFP4-Q8-GGUF -f input.txt
# Batch embedding
./llama-embed -m embeddinggemma-300M-NVFP4-Q8-GGUF -f batch.txt -b 32
embeddinggemma-300M-NVFP4-Q8-GGUF.gguf — Main model (286 MB)To reproduce this quantization:
# 1. Download Q8_0 source from ggml-org's repo
# 2. Quantize with mixed-precision recipe
./llama-quantize --allow-requantize \
--tensor-type-file recipe-nvfp4-mild.txt \
embeddinggemma-300M-Q8_0.gguf \
embeddinggemma-300M-NVFP4-Q8-GGUF.gguf Q8_0 8
# 3. Patch file_type to 39 (MOSTLY_NVFP4)
# (Use a GGUF header patcher — the quantizer doesn't set this)
No imatrix is needed for embedding models — they don’t benefit from input-scale calibration the way generation models do.
Same as base model: Apache 2.0
Part of the AIconjured NVFP4 quantization series.