Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- vindex
|
| 5 |
+
- gemma3
|
| 6 |
+
- decomposed
|
| 7 |
+
- vendor-free
|
| 8 |
+
base_model: google/gemma-3-4b-it
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Gemma 3 4B Instruct — Vindex Format
|
| 12 |
+
|
| 13 |
+
Decomposed weights for [google/gemma-3-4b-it](https://huggingface.co/google/gemma-3-4b-it) in [LarQL vindex format](https://github.com/chrishayuk/larql).
|
| 14 |
+
|
| 15 |
+
**Use with [vindex-infer](https://github.com/cronos3k/vindex-infer) for vendor-free LLM inference — no CUDA, no PyTorch, just a Rust binary.**
|
| 16 |
+
|
| 17 |
+
## Quick Start
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
# Download
|
| 21 |
+
huggingface-cli download cronos3k/gemma-3-4b-it-vindex --local-dir gemma3-4b.vindex
|
| 22 |
+
|
| 23 |
+
# Run inference (CPU — works on any machine)
|
| 24 |
+
vindex-infer --vindex gemma3-4b.vindex --token-ids "818,5279,529,7001,563"
|
| 25 |
+
# 1. Paris (+21.24)
|
| 26 |
+
# 2. a (+17.69)
|
| 27 |
+
# 3. the (+17.51)
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## Files
|
| 31 |
+
|
| 32 |
+
| File | Size | Contents |
|
| 33 |
+
|------|------|---------|
|
| 34 |
+
| gate_vectors.bin | 1.66 GB | FFN gate projections [34 layers × 10240 × 2560] f16 |
|
| 35 |
+
| up_weights.bin | 1.66 GB | FFN up projections [34 × 10240 × 2560] f16 |
|
| 36 |
+
| down_weights.bin | 1.66 GB | FFN down projections [34 × 2560 × 10240] f16 |
|
| 37 |
+
| attn_weights.bin | 1.02 GB | Q/K/V/O + QK norms per layer, f16 |
|
| 38 |
+
| embeddings.bin | 1.25 GB | Token embeddings [262208 × 2560] f16 |
|
| 39 |
+
| norms.bin | 0.7 MB | RMSNorm gammas (4 per layer + final) f16 |
|
| 40 |
+
| tokenizer.json | 32 MB | HuggingFace tokenizer |
|
| 41 |
+
| index.json | 5 KB | Model config, layer info |
|
| 42 |
+
| **Total** | **7.29 GB** | |
|
| 43 |
+
|
| 44 |
+
## Extraction
|
| 45 |
+
|
| 46 |
+
Extracted using [LarQL](https://github.com/chrishayuk/larql) with `--level all --f16`:
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
larql extract-index google/gemma-3-4b-it -o gemma3-4b.vindex --level all --f16
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Verification
|
| 53 |
+
|
| 54 |
+
Output matches HuggingFace Transformers to 5 significant figures across all 34 layers.
|
| 55 |
+
Residual norms track exactly: Layer 34 = 67806.5 (HF: 67806).
|
| 56 |
+
|
| 57 |
+
Verified prompts: Paris, Jupiter, blue, Ulm, Pound — all correct.
|
| 58 |
+
|
| 59 |
+
## Credits
|
| 60 |
+
|
| 61 |
+
- Model: [Google Gemma 3](https://ai.google.dev/gemma)
|
| 62 |
+
- Decomposition: [LarQL](https://github.com/chrishayuk/larql) by Chris Hayuk
|
| 63 |
+
- Inference: [vindex-infer](https://github.com/cronos3k/vindex-infer)
|