A powerful local AI assistant with chat, voice, and image generation capabilities using free, open-source models.
- ๐ฌ AI Chat - Powered by Microsoft Phi-3 (3-5x faster than Llama3)
- ๐ค Voice Chat - Speech-to-text using OpenAI Whisper
- ๐จ Image Generation - Create images with Stable Diffusion
- ๐ป Code Helper - Programming assistance and code generation
- ๐ Quick Prompts - Pre-built prompts for common tasks
- ๐พ Chat History - Persistent conversation memory
- ๐ 100% Local - No data sent to external servers
- OS: Windows 10/11, macOS, or Linux
- RAM: 8GB minimum (16GB recommended)
- Storage: 10GB free space
- GPU: Optional (NVIDIA GPU recommended for faster image generation)
- Python: 3.8 or higher
- Ollama: For running local AI models
git clone https://github.com/yourusername/AfzaAssistant.git
cd AfzaAssistantpip install -r requirements.txtWindows:
# Download and install from https://ollama.ai
# Or use PowerShell:
winget install Ollama.OllamamacOS:
brew install ollamaLinux:
curl -fsSL https://ollama.ai/install.sh | sh# Start Ollama service
ollama serve
# Install fast Phi-3 model (recommended)
ollama pull phi3# Easy start (Windows)
start.bat
# Or manually
streamlit run app.pyNavigate to: http://localhost:8501
- Type your question in the main search box
- Click "AI Chat" for extended conversations
- Use quick prompts on the right panel for common tasks
- Click "Image Generation"
- Describe your desired image
- Click "Generate" and wait for creation
- Images appear instantly in the interface
- Click "Voice Chat"
- Upload audio file (WAV, MP3, M4A)
- Click "Process" to transcribe and get AI response
- Click "Code Helper"
- Describe your coding task
- Get clean, commented code with examples
Edit app.py line 95 to change models:
response = ollama.chat(model="phi3", messages=[...])# Recommended (Best balance)
ollama pull phi3 # 3-5x faster than Llama3
# Ultra Fast Options
ollama pull gemma2:2b # 5-8x faster, 1.6GB
ollama pull qwen2:1.5b # 8-10x faster, 934MB
ollama pull tinyllama # 10x+ faster, 637MB
# High Quality Options
ollama pull llama3 # Baseline, 4.7GB
ollama pull mistral # Good quality, 4.1GBFor faster image generation, ensure CUDA is installed:
# Check GPU availability
python -c "import torch; print(torch.cuda.is_available())"AfzaAssistant/
โโโ app.py # Main application
โโโ requirements.txt # Python dependencies
โโโ start.bat # Windows launcher
โโโ test_app.py # Testing script
โโโ README.md # This file
1. Ollama Connection Error
# Start Ollama service
ollama serve
# Check if running
ollama list2. Model Not Found
# Install the model
ollama pull phi3
# Verify installation
ollama list3. Port Already in Use
# Run on different port
streamlit run app.py --server.port 85024. Memory Issues
- Use smaller models:
gemma2:2bortinyllama - Close other applications
- Reduce image generation steps
5. GPU Not Detected
- Install CUDA toolkit
- Update GPU drivers
- Restart application
For Low-End Systems:
# Use ultra-fast model
ollama pull gemma2:2bFor High-End Systems:
# Use high-quality model
ollama pull llama3# Update to latest version
ollama pull phi3
# List all models
ollama list
# Remove old models
ollama rm old_model_namegit pull origin main
pip install -r requirements.txt --upgrade| Model | Size | Speed | Quality | Use Case |
|---|---|---|---|---|
| Phi-3 | 2.3GB | โญโญโญโญโญ | โญโญโญโญโญ | Recommended |
| Gemma2:2b | 1.6GB | โญโญโญโญโญ | โญโญโญโญ | Ultra Fast |
| Qwen2:1.5b | 934MB | โญโญโญโญโญ | โญโญโญ | Lightning |
| TinyLlama | 637MB | โญโญโญโญโญ | โญโญ | Testing |
| Llama3 | 4.7GB | โญโญโญ | โญโญโญโญโญ | High Quality |
- Fork the repository
- Create feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Submit pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Microsoft - Phi-3 model
- OpenAI - Whisper speech recognition
- Stability AI - Stable Diffusion image generation
- Ollama - Local model serving
- Streamlit - Web interface framework
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
- Multi-language support
- Plugin system
- Mobile app
- Docker deployment
- API endpoints
- Custom model training
Made with โค๏ธ for the AI community
Privacy-first โข Open-source โข Lightning-fast