[PR #875] [CLOSED] Refactor: migrate core stack from OpenAI to Groq and Edge-TTS #12536

Closed
opened 2026-06-20 03:13:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Shubhamsaboo/awesome-llm-apps/pull/875
Author: @tmvalijib24
Created: 6/10/2026
Status: Closed

Base: mainHead: refactor/migrate-to-groq-edgetts


📝 Commits (1)

  • 6f0a2a3 refactor: migrate core stack from OpenAI to Groq and Edge-TTS

📊 Changes

5 files changed (+654 additions, -421 deletions)

View changed files

📝 voice_ai_agents/voice_rag_groq_edgetts/README.md (+12 -11)
voice_ai_agents/voice_rag_groq_edgetts/rag_voice.py (+623 -0)
voice_ai_agents/voice_rag_groq_edgetts/requirements.txt (+19 -0)
voice_ai_agents/voice_rag_openaisdk/rag_voice.py (+0 -401)
voice_ai_agents/voice_rag_openaisdk/requirements.txt (+0 -9)

📄 Description

📝 Summary

This PR completely refactors the Voice RAG Agent to remove all dependencies on the paid OpenAI API, transitioning the project to a 100% free and lightning-fast stack.

The text generation "brain" is now powered by Groq (using the llama-3.1-8b-instant model), and the audio generation "voice" is now handled by edge-tts (Microsoft Edge's free Neural TTS API). Additionally, this refactor simplifies the application architecture by removing the reliance on the custom local agents module, handling the API logic directly within the main script for better stability and readability.

🛠️ Key Changes

  • LLM Migration: Replaced the openai SDK with the groq Python client.
  • Model Upgrade: Configured the agent to use llama-3.1-8b-instant for high-speed, large-context RAG generation.
  • TTS Migration: Replaced OpenAI's TTS with edge-tts for asynchronous, high-quality audio generation without requiring API keys.
  • Architecture Simplification: Removed imports and dependencies on the local agents.py (Agent/Runner classes), integrating the prompting logic directly into process_query().
  • UI Updates: Updated the Streamlit sidebar configuration fields to prompt for a Groq API Key instead of an OpenAI key. Voice selection options have been updated to match edge-tts formats (e.g., en-US-ChristopherNeural).
  • Documentation: Completely rewrote the README.md to accurately reflect the zero-cost architecture, updated environment variables, and new setup instructions.

⚠️ Breaking Changes

  • Environment Variables: OPENAI_API_KEY is no longer used. Users must generate a free API key from the Groq Console and update their .env file to use GROQ_API_KEY.
  • Local Modules: The local agents module is deprecated in this branch.

Testing / Verification

  1. Pulled the branch and installed new dependencies (pip install groq edge-tts).
  2. Passed the Groq API key via the Streamlit sidebar.
  3. Successfully uploaded and processed a PDF into Qdrant.
  4. Queried the document, verified that Groq generated an accurate text response based on the context.
  5. Verified that edge-tts successfully generated and streamed the .mp3 audio response in the Streamlit UI.

Images

image image image

rag_voice.webm


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Shubhamsaboo/awesome-llm-apps/pull/875 **Author:** [@tmvalijib24](https://github.com/tmvalijib24) **Created:** 6/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/migrate-to-groq-edgetts` --- ### 📝 Commits (1) - [`6f0a2a3`](https://github.com/Shubhamsaboo/awesome-llm-apps/commit/6f0a2a34613f0925e68b6563950dcbf52a593ab5) refactor: migrate core stack from OpenAI to Groq and Edge-TTS ### 📊 Changes **5 files changed** (+654 additions, -421 deletions) <details> <summary>View changed files</summary> 📝 `voice_ai_agents/voice_rag_groq_edgetts/README.md` (+12 -11) ➕ `voice_ai_agents/voice_rag_groq_edgetts/rag_voice.py` (+623 -0) ➕ `voice_ai_agents/voice_rag_groq_edgetts/requirements.txt` (+19 -0) ➖ `voice_ai_agents/voice_rag_openaisdk/rag_voice.py` (+0 -401) ➖ `voice_ai_agents/voice_rag_openaisdk/requirements.txt` (+0 -9) </details> ### 📄 Description ### 📝 Summary This PR completely refactors the Voice RAG Agent to remove all dependencies on the paid OpenAI API, transitioning the project to a **100% free and lightning-fast stack**. The text generation "brain" is now powered by **Groq** (using the `llama-3.1-8b-instant` model), and the audio generation "voice" is now handled by **edge-tts** (Microsoft Edge's free Neural TTS API). Additionally, this refactor simplifies the application architecture by removing the reliance on the custom local `agents` module, handling the API logic directly within the main script for better stability and readability. ### 🛠️ Key Changes * **LLM Migration:** Replaced the `openai` SDK with the `groq` Python client. * **Model Upgrade:** Configured the agent to use `llama-3.1-8b-instant` for high-speed, large-context RAG generation. * **TTS Migration:** Replaced OpenAI's TTS with `edge-tts` for asynchronous, high-quality audio generation without requiring API keys. * **Architecture Simplification:** Removed imports and dependencies on the local `agents.py` (`Agent`/`Runner` classes), integrating the prompting logic directly into `process_query()`. * **UI Updates:** Updated the Streamlit sidebar configuration fields to prompt for a `Groq API Key` instead of an OpenAI key. Voice selection options have been updated to match `edge-tts` formats (e.g., `en-US-ChristopherNeural`). * **Documentation:** Completely rewrote the `README.md` to accurately reflect the zero-cost architecture, updated environment variables, and new setup instructions. ### ⚠️ Breaking Changes * **Environment Variables:** `OPENAI_API_KEY` is no longer used. Users must generate a free API key from the Groq Console and update their `.env` file to use `GROQ_API_KEY`. * **Local Modules:** The local `agents` module is deprecated in this branch. ### ✅ Testing / Verification 1. Pulled the branch and installed new dependencies (`pip install groq edge-tts`). 2. Passed the Groq API key via the Streamlit sidebar. 3. Successfully uploaded and processed a PDF into Qdrant. 4. Queried the document, verified that Groq generated an accurate text response based on the context. 5. Verified that `edge-tts` successfully generated and streamed the `.mp3` audio response in the Streamlit UI. ### Images <img width="1920" height="909" alt="image" src="https://github.com/user-attachments/assets/66730ef2-40f6-46b3-80c3-f4a20385a78c" /> <img width="1920" height="908" alt="image" src="https://github.com/user-attachments/assets/28bbf714-5eb6-4dee-abe3-727b10f431d3" /> <img width="1920" height="908" alt="image" src="https://github.com/user-attachments/assets/7c3b9eb7-ec5f-4854-816c-5166a26a8721" /> [rag_voice.webm](https://github.com/user-attachments/assets/2a21fe0e-c49f-4b6a-ba61-ad026694c012) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-20 03:13:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-llm-apps#12536