This project is a real-time voice assistant that runs a local AI pipeline for speed and privacy, with the ability to query a powerful remote AI for complex questions. It uses a web interface for capturing and playing back audio.
This project is designed to run on Linux with NVIDIA CUDA GPUs and uses PyTorch for local AI model acceleration.
If you haven't already, clone this project to your local machine.
It is highly recommended to use a Python virtual environment.
# Navigate to the project directory
cd voice_assistant
# Create a virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate
# Install PyTorch with CUDA support first (adjust CUDA version as needed)
# For CUDA 12.1:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# Install the required packages
pip install -r requirements.txt
Note: The first time you run the application, the AI models (Whisper, etc.) will be downloaded. This may take some time and require a significant amount of disk space. Make sure your GPU has sufficient VRAM (at least 4GB recommended).
The application uses the Groq API for complex questions. You will need an API key from Groq.
.env file:
cp .env.example .env
.env file and replace "YOUR_GROQ_API_KEY_HERE" with your actual Groq API key.STT_BACKEND (default: kyutai)
kyutai: Kyutai delayed-streams-modeling STT on MLX (moshi_mlx)funasr: MLX Fun-ASR Nano via mlx-audio-pluswhisper: Whisper tiny via TransformersTURN_TAKING_BACKEND (default: smart_turn)
smart_turn: pipecat Smart Turn v3 (audio-native endpoint model)silero: Silero VAD + prosody heuristicsSmart Turn model selection
SMART_TURN_REPO_ID default is pipecat-ai/smart-turn-v3SMART_TURN_ONNX_FILENAME optional (if the repo file name changes)SMART_TURN_THRESHOLD (default 0.5)SMART_TURN_MIN_SILENCE_MS (default 220) how much trailing silence before running Smart TurnSMART_TURN_MIN_INTERVAL_MS (default 220) rate limit for Smart Turn calls during silenceGatekeeper VAD (speech/silence + barge-in)
TURN_TAKING_BACKEND=smart_turn, we still run a lightweight VAD to gate Smart Turn and support barge-in.SILERO_VAD_FORCE_FALLBACK=1TURN_TAKING_BACKEND to decide Hold vs Shift.The server can stream partial stt_partial updates (live-updating the “You:” line):
STT_STREAMING:
auto (default): only Kyutai native partialson: enable best-effort partials for Whisper/FunASR too (auto-disables per session if too slow)off: disable partial STT updatesSTT_STREAM_INTERVAL_MS (default 600): how often to send partials (Whisper/FunASR).STT_STREAM_WINDOW_MS (default 1600): sliding window size used for partial decoding (Whisper/FunASR).STT_STREAM_MAX_RTF (default 1.0): if decode is slower than realtime, partials are disabled for that session.Start the Server:
Make sure your virtual environment is activated. In the voice_assistant directory, run the following command:
uvicorn server.main:app --reload
The server will start on http://localhost:8000.
Open the Client:
Open your web browser and navigate to:
The web page will load, and the status should indicate that it is "Ready to speak".
Interact with the Assistant:
user_text: final transcription.stt_token: live incremental input text (token/delta streaming; emitted by FunASR MLX when enabled).llm_partial: growing assistant text as tokens stream.llm_chunk: text chunk that was just sent to TTS (optional for display).audio_chunk: base64 WAV chunk; play in arrival order.stream_done: final assistant text; marks end of this turn.error: message if something went wrong.Enjoy your private, locally-run voice assistant!
10 commits
2 commits
Python
68.9%
JavaScript
19.0%
HTML
12.1%
This project is a real-time voice assistant that runs a local AI pipeline for speed and privacy, with the ability to query a powerful remote AI for complex questions. It uses a web interface for capturing and playing back audio.
This project is designed to run on Linux with NVIDIA CUDA GPUs and uses PyTorch for local AI model acceleration.
If you haven't already, clone this project to your local machine.
It is highly recommended to use a Python virtual environment.
# Navigate to the project directory
cd voice_assistant
# Create a virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate
# Install PyTorch with CUDA support first (adjust CUDA version as needed)
# For CUDA 12.1:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# Install the required packages
pip install -r requirements.txt
Note: The first time you run the application, the AI models (Whisper, etc.) will be downloaded. This may take some time and require a significant amount of disk space. Make sure your GPU has sufficient VRAM (at least 4GB recommended).
The application uses the Groq API for complex questions. You will need an API key from Groq.
.env file:
cp .env.example .env
.env file and replace "YOUR_GROQ_API_KEY_HERE" with your actual Groq API key.STT_BACKEND (default: kyutai)
kyutai: Kyutai delayed-streams-modeling STT on MLX (moshi_mlx)funasr: MLX Fun-ASR Nano via mlx-audio-pluswhisper: Whisper tiny via TransformersTURN_TAKING_BACKEND (default: smart_turn)
smart_turn: pipecat Smart Turn v3 (audio-native endpoint model)silero: Silero VAD + prosody heuristicsSmart Turn model selection
SMART_TURN_REPO_ID default is pipecat-ai/smart-turn-v3SMART_TURN_ONNX_FILENAME optional (if the repo file name changes)SMART_TURN_THRESHOLD (default 0.5)SMART_TURN_MIN_SILENCE_MS (default 220) how much trailing silence before running Smart TurnSMART_TURN_MIN_INTERVAL_MS (default 220) rate limit for Smart Turn calls during silenceGatekeeper VAD (speech/silence + barge-in)
TURN_TAKING_BACKEND=smart_turn, we still run a lightweight VAD to gate Smart Turn and support barge-in.SILERO_VAD_FORCE_FALLBACK=1TURN_TAKING_BACKEND to decide Hold vs Shift.The server can stream partial stt_partial updates (live-updating the “You:” line):
STT_STREAMING:
auto (default): only Kyutai native partialson: enable best-effort partials for Whisper/FunASR too (auto-disables per session if too slow)off: disable partial STT updatesSTT_STREAM_INTERVAL_MS (default 600): how often to send partials (Whisper/FunASR).STT_STREAM_WINDOW_MS (default 1600): sliding window size used for partial decoding (Whisper/FunASR).STT_STREAM_MAX_RTF (default 1.0): if decode is slower than realtime, partials are disabled for that session.Start the Server:
Make sure your virtual environment is activated. In the voice_assistant directory, run the following command:
uvicorn server.main:app --reload
The server will start on http://localhost:8000.
Open the Client:
Open your web browser and navigate to:
The web page will load, and the status should indicate that it is "Ready to speak".
Interact with the Assistant:
user_text: final transcription.stt_token: live incremental input text (token/delta streaming; emitted by FunASR MLX when enabled).llm_partial: growing assistant text as tokens stream.llm_chunk: text chunk that was just sent to TTS (optional for display).audio_chunk: base64 WAV chunk; play in arrival order.stream_done: final assistant text; marks end of this turn.error: message if something went wrong.Enjoy your private, locally-run voice assistant!
10 commits
2 commits
Python
68.9%
JavaScript
19.0%
HTML
12.1%