A production-ready, multi-provider AI chat application with voice integration and unified API abstraction
Chat AI is a sophisticated conversational AI platform that abstracts away the complexity of working with multiple Large Language Models (LLMs). Built with modern Python architecture, it provides a unified interface for interacting with various AI providers through a single, elegant web application.
- 🔄 Multi-Provider Support: Seamlessly switch between OpenAI GPT, Claude, Gemini, LLAMA, and other models with unified interface abstraction
- 🎙️ Voice Integration: Speech-to-text capabilities with real-time transcription
- 🏠 Local & Cloud: Support for both cloud APIs and local inference (OLLAMA, Hugging Face downloading the torch model)
- 🎨 Modern UI: Clean, responsive interface built with Streamlit
- ⚡ Performance Optimized: Efficient model loading, caching, and async processing for non-blocking operations
- 🔧 Extensible Architecture: Modular design with secure environment-based configuration for easy provider addition
Tip
Hugging Face implementation downloads and quantizes Torch models directly (optimized for consumer GPUs), using low-level tokenizer encode/decode rather than pipeline methods.
| Provider | Type | Default Model |
|---|---|---|
| OpenAI | Cloud API | gpt-4o-mini |
| Claude | Cloud API | claude-3-7-sonnet-latest |
| Gemini | Cloud API | gemini-2.0-flash |
| OLLAMA | Local | llama3.2 |
| Hugging Face | Local | Meta-Llama-3.1-8B-Instruct |
# Clone the repository
git clone https://github.com/NEGU93/chat_ai.git
cd chat_ai
# Install dependencies
pip install -r requirements.txt
# Edit .env with your API keysSetup whatever keys you want
- For OpenAI, visit https://openai.com/api/
- For Anthropic, visit https://console.anthropic.com/
- For Google, visit https://ai.google.dev/gemini-api
- For HuggingFace, visit https://huggingface.co
Note
OpenAI key is required for Speech-to-text capabilities
Note
For the default HuggingFace model, Meta requires you to sign their terms of service. Visit their model instructions page in Hugging Face: https://huggingface.co/meta-llama/Meta-Llama-3.1-8B. It might take some time to validate.
Create a .env file in the root directory:
# Cloud API Keys (use only what you need)
OPENAI_API_KEY=sk-proj-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...
HF_TOKEN=hf_...For local AI models without API costs:
- Install OLLAMA
- Run the application
- Enjoy unlimited local AI chat
Tip
No need to download the OLLAMA models, my app will download it automatically (just be patient the first time you run)
# Start the application
streamlit run app.pyNavigate to http://localhost:8501 and start chatting with your preferred AI model!
This application showcases several important technical skills:
- AI/ML Integration: Practical experience with multiple LLM providers
- Software Architecture: Clean, modular design patterns
- Full-Stack Development: Backend AI logic + Frontend web interface
- API Management: Secure handling of multiple API integrations
- Performance Engineering: Optimization for real-time AI interactions
The application follows a clean architecture pattern with clear separation of concerns:
├── models.py # Implements a unified interface pattern
├── streamlit_app.py # Web application frontend and user interaction
├── requirements.txt # Python dependencies (soon)
└── .env # Environment configuration (API keys)
Built with ❤️ by NEGU93 | GitHub | Connect on LinkedIn
