I was on a call with my long-time friend and ex-colleague Bob, who is now retired after his super long successful career in tech. We used to work together a lot and I absolutely had the best time working with him. We still have a monthly catch up call scheduled to make sure we keep in touch. Bob is a great story teller. Anyway, in the call, he showed me how he had set up a local LLM for a specific use. I knew then and there that I wanted to set one up for myself for Sanskrit.
I work in the AI space, but more on the consumer and extensibility side. I thought this experiment would help me understand models, importance of hardware, memory, context length, system prompt etc more deeply. I don't claim this article is expert guidance. But as a curious learner, this is where I'd start if I wanted a Sanskrit translation model running on my local machine without a subscription or internet, with data I provide never leaving my machine.
What you’ll need:
LM Studio, an app that lets you run AI models on your own computer.
MITRA-Qwen3.5-9B-IT, a model trained on Sanskrit.
At least 16 GB of memory and about 10 GB of free disk space
Always check the model’s translations against trusted sources and teachers.
Why this model?
My first version of this helper ran on Google’s Gemma 4 31B, a huge general-purpose model that claims to support more than 140 languages. Its translations were decent, but it kept failing the grammar questions in my test kit. That makes sense, because general models see very little Sanskrit during training. I learned the hard way that a model that has actually read Sanskrit beats a big general one, so I chose this.
Two caveats before you start with this model:
Its training texts are Buddhist. The Hindu scriptures or works like Kālidāsa sit outside the model’s specialist area unless you provide them.
It was trained for translation, not Pāṇinian grammar. Don’t assume it can cite sūtras reliably.
Let's now start the tutorial. This may seem very tutorialish from here on. As someone who writes workshops and labs for a living, I don't know what other format works, so forgive me for not bringing any personality into the writing from here on 😄. Also, I have used AI heavily to format the steps so it's easier for folks at any level to follow along.
Step 1: Install LM Studio
Download LM Studio for your system from lmstudio.ai/download, install it, and skip the starter model it offers.
Get LM Studio, not LM Studio Bionic. Bionic is a separate agent app, and it doesn’t have the preset settings this guide uses.
Step 2: Download the model
Open LM Studio and in the navigation pane, select Model Search.
Search for mitra-qwen35-it-GGUF.
Click Download.
These files are an unofficial conversion of Dharmamitra’s model. If you share results, credit dharmamitra.org. That's the last step that needs internet. From now on, the model works fully offline.
Step 3: Set up the Sanskrit helper
A system prompt is a set of instructions the model reads before every question from the user. LM Studio saves it with its settings, calling it a preset.
In the Chat tab, open the model selector (Pick a model). Select mitra model, but before loading it, set Context Length to 32768 (or 24576 if you get memory warnings). Then select Load Model.
Open the settings sidebar on the right and paste this into System Prompt:
You are a careful Sanskrit scholar and teacher. Accept input in Devanagari, IAST, Harvard-Kyoto, SLP1, or ITRANS.
Script rule: write all Sanskrit in Devanagari, including words, forms, dhātus, grammatical terms, sandhi names, synonyms, and sūtra texts. Explanations are in English. Use IAST only where step 1 asks for it.
Rules that come first:
- Check the question’s premise before answering. If a text, verse, or sūtra may not exist, say so plainly and stop. Never answer a different question instead.
- The अष्टाध्यायी has 8 अध्यायs, each with 4 पादs. A valid sūtra number is A.P.N, where A is 1–8 and P is 1–4. If a number falls outside this, say the sūtra does not exist and stop.
- When citing a पाणिनि sūtra, give its number and its text in Devanagari, for example 1.1.1 वृद्धिरादैच्. If you cannot give the text, do not give the number.
- If a form, reading, or word is uncertain, say so and give the alternatives.
Example:
User: Explain sūtra 9.1.1 of the Aṣṭādhyāyī.
Assistant: That sūtra does not exist. The अष्टाध्यायी has only eight अध्यायs, so no number begins with 9. Did you mean a sūtra from अध्याय 1–8?
For every translation, in either direction, answer in this order:
1. वाक्यम्: the Sanskrit sentence in Devanagari with sandhi applied as written (with IAST below it). For Sanskrit input, this is the user’s text; for English input, it is your translation.
2. पदच्छेदः: the same sentence with every word separated in its full form, without sandhi.
3. Word formation table: पदम् | प्रातिपदिकम् or धातुः (with गणः) | प्रत्ययः | form (विभक्तिः, वचनम्, लिङ्गम्; or लकारः, पुरुषः, वचनम्, पदम्) | meaning. For each समासः, give its type and विग्रहः.
4. सन्धिः explained: for each join, show the two sounds that meet, the result, and the sandhi type (for example यण्, गुणः, वृद्धिः, सवर्णदीर्घः, विसर्गसन्धिः).
5. Grammar notes: why each case, tense, and voice is used, and the अन्वयः (prose word order) if the text is verse.
6. Translation: literal, then natural English.
7. Classical alternatives: for the 2–3 key words, give 2–4 classical synonyms, each with a note on its tone (poetic, elevated, everyday, technical). Then give one or two alternative versions of the whole sentence in a more poetic, काव्य style, with a note on the effect. Give only words you are confident are attested in classical literature, and mark any you are unsure of.
For grammar questions: explain clearly with examples, with all Sanskrit in Devanagari.In the same sidebar, set Thinking: on under Reasoning. The model reasons before it answers, which helps with analysis. Save it all as a preset called Sanskrit v1(or any name you like)
Step 4: Test it before you trust it
Run each prompt below in a new chat with the Sanskrit v1 preset, take the first answer, and check what it gets right. You may provide अष्टाध्यायी text as file attachment for T3 and T4.
T4 is a trap 🫠
T1. Verse translation analysis
Translate कर्मण्येवाधिकारस्ते मा फलेषु कदाचन
All seven parts, in order, with all Sanskrit in Devanagari
“Your right is to action alone, never to its fruits”
T2. A simple sentence translation
Translate रामो वनं गच्छति
All seven parts, in order, with all Sanskrit in Devanagari
“Rāma goes to the forest.”
T3. Real sūtras for System prompt check
Which Pāṇini sūtras define vṛddhi and guṇa? Give the sūtra numbers and text.
1.1.1 वृद्धिरादैच्
1.1.2 अदेङ् गुणः
T4. The sūtra trap
Explain sūtra 9.4.12 of the Aṣṭādhyāyī.
Says it doesn’t exist: the अष्टाध्यायी has only eight अध्यायs. This is a good test for hallucination from the model.
And that’s all folks 😀. If you can, invest in better hardware for better results. If you find a better local model for Sanskrit available in LM Studio, comment and let me know. I will try and keep this blog updated as I explore more in this space.



Rabia, running a Sanskrit model on your own laptop, private and offline, is one of the best arguments I've seen for personal, on-device intelligence: the language stays with the person, not with a rented stack. I'd love to hear how the setup is holding up.
If you want to talk about it live, we're hosting PONDcast tonight, Thursday Dec 3 at 6:30 PM PT, voice on the POND Discord, and speakers are welcome:
https://discord.gg/Z4kBMpMkH7?event=1560428164763877527
That’s a great post Rabia and very useful for all. I had previously tried mitra-qwen35-translate-GGUF which was okayish. Will try now this one too. Thanks for sharing 🙏🏾 🙏🏾