<?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: ayisha</title>
    <description>The latest articles on DEV Community by ayisha (@ayishaparli).</description>
    <link>https://dev.to/ayishaparli</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%2F3875892%2F46ede199-7e84-4415-8f1f-e7e8f348d9b6.png</url>
      <title>DEV Community: ayisha</title>
      <link>https://dev.to/ayishaparli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayishaparli"/>
    <language>en</language>
    <item>
      <title>Building a Voice-Controlled Local AI Agent with Groq Whisper, Ollama, and Streamlit</title>
      <dc:creator>ayisha</dc:creator>
      <pubDate>Mon, 13 Apr 2026 04:58:55 +0000</pubDate>
      <link>https://dev.to/ayishaparli/building-a-voice-controlled-local-ai-agent-with-groq-whisper-ollama-and-streamlit-1lkc</link>
      <guid>https://dev.to/ayishaparli/building-a-voice-controlled-local-ai-agent-with-groq-whisper-ollama-and-streamlit-1lkc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I built a voice-controlled AI agent that listens to your voice, &lt;br&gt;
understands your intent, and executes actions on your local machine — &lt;br&gt;
all through a clean web UI. In this article, I'll walk through the &lt;br&gt;
architecture, models I chose, and the challenges I faced building this &lt;br&gt;
on Windows.&lt;/p&gt;
&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;p&gt;You speak a command like "Create a Python file with a retry function" &lt;br&gt;
and the agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Transcribes your audio to text&lt;/li&gt;
&lt;li&gt;Detects your intent using a local LLM&lt;/li&gt;
&lt;li&gt;Executes the right action (generates code, creates files, summarizes text)&lt;/li&gt;
&lt;li&gt;Shows everything in a Streamlit UI&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;Audio Input → Groq Whisper STT → Ollama LLM (Intent) → Tool Execution → Streamlit UI&lt;/p&gt;
&lt;h3&gt;
  
  
  Components:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;STT:&lt;/strong&gt; Groq Whisper large-v3 API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM:&lt;/strong&gt; llama3.2 via Ollama (runs 100% locally)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI:&lt;/strong&gt; Streamlit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; File creation, code generation, text summarization, general chat&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Models I Chose
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Speech-to-Text: Groq Whisper
&lt;/h3&gt;

&lt;p&gt;I initially planned to use OpenAI Whisper locally via HuggingFace. &lt;br&gt;
However, Whisper requires ffmpeg which had PATH issues on Windows. &lt;br&gt;
I switched to Groq's Whisper API which is free, fast, and supports &lt;br&gt;
all audio formats without any local setup.&lt;/p&gt;
&lt;h3&gt;
  
  
  LLM: llama3.2 via Ollama
&lt;/h3&gt;

&lt;p&gt;I chose Ollama for local LLM inference because it's easy to set up &lt;br&gt;
on Windows and runs completely offline. llama3.2 provided a good &lt;br&gt;
balance between speed and accuracy for intent classification.&lt;/p&gt;
&lt;h2&gt;
  
  
  Intent Classification
&lt;/h2&gt;

&lt;p&gt;The LLM classifies user speech into four intents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WRITE_CODE&lt;/strong&gt; — generates and saves code to output/&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CREATE_FILE&lt;/strong&gt; — creates a new file in output/&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SUMMARIZE&lt;/strong&gt; — summarizes provided text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GENERAL_CHAT&lt;/strong&gt; — general conversation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I used structured JSON prompting to get consistent output from the LLM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;SYSTEM_PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Classify the intent into one of:
WRITE_CODE, CREATE_FILE, SUMMARIZE, GENERAL_CHAT
Respond in JSON format only.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Challenges I Faced
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. ffmpeg on Windows
&lt;/h3&gt;

&lt;p&gt;Whisper requires ffmpeg but adding it to PATH on Windows was &lt;br&gt;
problematic due to OneDrive folder paths with spaces. I solved &lt;br&gt;
this by switching to Groq's API entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Multiple Python versions
&lt;/h3&gt;

&lt;p&gt;My machine had both Python 3.12 and 3.13 installed. Packages &lt;br&gt;
installed on one version weren't available on the other. I solved &lt;br&gt;
this by always using py -3.12 explicitly.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Streamlit state management
&lt;/h3&gt;

&lt;p&gt;Button clicks in Streamlit trigger full page reruns, losing &lt;br&gt;
previous results. I solved this using st.session_state to persist &lt;br&gt;
transcription and intent results across reruns.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. API Key Security
&lt;/h3&gt;

&lt;p&gt;GitHub Push Protection blocked my push because my Groq API key &lt;br&gt;
was hardcoded. I fixed this by using python-dotenv with a .env &lt;br&gt;
file and environment variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety
&lt;/h2&gt;

&lt;p&gt;All file operations are restricted to an output/ folder to prevent &lt;br&gt;
accidental system file overwrites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Watch the full demo here: &lt;a href="https://youtu.be/S2PejSQGpAA" rel="noopener noreferrer"&gt;https://youtu.be/S2PejSQGpAA&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub
&lt;/h2&gt;

&lt;p&gt;Full source code: &lt;a href="https://github.com/ayisha-parli/voice-agent" rel="noopener noreferrer"&gt;https://github.com/ayisha-parli/voice-agent&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building a fully local voice AI agent is very achievable with &lt;br&gt;
modern tools like Ollama and Groq. The biggest challenges were &lt;br&gt;
Windows-specific setup issues rather than AI-related problems. &lt;br&gt;
The final system works reliably and can be extended with more &lt;br&gt;
intents and tools easily.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>pgaichallenge</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
