Zero Labs
Industry News / AI

Yama Judges, Chitragupta Keeps the Records: Open-Source AI for Indian Languages

Source · Towards AI By Latent AI Labs

From the publisher’s feed, collected in the ZeroLabs newsroom.

Detect and redact Aadhaar, PAN and UPI data in Hindi, Hinglish and 11 more languages, then classify the text with your own labels. Two Apache-2.0 models that run locally.Source: Image by the author.TL;DRChitragupta (arunp0/chitragupta-pii-indic) is a free, open-source model that finds and masks personal data in Indian text: Aadhaar, PAN, voter ID, GSTIN, UPI ID, IFSC, card and bank numbers, phone numbers, emails, addresses, dates of birth and names, in 13 languages.Yama (arunp0/yama-indic) is its companion: a zero-shot classifier that answers plain-English questions about the same kinds of text ("is this a complaint?", "how urgent?") with labels you choose at run time.Both are Apache-2.0, run on your own CPU or GPU, and send nothing to an API.On my own synthetic test set, built to be hard (a different writer model, unseen ID formats), Chitragupta scores 0.959 exact-span F1. On two public benchmarks built by others, knowledgator’s GLiNER-PII beats it (0.966 and 0.965 against 0.954 and 0.878), and this post shows exactly where.Two questions every Indian product asks about a messageHere is a typical support message in India:“Hi, main Rohit Verma bol raha hoon. Mera Aadhaar XXXX XXXX 5246 hai aur UPI rohit.example@upi, refund isi pe bhej do. Call: 98765 43210”Before this message goes anywhere useful, two things have to happen:Someone has to decide what it is. A refund request? Urgent? Angry?Someone has to protect what is in it. A name, an Aadhaar number, a UPI ID and a phone number, none of which belongs in your logs, your analytics or a prompt sent to a third-party LLM.In Indian tradition, these are two different jobs. Yama is the judge who weighs what is placed before him and gives a verdict. Chitragupta, his record-keeper, writes down the details of every person’s life.I built one open model for each job. My previous article, Before You Invent a New Architecture, Try a Bigger Encoder, covered Yama. This one introduces Chitragupta and shows how the two work together.Mask first, then classify. Both models run locally. Source: Image by the author.Why Indian text needs its own PII modelPersonal data in Indian text is hard to catch with English tools, for four reasons:Mixed languages and scripts. People write Hindi in Devanagari, in Roman letters, and mixed with English in the same sentence. The same is true for Tamil, Bengali, Marathi and the rest.Native digits and spoken numbers. A phone number can arrive as ९८७६५४३२१०, as ৯৮৭৬৫…, or, in a call-centre transcript, as “nau aath saat chhe…”.Indian identifiers. Aadhaar, PAN, voter ID (EPIC), GSTIN, IFSC and UPI IDs each have their own formats, and people type them with spaces, dashes or dots in unpredictable places.Regulation. India’s Digital Personal Data Protection (DPDP) Rules, notified in November 2025, phase in over 18 months, and minimising the personal data you store is the simplest place to start.Most open PII models are English-first. Of the Indian-focused ones I tested, few cover Indian IDs, 13 languages and a permissive licence in one model.What Chitragupta doesChitragupta tags 18 types of personal data:People: person names, dates of birthContact: phone numbers, emails, addresses, pincodesGovernment IDs: Aadhaar, PAN, voter ID, passport, driving licence, vehicle registrationFinancial: UPI ID, bank account, IFSC, card number, GSTINTechnical: IP addressesIt works in Hindi, Hinglish, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Urdu, Odia and Indian English, in native scripts and in Roman letters, including native digits and numbers spoken out as words.One call to redact(). Dummy values: a masked Aadhaar and the common placeholder phone number. Source: Image by the author.Try it in a few lines# pip install torch transformers huggingface_hubimport sysfrom huggingface_hub import snapshot_downloadpath = snapshot_download("arunp0/chitragupta-pii-indic")sys.path.insert(0, path)from chitragupta import Chitraguptam = Chitragupta(path) # uses a GPU if available, otherwise CPUtext = ("Hi, main Rohit Verma bol raha hoon. Mera Aadhaar XXXX XXXX 5246 hai aur " "UPI rohit.example@upi, refund isi pe bhej do. Call: 98765 43210")print(m.redact(text))# Hi, main [PERSON] bol raha hoon. Mera Aadhaar [AADHAAR] hai aur UPI [UPI_ID], refund isi pe bhej do. Call: [PHONE]print(m.detect(text)[1])# {'label': 'AADHAAR', 'start': 49, 'end': 63, 'text': 'XXXX XXXX 5246'}detect() returns character offsets, so you can mask, hash or tokenise the values however your system needs. Ordinary numbers are left alone: m.detect("Order #4410293 delivered on 12/03/2025 at 10:30. Thanks!") returns nothing.On a multi-core server CPU it takes about 24 ms per short message in batches of 32. You can also try it in the box on the model page.How it works: a tagger plus checksumsChitragupta has two parts.1. A tagger. XLM-RoBERTa-large (560M parameters) fine-tuned to label every token as the beginning, inside or outside of a personal-data span.2. A small rule layer. Most Indian IDs carry their own proof of validity:Aadhaar numbers pass the Verhoeff checksum.Card numbers pass the Luhn checksum.GSTINs end in a check character.PAN, IFSC, voter ID, passport, vehicle and phone numbers have fixed formats.When the tagger sees an ID format it has never met, it often splits it into pieces with mixed labels. The rules glue the pieces back together and let the checksum decide the label. They never touch names or addresses, and they never relabel bank account or driving licence numbers, which have no checksum.The effect is large where it matters:Recall on unseen ID formats jumps from 0.793 to 0.959 with the rules. The x-axis starts at 0.7. Source: Image by the author.Exact-span F1: 0.876 for the model alone, 0.959 with the rules.Redaction F1 (were the right characters masked, whatever the label?): 0.984 alone, 0.987 with the rules.“Strict” means separator styles never seen in training. They turned out easier than unseen digit groupings, which is why that slice scores higher.So the rules mostly fix labels, not coverage. The model already finds almost every value; the checksum decides whether it is an Aadhaar or a card number. A small model cannot memorise every way people type a GSTIN, but a few lines of arithmetic can verify one.Training data without anyone’s real dataNo real personal data, production data or public PII dataset went into training. Every training text is synthetic:An open model wrote the text. Gemma 4 (26B-A4B, Apache-2.0) wrote 114,431 messages in 14 document types: support chats, WhatsApp chats, call-centre transcripts, KYC forms, emails, bank SMS, loan notes, courier instructions, HR onboarding, clinic messages, police complaints, rental agreements, social posts and scam messages.Code filled in the values. Gemma wrote placeholders such as {AADHAAR_1}. Code replaced them with generated values, checksum-valid where the ID has a checksum and rendered in many formats. Because code placed the IDs, contact details and names, those offsets are exact. Addresses are the exception: Gemma wrote and tagged them.A second open model checked the work. Qwen3.6 (Apache-2.0) read every text and flagged personal data that was not labelled; those texts were dropped.The lesson I would pass on: when you generate training data with an LLM, let code produce the labels. LLMs are good at writing realistic text and unreliable at reporting exact character offsets.How I tried not to fool myselfA model trained on synthetic data can score well simply by memorising its own generator. I built the test set to make that impossible:A different writer. Test texts were written by Qwen3.6 (a 4-bit AWQ build), not by Gemma.New document types. 10 types never seen in training: matrimonial profiles, admission forms, court notices, sale deeds, voice-note transcripts, cover letters, utility requests, lost-and-found notices, ration and pension applications, ride disputes.New ID formats. 65% of the ID values in the test set (2,386 of 3,650) use shapes no training example uses; 799 of them use separator styles never seen in training at all.New names. Names and addresses were written by the test model itself, not taken from the training name list.Label review. LLM agents reviewed a sample of 300 test texts and found a label error in 2.1% of spans. Re-scoring those 300 texts with corrected labels left their F1 at 0.960, so label noise does not explain the model’s mistakes. (This was an LLM review, not human verification.)The test set has 1,582 texts: 1,289 with personal data (6,123 spans) and 293 without. On the texts with no personal data, Chitragupta raised a false alarm on 2.4% (7 of 293).The benchmark said ship it. My own rule said no.After v1, I trained three v2 variants to fix two weaknesses the public benchmarks exposed: short one-line addresses and look-alike numbers such as timestamps and invoice IDs. On Ylemis, v2b jumped from 0.878 to 0.998. That gain is not independent: I designed v2’s data after reading the benchmark’s errors.Before looking at the results, I had written down a release rule: ship v2 only if it is not significantly worse than v1 on the fresh test set, overall or on driving licences.Paired bootstrap on the fresh test set. Orange intervals exclude zero. Source: Image by the author.Both variants I tested with the bootstrap significantly hurt driving licences (v2b −3.5, v2c −1.6 points), which fails the rule. v2c also lost 3.6 points on voter IDs, and the first v2 had already broken slash-separated IDs. Teaching the model that invoice numbers are not personal data made it more cautious about ID formats it had never seen. A missed voter ID leaks real data; a masked timestamp is only over-redaction. So I shipped v1, and the model card lists short addresses and look-alike numbers as known limits.How Chitragupta comparesI ran nine public alternatives on the same texts. To compare models with different label sets, the score is character-level redaction F1: whatever label a model uses, did it mask the personal-data characters?Redaction F1 on the fresh test set (axis from 0). This test set favours Chitragupta: it shares its label set and synthetic style. Source: Image by the author.Two caveats belong next to this chart:Home advantage. The test set is mine. It shares Chitragupta’s labels and synthetic style.Different designs. Several of these models tag things outside this label set (cities, organisations, dates), and some are meant to run behind a separate regex layer for IDs. Anything they mask outside our labels counts against them here.Where it losesOn two public benchmarks built by other people, Chitragupta is not the best model.IndiaPII-Bench (maskflow): knowledgator’s GLiNER-PII leads. The x-axis starts at 0.5. Source: Image by the author.Ylemis India PII: Chitragupta is seventh, held back by short addresses. The x-axis starts at 0.5. Out-of-scope entities are excluded for every model. Source: Image by the author.IndiaPII-Bench (maskflow): Chitragupta finds almost everything (recall 0.998), but its precision is 0.914. It tags chat speaker names the benchmark leaves unannotated, and it flags 48% of the benchmark’s planted look-alikes, such as timestamps and invoice numbers.Ylemis India PII: precision is 0.999, but address recall is only 0.22. Ylemis addresses are short one-line forms like “803 Park Street, Mysuru 486221”, and Chitragupta learned from longer postal addresses.If your text has short addresses, test both models on a sample of your own data before choosing. Benchmarks tell you where to look, not what to deploy.Known limitationsShort addresses are often missed, although the pincode next to them is usually caught.Look-alike numbers such as timestamps and order IDs can be flagged as bank accounts, cards or licences.Bank account numbers have no checksum, so they are the weakest ID label (F1 0.879).IP addresses score 1.000, but read that as optimistic: the IP rule was added after the fresh test showed IP as the weakest label.Long documents: on inputs of 450 to 1,400 tokens, F1 drops to 0.93–0.94, against 0.96 for the same texts one by one. Run it per message or paragraph.Synthetic evaluation only. No public human-labelled test set of Indian personal data exists, so real-world accuracy is unknown.Not a compliance tool by itself. Use it as one layer in a privacy process.Using Yama and Chitragupta togetherThe pipeline from the diagram fits in a few lines. Chitragupta masks the personal data; Yama decides what the message is about. Far less personal data reaches your logs or a hosted LLM.import thx01 # pip install thx01 (the open-source library Yama uses)yama = thx01.load("arunp0/yama-indic")safe = m.redact(text) # Chitragupta, from the snippet aboveout = yama.system_one(safe, { "topic": {"type": "choice", "instructions": "What is the customer writing about?", "criteria": {"refund": "asking for a refund", "failed_payment": "payment failed", "account": "login or account access", "other": None}}, "urgent": {"type": "noul", "instructions": "Does the customer need help urgently?"},})# log `safe` and `out`, never `text`Yama is a zero-shot classifier: you write the labels and questions at run time, with no fine-tuning. On 33 tasks it never trained on, across 19 languages, it scores 0.814 accuracy, against 0.770 for the next best zero-shot model I tested. I have not measured Yama’s accuracy on redacted text, so check it on your own data.Two lessons from building bothLet code write the labels. Use an LLM for realistic text and generated placeholders for the values, and most offsets come out exact.Write your release rule before you see the results. It is the only thing that stops a good benchmark number from talking you into a worse model.FAQWhat is Chitragupta? Chitragupta (arunp0/chitragupta-pii-indic) is an open-source PII detection and redaction model for Indian languages and Hinglish. It finds 18 types of personal data, including Aadhaar, PAN, UPI IDs, phone numbers and names, in 13 languages, and returns their character offsets.How do I mask Aadhaar or PAN numbers in Python? Download the model with snapshot_download("arunp0/chitragupta-pii-indic"), then call Chitragupta(path).redact(text). It replaces each value with its label, such as [AADHAAR] or [PAN]. The full snippet is above.Is it free for commercial use? Yes. The weights and code are Apache-2.0, the base model (XLM-RoBERTa-large) is MIT, and the training data was generated only with open-weights models (Gemma 4 and Qwen3.6, both Apache-2.0).Does it run offline? Yes. It runs locally on CPU or GPU with PyTorch, and no text leaves your machine.How is it different from Microsoft Presidio or regex rules? Regex finds well-formed IDs but misses names, addresses, unusual formats, native digits and spoken numbers. On the fresh test set, Chitragupta masked 99.0% of personal-data characters, against 55.0% for Presidio with its Indian recognisers.Does it make a system DPDP-compliant? No model does that on its own. It helps you keep personal data out of logs, analytics and LLM prompts, as one part of a privacy process.What is Yama? Yama (arunp0/yama-indic) is a companion zero-shot text classifier for the same 13 languages. You describe the labels in plain English, and it returns a calibrated probability for each, without fine-tuning.Try themChitragupta (PII detection and redaction): huggingface.co/arunp0/chitragupta-pii-indicYama (zero-shot classification): huggingface.co/arunp0/yama-indicHow Yama was built: Before You Invent a New Architecture, Try a Bigger EncoderIf you run Chitragupta on real text and it misses something, open a discussion on the model page. Real failure cases are the most useful thing anyone can send me.Chitragupta and Yama are independent personal releases by Arun Prabhakaran, licensed Apache-2.0.Drafted with help from Claude (Anthropic); experiments, numbers and final edits by the author.Yama Judges, Chitragupta Keeps the Records: Open-Source AI for Indian Languages was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.