A fully offline voice assistant: press Enter, talk, press Enter again, and it replies out loud. It can hold a conversation, and it can actually control your PC — open apps and websites, adjust volume, lock/shutdown/restart, create or find files, and run any custom command you define. No internet needed once set up. Nothing you say leaves your PC.
-
Install Python (if you don't have it): https://www.python.org/downloads/
- During install, check the box "Add Python to PATH".
-
Install Ollama: https://ollama.com/download
- Run the installer, accept the defaults. It installs a small background service.
-
Run
install.bat(double-click it)- Installs the Python packages
- Downloads a small, fast local AI model (~1.3 GB, one-time)
Double-click start.bat.
- On launch, it greets you out loud based on the time of day — e.g. "Good morning, sir. Jarvis is online."
- Press Enter → speak your question or command → press Enter again to stop recording
- The assistant transcribes what you said, checks if it's a known command, and either runs it or answers it conversationally
- Press Ctrl+C in the window to quit
Change the name and how it addresses you at the top of voice_assistant.py:
ASSISTANT_NAME = "Jarvis"
ADDRESS_AS = "sir" # or "ma'am", your name, or "" for no title at allSay things naturally — matching is flexible, not exact-phrase. A few examples per category:
| Category | Example phrases |
|---|---|
| Apps & websites | "open chrome", "open notepad", "open youtube" |
| Volume | "volume up", "volume down", "mute", "unmute", "set volume to 40" |
| System | "lock the screen", "shut down the computer", "restart the computer" |
| Files & folders | "create a folder called Recipes", "create a file called notes.txt", "find files named invoice" |
| Custom commands | Whatever you define — see below |
| Write & run code | "write code to reverse a string", "code a script that renames all files in a folder" |
| Time & date | "what time is it", "what's the date" |
| Web search | "search for best pizza in town", "google the weather in Tokyo", "look up python list comprehensions" |
| Settings | "turn on dark mode", "turn off dark mode", "turn off wifi", "turn on bluetooth", "turn on do not disturb" |
Writing code works like this: say something starting with "write code to..." or
"code a script that...", and Jarvis generates a Python script, saves it to the
generated_code/ folder, and asks "want me to run it?". Say "yes" to run it — it'll
read back the output, or the error if something went wrong. It never runs anything
without you confirming first, and it always runs with a 15-second timeout so a runaway
loop can't hang forever.
This uses a separate, code-specialized model (qwen2.5-coder:1.5b, pulled during
setup) since the small llama3.2:1b chat model isn't great at writing code. If you
skipped that download, it automatically falls back to your regular chat model instead
— code quality will just be noticeably weaker.
Shutdown and restart always ask "are you sure?" first and wait for you to say "yes" — this guards against a misheard word accidentally shutting down your PC. Say "cancel shutdown" any time during the 5-second countdown to stop it.
Web search opens your default browser with a Google search for whatever you asked — this is the one command that needs an internet connection, everything else stays fully offline.
Settings toggles work differently depending on the setting:
- Dark mode flips instantly via the registry, no restart or extra permissions needed.
- Wi-Fi uses
netsh, which usually needs the assistant run as Administrator, and assumes your adapter is named "Wi-Fi" (Windows' default name — rename it back if you've changed it). - Bluetooth, airplane mode, and do not disturb / focus assist don't have a safe way to toggle from a script, so instead Jarvis opens the exact Settings page for you to flip it yourself.
Anything that doesn't match a known command is sent to the local AI as normal conversation instead.
This file is created automatically the first time you run the assistant. Open it in any text editor to add your own:
{
"apps": {
"spotify": "C:\\Users\\YOU\\AppData\\Roaming\\Spotify\\Spotify.exe"
},
"websites": {
"github": "https://github.com"
},
"custom_commands": {
"open my project": "code C:\\Users\\YOU\\projects\\myproject",
"backup my documents": "robocopy C:\\Users\\YOU\\Documents D:\\Backup /E"
}
}- apps — key is what you'll say ("open ___"), value is the path to the .exe
- websites — key is what you'll say, value is the URL to open
- custom_commands — key is a trigger phrase (matched if it appears anywhere in what you said), value is any command you'd normally type in a terminal. These run exactly as written, so only put commands here that you'd be comfortable running yourself.
- search_roots — folders searched when you say "find files named ___", and where new files/folders get created
Restart the assistant after editing this file.
- llama3.2:1b — a 1-billion-parameter model, small enough to respond in 1-3 seconds on a normal CPU
- faster-whisper (base.en) — an optimized speech-to-text engine, transcribes a few seconds of speech almost instantly on CPU
- pyttsx3 — uses Windows' built-in voice engine (SAPI), so speech output is instant with no extra downloads
| Setting | What it does | Trade-off |
|---|---|---|
MODEL_NAME |
Which Ollama model answers you | Bigger model = smarter but slower. Try phi3.5:3.8b or qwen2.5:1.5b for a quality/speed alternative — run ollama pull <name> first |
WHISPER_SIZE |
Speech-to-text accuracy | tiny.en = fastest, small.en = more accurate but slower |
SPEECH_RATE |
Words per minute spoken back | Higher = faster replies, lower = easier to follow |
pyttsx3 sounds robotic but is instant and needs zero setup. If you later want a
much more natural voice and don't mind a bit more setup, look into Piper or
Kokoro-82M — both are free, offline, and CPU-friendly text-to-speech engines
that can be swapped in for the speak() function in voice_assistant.py.
- "I can't reach Ollama" → Ollama isn't running. Open the Start menu and search "Ollama" to launch it, or just restart your PC (it usually auto-starts as a service).
- No sound is recorded → Check Windows Sound settings → make sure the right microphone is set as default input device.
- Ollama pull is slow → It's a one-time ~1.3 GB download; after that it's fully offline.
- "open X" doesn't work → Add it to
commands_config.jsonwith the correct path. - Volume commands say a package is missing → run
pip install pycaw comtypes. - Code it writes is low quality / doesn't run → run
ollama pull qwen2.5-coder:1.5bif you skipped it during setup — it's much better at code than the default chat model. - "write code to..." says it can't reach Ollama → same fix as above: make sure Ollama is running.