<<<<<<< HEAD
=======
Complete AI application with Voice, Text, and Vision - 100% Local & Free
- 🎤 Voice Chat: Speak → AI transcribes → Generates response → Speaks back
- 💬 Text Chat: Type messages with optional voice output
- 👁️ Vision Analysis: Upload images for AI description and analysis
- 🔒 100% Local: No external APIs, complete privacy
- 💰 Free: No usage costs, open-source models only
# Clone or download this project
cd local-ai-demo
# Install Python packages
pip install -r requirements.txt
# Or run setup script
python setup.pypython app.pyOpen your browser to: http://localhost:7860
- RAM: 8GB
- VRAM: 4GB (GPU recommended)
- Storage: 10GB for models
- Python: 3.8+
- RAM: 16GB+
- VRAM: 8GB+ (NVIDIA GPU)
- Storage: 20GB
- OS: Linux/Windows/macOS
🎙️ Record Audio → 🗣️ Whisper STT → 🧠 Local LLM → 🔊 TTS → 🎵 Audio Response
⌨️ Type Message → 🧠 Local LLM → 📝 Text Response (+ Optional 🔊 TTS)
📷 Upload Image → 👁️ BLIP-2 VLM → 📋 Description & Analysis
| Component | Model | Size | Purpose |
|---|---|---|---|
| Speech-to-Text | OpenAI Whisper | ~1GB | Voice transcription |
| Language Model | DialoGPT-medium | ~1.5GB | Text generation |
| Text-to-Speech | pyttsx3 | <1MB | Voice synthesis |
| Vision | BLIP-2-2.7B | ~3GB | Image analysis |
For better LLM performance, install Ollama:
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a model
ollama pull llama2:7b-chat
# App will automatically use Ollama if available- Record audio with microphone
- Real-time speech-to-text transcription
- AI generates contextual responses
- Text-to-speech audio output
- Conversation history display
- Standard chat interface
- Optional voice output toggle
- Conversation memory
- Clear chat functionality
- Image upload or camera capture
- Custom question input
- AI-powered image description
- Detailed visual analysis
- System information display
- Model configuration details
- Performance tips
- Privacy information
- ✅ 100% Local Processing: All AI runs on your machine
- ✅ No External APIs: No data sent to cloud services
- ✅ Offline Capable: Works without internet connection
- ✅ No Data Collection: Conversations stay private
- ✅ Open Source: Fully transparent implementation
Edit config.py to customize:
# Model Selection
LLM_MODEL = "microsoft/DialoGPT-medium"
WHISPER_MODEL = "base" # tiny, base, small, medium
VLM_MODEL = "Salesforce/blip2-opt-2.7b"
# Performance Settings
DEVICE = "cuda" # or "cpu"
MAX_TOKENS = 512
TEMPERATURE = 0.7
# UI Settings
GRADIO_PORT = 7860Models downloading slowly?
- Models download automatically on first use
- Subsequent runs are much faster
- Check internet connection for initial setup
Out of memory errors?
- Reduce model sizes in config.py
- Use CPU instead of GPU:
DEVICE = "cpu" - Close other applications
Audio not working?
- Check microphone permissions
- Install audio drivers
- Try different audio input device
Ollama connection failed?
- Install Ollama:
curl -fsSL https://ollama.ai/install.sh | sh - Start Ollama service:
ollama serve - Pull model:
ollama pull llama2:7b-chat
- Use GPU: Significantly faster inference
- Smaller Models: Trade quality for speed
- Close Apps: Free up RAM and VRAM
- SSD Storage: Faster model loading
- Real-time streaming responses
- Multi-language support
- Custom model fine-tuning
- Mobile app version
- Advanced conversation memory
- Plugin system for extensions
- Fork the repository
- Create feature branch
- Make improvements
- Test thoroughly
- Submit pull request
MIT License - Feel free to use and modify!
- OpenAI Whisper: Speech recognition
- Hugging Face: Model hosting and transformers
- Gradio: Web interface framework
- Ollama: Local LLM serving
- Open Source Community: Making AI accessible
🚀 Built with ❤️ for local AI enthusiasts
No cloud required • No API costs • Complete control