Skip to content
paksaitsolutionsPublic
forked from Afza1112/AfzaAsst

About

A powerful local AI assistant with chat, voice, and image generation capabilities using free, open-source models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

ย 
ย 

Latest commit

ย 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AfzaAssistant - Advanced Local AI Assistant

A powerful local AI assistant with chat, voice, and image generation capabilities using free, open-source models.

AfzaAssistant Python Streamlit

๐Ÿš€ Features

  • ๐Ÿ’ฌ 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

๐Ÿ“‹ Requirements

System Requirements

  • 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)

Software Requirements

  • Python: 3.8 or higher
  • Ollama: For running local AI models

โšก Quick Start

1. Clone Repository

git clone https://github.com/yourusername/AfzaAssistant.git
cd AfzaAssistant

2. Install Python Dependencies

pip install -r requirements.txt

3. Install Ollama

Windows:

# Download and install from https://ollama.ai
# Or use PowerShell:
winget install Ollama.Ollama

macOS:

brew install ollama

Linux:

curl -fsSL https://ollama.ai/install.sh | sh

4. Install AI Model

# Start Ollama service
ollama serve

# Install fast Phi-3 model (recommended)
ollama pull phi3

5. Run Application

# Easy start (Windows)
start.bat

# Or manually
streamlit run app.py

6. Open Browser

Navigate to: http://localhost:8501

๐ŸŽฏ Usage Guide

Chat Interface

  1. Type your question in the main search box
  2. Click "AI Chat" for extended conversations
  3. Use quick prompts on the right panel for common tasks

Image Generation

  1. Click "Image Generation"
  2. Describe your desired image
  3. Click "Generate" and wait for creation
  4. Images appear instantly in the interface

Voice Chat

  1. Click "Voice Chat"
  2. Upload audio file (WAV, MP3, M4A)
  3. Click "Process" to transcribe and get AI response

Code Helper

  1. Click "Code Helper"
  2. Describe your coding task
  3. Get clean, commented code with examples

๐Ÿ”ง Configuration

Switch AI Models

Edit app.py line 95 to change models:

response = ollama.chat(model="phi3", messages=[...])

Available Models (Speed Comparison)

# 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.1GB

GPU Acceleration

For faster image generation, ensure CUDA is installed:

# Check GPU availability
python -c "import torch; print(torch.cuda.is_available())"

๐Ÿ“ Project Structure

AfzaAssistant/
โ”œโ”€โ”€ app.py              # Main application
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ”œโ”€โ”€ start.bat          # Windows launcher
โ”œโ”€โ”€ test_app.py        # Testing script
โ””โ”€โ”€ README.md          # This file

๐Ÿ› ๏ธ Troubleshooting

Common Issues

1. Ollama Connection Error

# Start Ollama service
ollama serve

# Check if running
ollama list

2. Model Not Found

# Install the model
ollama pull phi3

# Verify installation
ollama list

3. Port Already in Use

# Run on different port
streamlit run app.py --server.port 8502

4. Memory Issues

  • Use smaller models: gemma2:2b or tinyllama
  • Close other applications
  • Reduce image generation steps

5. GPU Not Detected

  • Install CUDA toolkit
  • Update GPU drivers
  • Restart application

Performance Optimization

For Low-End Systems:

# Use ultra-fast model
ollama pull gemma2:2b

For High-End Systems:

# Use high-quality model
ollama pull llama3

๐Ÿ”„ Updates

Update Models

# Update to latest version
ollama pull phi3

# List all models
ollama list

# Remove old models
ollama rm old_model_name

Update Application

git pull origin main
pip install -r requirements.txt --upgrade

๐Ÿ“Š Performance Benchmarks

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

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature-name
  3. Commit changes: git commit -m 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Microsoft - Phi-3 model
  • OpenAI - Whisper speech recognition
  • Stability AI - Stable Diffusion image generation
  • Ollama - Local model serving
  • Streamlit - Web interface framework

๐Ÿ“ž Support

๐Ÿ”ฎ Roadmap

  • 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

About

A powerful local AI assistant with chat, voice, and image generation capabilities using free, open-source models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages