Refactor: migrate core stack from OpenAI to Groq and Edge-TTS#875
Closed
tmvalijib24 wants to merge 1 commit into
Closed
Refactor: migrate core stack from OpenAI to Groq and Edge-TTS#875tmvalijib24 wants to merge 1 commit into
tmvalijib24 wants to merge 1 commit into
Conversation
- Replace OpenAI API with Groq client using 'llama-3.1-8b-instant'. - Replace paid OpenAI TTS with 'edge-tts' for free audio synthesis. - Remove reliance on custom local 'agents' module for stability.
|
excellent work |
Owner
|
Thanks for the thorough work here, the migration is clearly well executed. That said, we're going to pass on this one. The Voice RAG Agent is an existing tutorial built deliberately around the OpenAI stack, and this PR swaps out the entire core (LLM, TTS, and the local If you'd like to contribute a Groq + edge-tts voice agent, a brand new self-contained example in its own folder would be very welcome instead of replacing this one. Closing this for now. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 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-instantmodel), 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 localagentsmodule, handling the API logic directly within the main script for better stability and readability.🛠️ Key Changes
openaiSDK with thegroqPython client.llama-3.1-8b-instantfor high-speed, large-context RAG generation.edge-ttsfor asynchronous, high-quality audio generation without requiring API keys.agents.py(Agent/Runnerclasses), integrating the prompting logic directly intoprocess_query().Groq API Keyinstead of an OpenAI key. Voice selection options have been updated to matchedge-ttsformats (e.g.,en-US-ChristopherNeural).README.mdto accurately reflect the zero-cost architecture, updated environment variables, and new setup instructions.OPENAI_API_KEYis no longer used. Users must generate a free API key from the Groq Console and update their.envfile to useGROQ_API_KEY.agentsmodule is deprecated in this branch.✅ Testing / Verification
pip install groq edge-tts).edge-ttssuccessfully generated and streamed the.mp3audio response in the Streamlit UI.Images
rag_voice.webm