Skip to content

LgrappaG/Gemma4Jarvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Gemma4Jarvis - AI Personal Assistant

Python 3.11+ License: MIT Status: MVP Ready

Your personal AI assistant powered by Google Gemma-4 running locally on your computer. Fully offline, no cloud dependencies, complete privacy.

โœจ Features

๐ŸŽฏ Core Capabilities

  • Voice Commands - Speak naturally, Jarvis understands your intent
  • Text Interface - CLI mode for typing commands
  • System Control - PowerShell integration, process management, audio/brightness
  • Web Integration - Search (Google, Bing, YouTube), open URLs
  • App Management - Open/close 20+ desktop applications instantly
  • File Operations - Create, delete, rename, copy, move files
  • Task Management - Reminders, todos, scheduling
  • Keyboard/Mouse Control - Automate typing, clicking, shortcuts

๐Ÿ”’ Privacy & Performance

  • โœ… Fully offline - Gemma-4 runs locally on your PC
  • โœ… No cloud calls - All data stays on your device
  • โœ… Fast response - <2 second latency with GPU
  • โœ… Lightweight - Minimal resource usage (CPU inference supported)

๐Ÿง  Intelligence

  • Natural Language Understanding (NLU) via Gemma-4
  • Intent recognition with confidence scoring
  • Context-aware command interpretation
  • Conversation history tracking
  • User preference learning (future)

๐Ÿš€ Quick Start

Requirements

  • Windows 11 (10 Pro tested)
  • Python 3.11+
  • Ollama (local model runner)
  • Microphone (optional - text mode works without)

1๏ธโƒฃ Install Ollama & Gemma-4

# Download from https://ollama.ai
ollama pull gemma:7b      # Fast (7B parameters)
# OR
ollama pull gemma:13b     # Accurate (13B parameters)

2๏ธโƒฃ Setup Project

# Clone and navigate to project
git clone https://github.com/LgrappaG/Gemma4Jarvis.git
cd jarvis

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
# or: source venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -r requirements.txt

3๏ธโƒฃ Run Jarvis

Text Mode (Recommended for testing):

python main.py --text

# Try commands:
> "search artificial intelligence on google"
> "open VS Code"
> "show system information"
> "exit" to quit

Voice Mode:

python main.py --voice
# Say "jarvis" to activate, then speak command

Test Components:

python main.py --test-mic      # Test microphone
python main.py --test-tts      # Test speaker
python main.py --test-gemma    # Test AI model latency
python main.py --benchmark     # Full system test

๐Ÿ“Š Project Structure

Gemma4Jarvis/ (700+ KB)
โ”œโ”€โ”€ main.py                          # Entry point
โ”œโ”€โ”€ requirements.txt                 # Dependencies (30+)
โ”œโ”€โ”€ INSTALLATION.md                  # Setup guide
โ”œโ”€โ”€ DEPLOYMENT.md                    # Distribution guide
โ”‚
โ”œโ”€โ”€ src/ (4,500+ lines)
โ”‚   โ”œโ”€โ”€ ai/                          # AI/LLM layer
โ”‚   โ”‚   โ”œโ”€โ”€ gemma_manager.py        (Ollama integration)
โ”‚   โ”‚   โ”œโ”€โ”€ intent_parser.py        (NLU)
โ”‚   โ”‚   โ””โ”€โ”€ prompt_templates.py     (System prompts)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ commands/ (2,800+ lines)     # Command handlers
โ”‚   โ”‚   โ”œโ”€โ”€ system_commands.py      (PowerShell, processes)
โ”‚   โ”‚   โ”œโ”€โ”€ web_commands.py         (Browser, search)
โ”‚   โ”‚   โ”œโ”€โ”€ desktop_commands.py     (App control)
โ”‚   โ”‚   โ”œโ”€โ”€ task_commands.py        (Reminders)
โ”‚   โ”‚   โ”œโ”€โ”€ file_commands.py        (File ops)
โ”‚   โ”‚   โ””โ”€โ”€ command_executor.py     (Orchestrator)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ io/ (400 lines)              # Voice I/O
โ”‚   โ”‚   โ”œโ”€โ”€ voice_input.py          (STT)
โ”‚   โ”‚   โ””โ”€โ”€ voice_output.py         (TTS)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ core/ (600 lines)            # Main orchestrator
โ”‚   โ”‚   โ””โ”€โ”€ jarvis.py               (AI assistant core)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ utils/ (750 lines)           # Utilities
โ”‚   โ”‚   โ”œโ”€โ”€ config.py               (Pydantic settings)
โ”‚   โ”‚   โ”œโ”€โ”€ logger.py               (Colored logging)
โ”‚   โ”‚   โ””โ”€โ”€ exceptions.py           (Custom errors)
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ advanced.py                  # Future features
โ”‚
โ”œโ”€โ”€ tests/                           # Test suite
โ”‚   โ””โ”€โ”€ test_integration.py          (20+ unit tests)
โ”‚
โ””โ”€โ”€ .gitignore, LICENSE, etc.

