Instructions to use mtrajan/sarvam-30b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mtrajan/sarvam-30b-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf mtrajan/sarvam-30b-GGUF:F16 # Run inference directly in the terminal: llama cli -hf mtrajan/sarvam-30b-GGUF:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mtrajan/sarvam-30b-GGUF:F16 # Run inference directly in the terminal: llama cli -hf mtrajan/sarvam-30b-GGUF:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mtrajan/sarvam-30b-GGUF:F16 # Run inference directly in the terminal: ./llama-cli -hf mtrajan/sarvam-30b-GGUF:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mtrajan/sarvam-30b-GGUF:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf mtrajan/sarvam-30b-GGUF:F16
Use Docker
docker model run hf.co/mtrajan/sarvam-30b-GGUF:F16
- LM Studio
- Jan
- vLLM
How to use mtrajan/sarvam-30b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mtrajan/sarvam-30b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mtrajan/sarvam-30b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mtrajan/sarvam-30b-GGUF:F16
- Ollama
How to use mtrajan/sarvam-30b-GGUF with Ollama:
ollama run hf.co/mtrajan/sarvam-30b-GGUF:F16
- Unsloth Studio
How to use mtrajan/sarvam-30b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mtrajan/sarvam-30b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mtrajan/sarvam-30b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mtrajan/sarvam-30b-GGUF to start chatting
- Pi
How to use mtrajan/sarvam-30b-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mtrajan/sarvam-30b-GGUF:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mtrajan/sarvam-30b-GGUF:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use mtrajan/sarvam-30b-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mtrajan/sarvam-30b-GGUF:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "mtrajan/sarvam-30b-GGUF:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use mtrajan/sarvam-30b-GGUF with Docker Model Runner:
docker model run hf.co/mtrajan/sarvam-30b-GGUF:F16
- Lemonade
How to use mtrajan/sarvam-30b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mtrajan/sarvam-30b-GGUF:F16
Run and chat with the model
lemonade run user.sarvam-30b-GGUF-F16
List all available models
lemonade list
- Hermes Agent
How to use mtrajan/sarvam-30b-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mtrajan/sarvam-30b-GGUF:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mtrajan/sarvam-30b-GGUF:F16
Run Hermes
hermes
- Atomic Chat
Sarvam-30B GGUF
GGUF quantizations of sarvamai/sarvam-30b — the first publicly available GGUF for this model.
Created by applying llama.cpp PR #20275 which adds sarvam_moe architecture support to the converter and runtime.
Will this work with Ollama / LM Studio / Jan?
Not yet. These tools bundle mainline llama.cpp, which does not recognize
sarvam_moe. You will see:error loading model: unknown model architecture: 'sarvam_moe'This GGUF requires a patched llama.cpp (with PR #20275 applied) until that PR merges into mainline. Once it does, Ollama / LM Studio / Jan will work automatically on their next update.
To build a patched llama.cpp, use mtr7x/sarvam-gguf.
Files
| File | Quant | Size | BPW | Notes |
|---|---|---|---|---|
| sarvam-30b-q4_k_m.gguf | Q4_K_M | 19 GB | 4.87 | Recommended — good balance of quality and size |
| sarvam-30b-f16.gguf | F16 | 60 GB | 16.00 | Full precision, use for further quantization |
How to use
Option 1: Patch llama.cpp automatically (recommended)
git clone https://github.com/mtr7x/sarvam-gguf.git
cd sarvam-gguf
chmod +x patch_and_convert.sh
./patch_and_convert.sh
This clones llama.cpp, applies PR #20275, builds it, and you're ready to run.
Option 2: Run with patched llama.cpp directly
./llama-cli \
--model sarvam-30b-q4_k_m.gguf \
--n-gpu-layers 99 \
--ctx-size 2048 \
--temp 0.7 \
-no-cnv \
--prompt "भारत के बारे में बताइए।"
What does NOT work (yet)
| Tool | Status | Why |
|---|---|---|
| Ollama | unknown model architecture |
Waiting on PR #20275 merge |
| LM Studio | unknown model architecture |
Waiting on PR #20275 merge |
| Jan | unknown model architecture |
Waiting on PR #20275 merge |
| llama.cpp (mainline) | unknown model architecture |
PR #20275 not yet merged |
| llama.cpp (patched) | Works | This is what you need |
Architecture
sarvamai/sarvam-30b
├── model_type: sarvam_moe
├── 30B params, 2.4B active
├── 19 layers (1 dense + 18 MoE)
├── 128 experts + 1 shared, top-6, sigmoid routing
├── 64 query heads, 4 KV heads, head_dim=64
├── vocab_size: 262,144 (Indic-optimized)
└── Apache 2.0
Why this is needed
Sarvam open-sourced 30B and 105B under Apache 2.0, but mainline llama.cpp doesn't recognize model_type: "sarvam_moe" — the converter exits immediately. Contrary to what you might expect, sigmoid routing is already supported in llama.cpp (used by GLM4 and others). The actual blocker is a missing class registration + tensor mappings + C++ graph builder — all provided by PR #20275 (387 lines).
The domino chain
PR #20275 merges into llama.cpp ← pending
→ GGUF can be created ← done (this repo)
→ Ollama updates its llama.cpp ← blocked
→ Unsloth applies dynamic quants ← blocked
→ ollama run sarvam-30b ← blocked
Runtime support
| Runtime | Status |
|---|---|
| vLLM | PR #33942 merged |
| SGLang | Works |
| llama.cpp (patched) | Works (PR #20275) |
| llama.cpp (mainline) | Blocked — PR pending |
| Ollama | Blocked on llama.cpp |
| LM Studio | Blocked on llama.cpp |
Credits
- sarvamai for open-sourcing Sarvam-30B under Apache 2.0
- sumitchatterjee13 for llama.cpp PR #20275
- Conversion pipeline: mtr7x/sarvam-gguf
Read the full analysis: Sarvam. Open is not sovereign
- Downloads last month
- 15
4-bit
16-bit
Model tree for mtrajan/sarvam-30b-GGUF
Base model
sarvamai/sarvam-30b