Downloads · 30 days
122
5% of all-time downloads
Reinforce-ai/sarvam-30b-Spiral
sarvam-30b-Spiral is a text generation model from Reinforce-ai. Use it when you need the model to write or continue text. It is set up for gguf. The card lists the license as apache-2.0.
Downloads · 30 days
122
5% of all-time downloads
All-time downloads
2.4K
Public
Repo size
18.4 GB
Likes
0
Public
Click a slice to open those files.
.gguf18.3 GB · 100%
From the Hugging Face model README
Release v1.0 — Spiral_Q4 scheme
Calibration-free INT4 compression of Sarvam-30B that beats the bf16 baseline. Spiral_Q4 lands at wikitext-2 PPL 11.6398 — measurably better than the bf16 reference (11.8490) and better than Sarvam AI's official Q4_K_M imatrix-calibrated GGUF (11.9627) — without calibration data, without fine-tuning, without representative samples. Production-stable on Apple Silicon (Metal). CUDA build supported (validation pending).
This is the v1.0 release of Spiral compression applied to sarvamai/sarvam-30b — the 30B Mixture-of-Experts model from Sarvam AI, trained for 22 Indian languages plus English. Architecture: sarvam_moe (registered in llama.cpp as bailingmoe2).
Measured with spiral fork llama.cpp llama-perplexity, ctx=512:
| Method | bpw | Calibration data | NLL (nats/token) | PPL | Gap vs bf16 |
|---|---|---|---|---|---|
| bf16 (reference, 64.3 GB) | 16.00 | — | 2.4723 | 11.8490 ± 0.10 | 0 |
| Q4_K_M (Sarvam team, imatrix English) | ~4.50 | English wikitext | 2.4818 | 11.9627 ± 0.10 | +0.0096 |
| Spiral_Q4 (this model) | 4.56 | None | 2.4541 | 11.6398 ± 0.10 | −0.018 |
Spiral_Q4 is the first calibration-free quantization scheme on Sarvam-30B that measurably beats the bf16 baseline on wikitext-2 perplexity, at comparable bit budget to Q4_K_M. Both negative-gap measurements (vs bf16) and outperformance over imatrix Q4_K_M (which calibrates on English text) are within ±0.10 PPL noise; reproducible from the artifact + sidecar in this repository.
Not measured in v1.0. Sarvam-30B's design center is 22 Indian languages, and wikitext-2 is English-only. Indic-specific perplexity (Sangraha or similar) is on the roadmap and is expected to be a strength of the calibration-free approach — Q4_K_M's imatrix is calibrated on English text, which may bias it against Indic activations.
The same (.gguf, .spiralcb) pair runs on Metal (Apple Silicon) and CUDA (NVIDIA). Generated text on identical prompts is semantically equivalent across platforms; minor token-level drift comes from fp16 ordering differences in the deep stack, same as for stock K-quant GGUFs.
CUDA validation in this release: build verified on RTX PRO 6000 Blackwell + H100. Inference throughput numbers pending; expect 3-5× Metal decode rates based on prior Spiral CUDA work on similar-sized MoE models.
| Configuration | Decode | Prefill |
|---|---|---|
| f16 KV + flash attention | ~30 tok/s | 70-470 tok/s (cache-state dependent) |
Validation runs pending; numbers will be published in v1.1.
Sarvam-30B weights + 8K context KV cache:
| Method | Total |
|---|---|
| Spiral_Q4 | ~19 GB |
| Q4_K_M | ~19 GB |
| bf16 | ~62 GB |
Fits comfortably in 24 GB of unified memory / VRAM for the 8K-context shipping config. The 30B MoE has only 4 KV heads (heavy GQA), so KV cache stays small even at long contexts.
| File | Size |
|---|---|
sarvam-30b-Spiral_Q4.gguf | 18.32 GB |
sarvam-30b-Spiral_Q4.spiralcb | 78 MB |
Both files are required. The .spiralcb sidecar is loaded by the Spiral runtime alongside the GGUF — it contains the per-tensor rotation matrices and Lloyd-Max codebooks that the kernel uses to decode INT4 weights.
Spiral ships with three wrappers — spiral-download, spiral-chat, spiral-serve — that handle the model fetch and inference flags.
brew install reinforceai/spiral/spiral
The brew formula installs the Spiral fork of llama.cpp plus the wrappers. Standard upstream llama.cpp will not load Spiral-compressed models.
spiral-chat --model sarvam-30b-spiral
First run auto-downloads the GGUF and codebook to ~/.spiral/models/sarvam-30b-spiral/. Subsequent runs use the local cache.
spiral-chat --model sarvam-30b-spiral \
--prompt "भारत के बारे में कुछ बताओ"
spiral-serve --model sarvam-30b-spiral --port 8080
curl http://localhost:8080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"messages": [{"role": "user", "content": "Who are you?"}]
}'
For CUDA, or to develop against the framework:
git clone https://github.com/ReinforceAI/spiral
cd spiral
cmake -B build -DGGML_METAL=ON # or -DGGML_CUDA=ON
cmake --build build -j --target llama-cli llama-perplexity llama-server
Then run llama-cli directly with SPIRAL_CODEBOOK_PATH set to the codebook file:
SPIRAL_CODEBOOK_PATH=sarvam-30b-Spiral_Q4.spiralcb \
./build/bin/llama-cli \
-m sarvam-30b-Spiral_Q4.gguf \
-ctk f16 -ctv f16 -fa on \
--jinja -cnv -c 8192 --temp 0.7 --top-p 0.95
Recommended sampling params (temp=0.7, top-p=0.95) match Sarvam AI's published defaults for Sarvam-30B.
Spiral applies a learned geometric transform to weight matrices before scalar quantization. The transform produces weight distributions that are far more amenable to low-bit encoding than the original basis — outlier channels (the primary source of quantization error) are eliminated analytically rather than handled with calibration data.
No calibration data is required. The artifact is a deterministic function of the model weights. Anyone with the upstream weights reconstructs bit-identical files. The calibration-free property buys reproducibility, domain neutrality (no English bias from a wikitext calibration corpus), and audit-friendliness for multilingual deployment.
Source: github.com/ReinforceAI/spiral
llama.cpp does not load Spiral models — the SPIRAL_INT4 ggml type and rotation hooks live in the Spiral fork.llama-perplexity, ctx=512convert_hf_to_gguf.py from the upstream HF weightsReproduction recipe and scripts: github.com/ReinforceAI/spiral
@misc{spiral2026,
title={Spiral: Geometric Compression of Rotated Transformers},
author={Deshwal, Viraj},
year={2026},
publisher={ReinforceAI},
url={https://github.com/ReinforceAI/spiral}
}