CHALKESAHIL.AI · BUILD THIS
Bol Ke Bharo
Hindi mein bolo, English form bhar jaaye. A web app that listens to someone speak Hindi or Hinglish and fills an English PDF form for them.
Data flow
- Hindi voice. Browser
MediaRecorderrecords the user. - Speech to text. Sarvam AI speech-to-text for Hindi and other Indian languages (its speech-to-text-and-translate mode returns English directly). ElevenLabs Scribe or OpenAI
gpt-4o-transcribework as fallbacks. - LLM fields. Any LLM with JSON schema output turns the transcript into one English value per form field.
- Filled PDF.
pdf-libwrites the values into the form and flattens it for download.
Stack
- Next.js + TypeScript
MediaRecorderin the browser for audio- Sarvam AI speech-to-text (fallback: ElevenLabs Scribe or OpenAI
gpt-4o-transcribe) - Any LLM with JSON schema output
pdf-libto read and fill the form
How the pieces connect
Load a fillable PDF, list its fields with form.getFields() and field.getName(), and build a JSON schema with a plain description per field. Record speech, transcribe it, and send the transcript plus the schema to the LLM. The LLM returns English values, null for anything not said, and follow-up questions in simple Hindi for the blanks. Ask those by voice, then show a review screen with each English value above the original Hindi phrase. Fill with form.getTextField(name).setText(value), call form.flatten(), and download.
The hard part: names
Devanagari to Roman script has many valid spellings. In our test run the model wrote "Sunita Sharma" and listed Sunitha, Suneeta and Sunita Sarma as equally valid. A form has to match the ID card exactly.
- Never let the model guess a name or an ID number. Mark those fields
needs_confirmationand make the user confirm or type them from the ID card. - Never invent missing values. Return
nulland ask. - Second trap: many government forms are scanned images, not fillable PDFs. v1 picks one fillable form. v2 places text at fixed coordinates with
page.drawText.
Weekend v1
- Saturday. One fillable PDF, voice to filled fields.
- Sunday. Follow-up questions for blank fields and the review screen.
What a real run looked like
We spoke one Hindi sentence (name, age, address, no phone) and ran it through the pipeline.
- Transcript: मेरा नाम सुनीता शर्मा है। मेरी उम्र 52 साल है। मैं पुणे में रहती हूँ। बारा गुलमोहर colony शांति नगर में। phone number मैं बाद में बताऊँगी।
- Fields: full name "Sunita Sharma" (needs confirmation), age "52", address "12 Gulmohar Colony, Shanti Nagar", city "Pune", phone
null. - Follow-up question: कृपया अपना मोबाइल नंबर बताइए।
All personal data in this example is made up.
pdf-lib gotcha we hit. Values set on a form created in the same session vanished after flatten(). Loading the saved PDF with PDFDocument.load, then calling setText, form.updateFieldAppearances(font) and flatten() fixed it. With a real downloaded form you load it anyway.
Costs
Sarvam lists speech-to-text at about Rs 30 per hour of audio, billed per second (docs.sarvam.ai), so a two-minute form costs about a rupee. LLM cost per form is a fraction of that. Prices are ballpark, check current pricing.
Personal data
Forms hold names, addresses and ID numbers. Store nothing on the server, process in memory, and say so on the first screen.
Claude Code starter prompt
Build a web app called Bol Ke Bharo. Stack: Next.js + TypeScript, Sarvam AI speech-to-text (OpenAI
gpt-4o-transcribe as a fallback), an LLM with JSON schema output, and pdf-lib.
1. The user uploads a fillable PDF form. List its fields with pdf-lib (form.getFields(), getName()) and build a JSON
schema with a short English description for each field. Let the user edit the descriptions once per form.
2. Record the user speaking Hindi or Hinglish with MediaRecorder and send the audio to speech-to-text.
3. Send the transcript and the schema to the LLM. Rules: translate values to English, transliterate addresses into
Roman script, never invent a value, return null for anything not said, and return follow-up questions in simple
Hindi for the null fields. Names, dates of birth and ID numbers are returned with needs_confirmation: true.
4. Ask the follow-up questions one at a time and let the user answer by voice.
5. Review screen: every field in English with the original Hindi phrase under it. Fields with needs_confirmation
must be confirmed or typed by the user before download.
6. Fill with form.getTextField(name).setText(value), flatten the form, and download the PDF.
Store nothing on the server. Ask me for API keys and never hardcode them. Include a sample fillable PDF with 8 fields.