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
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -30,6 +30,16 @@ GGUF quantizations of [sarvamai/sarvam-30b](https://huggingface.co/sarvamai/sarv
|
|
| 30 |
|
| 31 |
Created by applying [llama.cpp PR #20275](https://github.com/ggml-org/llama.cpp/pull/20275) which adds `sarvam_moe` architecture support to the converter and runtime.
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
## Files
|
| 34 |
|
| 35 |
| File | Quant | Size | BPW | Notes |
|
|
@@ -39,9 +49,7 @@ Created by applying [llama.cpp PR #20275](https://github.com/ggml-org/llama.cpp/
|
|
| 39 |
|
| 40 |
## How to use
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
### Quick start (patches llama.cpp automatically)
|
| 45 |
|
| 46 |
```bash
|
| 47 |
git clone https://github.com/mtr7x/sarvam-gguf.git
|
|
@@ -50,7 +58,9 @@ chmod +x patch_and_convert.sh
|
|
| 50 |
./patch_and_convert.sh
|
| 51 |
```
|
| 52 |
|
| 53 |
-
#
|
|
|
|
|
|
|
| 54 |
|
| 55 |
```bash
|
| 56 |
./llama-cli \
|
|
@@ -59,9 +69,19 @@ chmod +x patch_and_convert.sh
|
|
| 59 |
--ctx-size 2048 \
|
| 60 |
--temp 0.7 \
|
| 61 |
-no-cnv \
|
| 62 |
-
--prompt भारत के बारे में बताइए।
|
| 63 |
```
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
## Architecture
|
| 66 |
|
| 67 |
```
|
|
@@ -77,27 +97,28 @@ sarvamai/sarvam-30b
|
|
| 77 |
|
| 78 |
## Why this is needed
|
| 79 |
|
| 80 |
-
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.
|
| 81 |
|
| 82 |
## The domino chain
|
| 83 |
|
| 84 |
```
|
| 85 |
PR #20275 merges into llama.cpp ← pending
|
| 86 |
-
→ GGUF can be created ← this repo
|
| 87 |
-
→ Ollama updates its llama.cpp
|
| 88 |
-
→ Unsloth applies dynamic quants
|
| 89 |
-
→ ollama run sarvam-30b
|
| 90 |
```
|
| 91 |
|
| 92 |
## Runtime support
|
| 93 |
|
| 94 |
| Runtime | Status |
|
| 95 |
|---------|--------|
|
| 96 |
-
| vLLM |
|
| 97 |
-
| SGLang |
|
| 98 |
-
| llama.cpp |
|
| 99 |
-
|
|
| 100 |
-
|
|
|
|
|
| 101 |
|
| 102 |
## Credits
|
| 103 |
|
|
|
|
| 30 |
|
| 31 |
Created by applying [llama.cpp PR #20275](https://github.com/ggml-org/llama.cpp/pull/20275) which adds `sarvam_moe` architecture support to the converter and runtime.
|
| 32 |
|
| 33 |
+
> **Will this work with Ollama / LM Studio / Jan?**
|
| 34 |
+
>
|
| 35 |
+
> **Not yet.** These tools bundle mainline llama.cpp, which does not recognize `sarvam_moe`. You will see:
|
| 36 |
+
> ```
|
| 37 |
+
> error loading model: unknown model architecture: 'sarvam_moe'
|
| 38 |
+
> ```
|
| 39 |
+
> 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.
|
| 40 |
+
>
|
| 41 |
+
> To build a patched llama.cpp, use [mtr7x/sarvam-gguf](https://github.com/mtr7x/sarvam-gguf).
|
| 42 |
+
|
| 43 |
## Files
|
| 44 |
|
| 45 |
| File | Quant | Size | BPW | Notes |
|
|
|
|
| 49 |
|
| 50 |
## How to use
|
| 51 |
|
| 52 |
+
### Option 1: Patch llama.cpp automatically (recommended)
|
|
|
|
|
|
|
| 53 |
|
| 54 |
```bash
|
| 55 |
git clone https://github.com/mtr7x/sarvam-gguf.git
|
|
|
|
| 58 |
./patch_and_convert.sh
|
| 59 |
```
|
| 60 |
|
| 61 |
+
This clones llama.cpp, applies PR #20275, builds it, and you're ready to run.
|
| 62 |
+
|
| 63 |
+
### Option 2: Run with patched llama.cpp directly
|
| 64 |
|
| 65 |
```bash
|
| 66 |
./llama-cli \
|
|
|
|
| 69 |
--ctx-size 2048 \
|
| 70 |
--temp 0.7 \
|
| 71 |
-no-cnv \
|
| 72 |
+
--prompt "भारत के बारे में बताइए।"
|
| 73 |
```
|
| 74 |
|
| 75 |
+
### What does NOT work (yet)
|
| 76 |
+
|
| 77 |
+
| Tool | Status | Why |
|
| 78 |
+
|------|--------|-----|
|
| 79 |
+
| Ollama | `unknown model architecture` | Waiting on PR #20275 merge |
|
| 80 |
+
| LM Studio | `unknown model architecture` | Waiting on PR #20275 merge |
|
| 81 |
+
| Jan | `unknown model architecture` | Waiting on PR #20275 merge |
|
| 82 |
+
| llama.cpp (mainline) | `unknown model architecture` | PR #20275 not yet merged |
|
| 83 |
+
| llama.cpp (patched) | Works | This is what you need |
|
| 84 |
+
|
| 85 |
## Architecture
|
| 86 |
|
| 87 |
```
|
|
|
|
| 97 |
|
| 98 |
## Why this is needed
|
| 99 |
|
| 100 |
+
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).
|
| 101 |
|
| 102 |
## The domino chain
|
| 103 |
|
| 104 |
```
|
| 105 |
PR #20275 merges into llama.cpp ← pending
|
| 106 |
+
→ GGUF can be created ← done (this repo)
|
| 107 |
+
→ Ollama updates its llama.cpp ← blocked
|
| 108 |
+
→ Unsloth applies dynamic quants ← blocked
|
| 109 |
+
→ ollama run sarvam-30b ← blocked
|
| 110 |
```
|
| 111 |
|
| 112 |
## Runtime support
|
| 113 |
|
| 114 |
| Runtime | Status |
|
| 115 |
|---------|--------|
|
| 116 |
+
| vLLM | PR #33942 merged |
|
| 117 |
+
| SGLang | Works |
|
| 118 |
+
| llama.cpp (patched) | Works (PR #20275) |
|
| 119 |
+
| llama.cpp (mainline) | Blocked — PR pending |
|
| 120 |
+
| Ollama | Blocked on llama.cpp |
|
| 121 |
+
| LM Studio | Blocked on llama.cpp |
|
| 122 |
|
| 123 |
## Credits
|
| 124 |
|