Text Generation
Transformers
Safetensors
sarvam_moe
pruning
knowledge-distillation
mixture-of-experts
vllm
conversational
custom_code
Instructions to use anandpranav/sarvam-20pct-distilled-resilient2026 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anandpranav/sarvam-20pct-distilled-resilient2026 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anandpranav/sarvam-20pct-distilled-resilient2026", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("anandpranav/sarvam-20pct-distilled-resilient2026", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anandpranav/sarvam-20pct-distilled-resilient2026 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anandpranav/sarvam-20pct-distilled-resilient2026" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anandpranav/sarvam-20pct-distilled-resilient2026", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/anandpranav/sarvam-20pct-distilled-resilient2026
- SGLang
How to use anandpranav/sarvam-20pct-distilled-resilient2026 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "anandpranav/sarvam-20pct-distilled-resilient2026" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anandpranav/sarvam-20pct-distilled-resilient2026", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "anandpranav/sarvam-20pct-distilled-resilient2026" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anandpranav/sarvam-20pct-distilled-resilient2026", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use anandpranav/sarvam-20pct-distilled-resilient2026 with Docker Model Runner:
docker model run hf.co/anandpranav/sarvam-20pct-distilled-resilient2026
Sarvam-30B โ 20% Pruned + Knowledge Distilled (26.4B Parameters)
Overview
This repository contains a deployment-ready 20% pruned and knowledge-distilled version of Sarvam-30B (Mixture-of-Experts) prepared for the Resilient AI Challenge 2026 (Text-to-Text Track).
The model was compressed using structured expert pruning followed by Knowledge Distillation (KD) to recover accuracy lost during pruning.
Performance Summary
| Metric | Baseline (32.15B) | This Model (26.4B) | Difference |
|---|---|---|---|
| Accuracy | 95.12% | 85.37% | -9.75% |
| Relative Accuracy | 100% | 89.75% | -10.25% |
| Throughput | 7.72 tok/s | 7.90 tok/s | +2.3% faster |
| Latency | 129.78 ms/tok | 126.74 ms/tok | -2.3% lower |
| Energy (41 samples) | 83.25 Wh | 81.30 Wh | -2.4% less |
| Disk Size | 61.44 GB | 49.14 GB | -20.0% smaller |
| Parameters | 32.15B | 26.4B | -18.0% fewer |
Evaluation Dataset: 41 Indic Language Samples (Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati)
Compression Method
Step 1 โ Structured Expert Pruning (20%)
- Removed 20% of MoE expert layers (578 experts removed)
- Pruning based on expert activation frequency
- Result: 32.15B to 26.4B parameters
Step 2 โ Knowledge Distillation
- Teacher: Original Sarvam-30B (32.15B)
- Student: 20% pruned Sarvam (26.4B)
- 8 epochs of Knowledge Distillation
- 280M LoRA parameters (1.13% of model)
- Training loss reduced by 53%
- Accuracy recovered: +2.44% (from 82.93% pruned-only to 85.37%)
Inference
Launch with vLLM
vllm serve --config vllm_config.yaml
- Downloads last month
- 203
Model tree for anandpranav/sarvam-20pct-distilled-resilient2026
Base model
sarvamai/sarvam-30b