This repository contains a fully private, real-time voice and text AI assistant optimized for macOS and Apple Silicon (M1/M2/M3/M4). It uses LiveKit to handle WebRTC audio streaming, MLX-Whisper for hardware-accelerated transcription, Ollama for the local LLM brain, and Piper for offline Text-to-Speech.
- 100% Offline & Private: No API keys, no cloud processing.
- Hardware Accelerated STT: Uses Apple's
mlx-whisperfor near-instant transcription on M-Series chips. - Low Latency VAD: Uses
sileroto detect when you start and stop speaking.
- macOS with an Apple Silicon chip (M1 - M4)
- Python 3.9+
- Node.js (for the frontend playground)
- Ollama (Download here)
- LiveKit CLI & Server (
brew install livekit)
Open two separate terminal windows and run these commands to start the WebRTC and LLM servers. Leave both running in the background.
Terminal 1 (LiveKit):
livekit-server-dev
Terminal 2 (Ollama):
ollama serve
Terminal 3 (Pull the LLM): (You only need to run this once to download the model)
ollama run llama3.1
- Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate
- Install the required dependencies:
pip install "livekit-agents[openai]~=1.0" python-dotenv livekit-plugins-silero piper-tts mlx-whisper librosa numpy
- Download the Piper TTS voice model to your project folder:
mkdir -p models
python -m piper.download_voices en_GB-alan-medium --data-dir models- Run your agent:
python livekit_agent.py dev
To avoid browser security blocks (Mixed Content errors) when testing WebRTC locally, we run the official LiveKit Agents Playground.
- Clone the playground repository into a new folder:
git clone https://github.com/livekit/agents-playground.git
cd agents-playground
npm install
- Create a
.env.localfile inside theagents-playgroundfolder:
NEXT_PUBLIC_LIVEKIT_URL=ws://localhost:7880
LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=secret
- Start the frontend development server:
npm run dev
- Open your web browser and go to
http://localhost:3000. - Click the blue Connect button.
- Speak into your microphone! The system will process your voice entirely on your MacBook and reply out loud.
If the script crashes saying it can't find llama3.1, or another model of your choice, ensure the model name in your livekit_agent.py exactly matches the output of ollama list and that the model has already been downloaded using ollama pull MODEL_NAME.