1. Introduction
Sarvam-M is an open-source, multilingual, hybrid-reasoning language model built by Sarvam AI — one of India's most ambitious AI labs working towards a sovereign AI ecosystem for the country.
Built on top of Mistral Small (24B parameters), Sarvam-M has been post-trained specifically for Indian languages with remarkable results:
- +20% improvement on Indian language benchmarks
- +21.6% enhancement on math benchmarks
- +17.6% boost on programming benchmarks
- +86% improvement on romanized Indian language GSM-8K (math in Hinglish/regional languages)
In this codelab, you'll learn to use Sarvam-M through Sarvam's hosted API — from basic chat to building a bilingual Q&A application that understands Hindi, Marathi, Tamil, and more.
- Python 3.8+ installed
- A free Sarvam AI API key (we'll set this up in Step 2)
- Basic familiarity with Python and APIs
- ~30 minutes of your time
Most LLMs are English-first. Sarvam-M is one of the few open-source models specifically optimized for Indian languages — including code-mixed text (Hinglish, Marathlish) that 500M+ people actually use daily. If you're building for India, this model is essential.