๐ŸŽฎ Usage Examples

Text Mode

๐Ÿ‘ค You: search artificial intelligence on google
๐Ÿค– Jarvis: I'll search the web for information about artificial intelligence
โœ… Opening search: artificial intelligence on google

Voice Mode

๐ŸŽค Listening for 'jarvis'...
๐ŸŽค Wakeword detected: Hey jarvis
๐ŸŽค Listening for command...
๐Ÿ“ Captured: open VS Code
โœ… Opened VS Code

Supported Commands

Category Examples
System system info, list processes, show CPU usage
Web search google, open youtube on bing, open twitter.com
Apps open VS Code, close notepad, start chrome
Files create file, open pictures folder, delete document
Tasks set reminder, show calendar, schedule meeting

โš™๏ธ Configuration

Edit ~/.gamma4/config.json or .env:

# Model
OLLAMA_BASE_URL=http://localhost:11434
MODEL_NAME=gemma:7b
MODEL_TIMEOUT=30

# Voice
VOICE_ACTIVATION_KEYWORD=jarvis
VOICE_RECOGNITION_TIMEOUT=30
TTS_RATE=150
TTS_VOICE=1  # 0=male, 1=female

# Features
COMMAND_CONFIRMATION_REQUIRED=true
DANGEROUS_COMMANDS_ENABLED=false

๐Ÿ“ˆ Performance

Component Latency Notes
Voice Capture 1s Microphone recording
AI Inference (Gemma-7B) 1.3-2.2s CPU (~1.3-2.2s), GPU (~0.7-1s)
Command Execution 0.6s System calls
Voice Output 0.4-0.7s Text-to-speech
Total ~3.3-5.5s Target: <6s โœ…

GPU Acceleration:

  • With NVIDIA RTX 4060 Ti: 1s-1.5s total โšก

๐Ÿงช Testing

# Run unit tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src

# Run specific test
pytest tests/test_integration.py::test_gemma_manager_initialization -v

๐Ÿ”ง Advanced Features (Future)

  • Outlook/Calendar integration
  • Advanced scheduling with persistence
  • Long-term memory & learning
  • Context-aware conversations
  • Custom wake words
  • Multi-language support
  • Plugin system

๐Ÿ“ฆ Deployment

Convert to standalone .exe:

pip install pyinstaller
pyinstaller --onefile --windowed main.py

# Output: dist/Gemma4Jarvis.exe

See DEPLOYMENT.md for full guide.


๐Ÿ› Troubleshooting

"Ollama not found"

  • Ensure Ollama is running: ollama serve
  • Check URL: http://localhost:11434

"Microphone not detected"

  • Test in Windows Sound Settings
  • Run: python main.py --test-mic

"Slow response"

  • Use smaller model: gemma:7b
  • Install NVIDIA drivers for GPU
  • Close other apps

See installation.md for more help.


๐Ÿ“„ License

MIT License - Feel free to use, modify, and distribute!


๐Ÿค Contributing

Contributions welcome! Areas needing help:

  • Outlook integration
  • More app templates
  • Additional languages
  • Performance optimization

๐Ÿ“š Documentation


๐ŸŽฏ Roadmap

  • v0.1.0 โœ… MVP: Core AI, commands, voice I/O
  • v0.2.0 ๐Ÿ”œ Advanced features, Outlook, scheduling
  • v0.3.0 ๐Ÿ”ฎ Multi-language, personality
  • v1.0.0 ๐ŸŒŸ Full release, auto-updates

๐Ÿ’ก Built With


โ“ FAQ

Q: Does it require internet? A: No! Gemma-4 runs locally via Ollama. Only voice may use online APIs as alternatives.

Q: How much storage? A: ~7-13GB for model + ~2GB for app + OS files.

Q: Can I use custom commands? A: Yes! Edit command handlers in src/commands/ and add new intents in prompts.

Q: Is it secure? A: Yes - everything runs locally, no data leaves your PC.


Made with โค๏ธ for AI enthusiasts everywhere

Questions? File an issue or check the docs!


Status: MVP Ready for Testing โœ…

Next: INSTALLATION.md

About

Local AI Assistant, Using Gemma4/Ollama

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages