<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ragasudha</title>
    <description>The latest articles on DEV Community by Ragasudha (@ragasudha).</description>
    <link>https://dev.to/ragasudha</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3935768%2F2708862c-a63b-4490-bc88-acb6b7e531bd.png</url>
      <title>DEV Community: Ragasudha</title>
      <link>https://dev.to/ragasudha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ragasudha"/>
    <language>en</language>
    <item>
      <title>Vayal AI: Tamil Voice + Vision Crop Advisory for Farmers Using Gemma 4</title>
      <dc:creator>Ragasudha</dc:creator>
      <pubDate>Sun, 17 May 2026 11:55:23 +0000</pubDate>
      <link>https://dev.to/ragasudha/vayal-ai-tamil-voice-vision-crop-advisory-for-farmers-using-gemma-4-5534</link>
      <guid>https://dev.to/ragasudha/vayal-ai-tamil-voice-vision-crop-advisory-for-farmers-using-gemma-4-5534</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Millions of farmers in Tamil Nadu speak Tamil as their primary language. Agricultural advice — government portals, extension services, online resources — is mostly in English. When a crop fails, a farmer shouldn't need to navigate a language barrier to find out why.&lt;br&gt;
Vayal AI (வயல் = field in Tamil) is a voice and vision crop advisory tool for Tamil-speaking farmers. A farmer speaks a question in Tamil, optionally photographs a diseased leaf, and gets practical farming advice back in Tamil. No English required. No app to install. No subscription. Just a question, in the language they speak, about the crops they grow.&lt;br&gt;
The longer vision is bigger than a CLI tool — a system that works on a cheap device or a Raspberry Pi in a village with no internet, no data plan, and no ongoing cost. A tool an NGO or a state agricultural department can deploy freely, forever, without paying anyone per query.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Demo is recorded as a video and it can be accessed here -   &lt;iframe src="https://www.youtube.com/embed/Z9ldtbP9-_0"&gt;
  &lt;/iframe&gt;
&lt;br&gt;
The demo shows how you can query with text, image or audio (by directly speaking)&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rragasudha/vayal-ai" rel="noopener noreferrer"&gt;vayal-ai-source-code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Four ways to run it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Type a question in Tamil&lt;/span&gt;
python main.py &lt;span class="nt"&gt;--text&lt;/span&gt; &lt;span class="s2"&gt;"நெல் செடியில் என்ன நோய்?"&lt;/span&gt;

&lt;span class="c"&gt;# Speak into your laptop mic&lt;/span&gt;
python main.py &lt;span class="nt"&gt;--listen&lt;/span&gt;

&lt;span class="c"&gt;# Pass a pre-recorded audio file&lt;/span&gt;
python main.py &lt;span class="nt"&gt;--audio&lt;/span&gt; question.wav

&lt;span class="c"&gt;# Any of the above + a leaf photo for visual diagnosis&lt;/span&gt;
python main.py &lt;span class="nt"&gt;--listen&lt;/span&gt; &lt;span class="nt"&gt;--image&lt;/span&gt; leaf.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;The model: &lt;strong&gt;google/gemma-4-31b-it via OpenRouter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm using the 31B dense model via OpenRouter's free tier — one of the access methods recommended by the challenge organisers themselves. For Tamil multilingual reasoning this matters: the 31B gives the best quality responses for agricultural domain knowledge in a non-Latin script language, and OpenRouter's free tier makes it accessible without any cost.&lt;br&gt;
What Gemma 4 is actually doing&lt;br&gt;
Gemma 4 is the reasoning core. It receives:&lt;/p&gt;

&lt;p&gt;A Tamil transcript of the farmer's question (from Groq's Whisper Large v3 — fast, free, handles Tamil well)&lt;br&gt;
Optionally, a base64-encoded photograph of a diseased crop&lt;br&gt;
A full agricultural knowledge base covering 5 Tamil Nadu crops embedded in the 128K context window — rice, banana, sugarcane, groundnut, cotton — diseases, pests, seasons, organic remedies&lt;/p&gt;

&lt;p&gt;It reasons across all of this — text and image together — and responds in Tamil. Not translated Tamil. Native Tamil reasoning.&lt;br&gt;
The thinking mode (&amp;lt;|think|&amp;gt;) is enabled. For agricultural diagnosis this matters more than it might seem. "Yellowing leaves" could mean nitrogen deficiency, waterlogging, or blast disease depending on the pattern, the crop, and the season. The model reasons through these possibilities before giving advice rather than reflexively pattern-matching.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Gemma 4 and not GPT-4o or Claude&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This is the most important question and deserves an honest answer.&lt;br&gt;
For a single developer testing on a laptop, any frontier model works. But the use case here is deployment — real farmers, real scale, real constraints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Apache 2.0 license. An NGO can take these exact weights, deploy them on hardware in Tamil Nadu, and owe Google nothing. No MAU clause, no usage fee, no permission required. This is legally impossible with GPT-4o or Claude.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Offline-capable. GPT-4o and Claude require internet. Always. A village with 2G connectivity or frequent outages cannot rely on a cloud API. Gemma 4 E4B running locally requires no internet after the one-time model download.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Zero ongoing cost at scale. At 10,000 farmers making 5 queries a day, cloud API costs become significant. Gemma 4 on a local device costs electricity. That's it.&lt;br&gt;
128K context on a 4B model. Embedding the full agricultural knowledge base in every prompt — no RAG pipeline needed for Phase 1 — is only possible because even the edge model has a 128K context window. Most 4B models have 4K-8K.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The honest gap&lt;/strong&gt;&lt;br&gt;
Gemma 4 E4B supports native audio input natively. However no free hosted provider exposes this endpoint yet. So Phase 1 uses Groq's Whisper Large v3 for speech-to-text — a separate model call — then passes the Tamil transcript to Gemma 4 via OpenRouter for reasoning. Two API calls instead of one. I'm documenting this honestly because it's the real architecture, not a design choice. Phase 2 collapses this into a single Gemma 4 E4B call running locally — no Whisper, no OpenRouter, no internet required at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's Next — Phase 2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Phase 1 covers 5 crops with a static knowledge base. That's a proof of concept, not a complete tool.&lt;/li&gt;
&lt;li&gt;RAG + vector database is the most important next step. Tamil Nadu alone has dozens of commercially grown crops. Add district-level soil profiles, taluk-wise pest calendars, government scheme eligibility, and rainfall patterns — and you have a knowledge base no prompt can hold. &lt;/li&gt;
&lt;li&gt;Phase 2 replaces the text file with a Chroma or pgvector database, retrieves only the relevant chunks per query, and passes those to Gemma 4. The rest of the pipeline stays identical — this is entirely a change inside prompt_builder.py.&lt;/li&gt;
&lt;li&gt;TTS output — converting Gemma 4's Tamil text response back to spoken audio. A farmer who cannot read still gets the answer.&lt;/li&gt;
&lt;li&gt;Fully offline on edge hardware — the complete Phase 2 vision. Gemma 4 E4B on a Raspberry Pi 5 (~₹15,000 one-time cost). No internet after setup. No cloud dependency. No monthly bill. A state agriculture department or NGO buys the devices once, distributes them to panchayat offices, and farmers get Tamil crop advisory indefinitely — with zero ongoing cost and Apache 2.0 freedom to modify and redistribute.&lt;/li&gt;
&lt;li&gt;This is what the tool is actually for. Not a developer demo. A device on a desk in a village, answering questions from farmers who don't have a fancy smartphone or a reliable internet connection — in the language they speak, about the crops they grow.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
  </channel>
</rss>
