This project demonstrates how to create a real-time voice assistant using the FastRTC library in Python. The assistant runs entirely on a local CPU and utilizes local models for speech-to-text and text-to-speech, ensuring privacy and low latency.
- FastRTC Library: https://fastrtc.org/
- Ollama (for running local models): https://ollama.com/
- Python: https://www.python.org/
Here are the commands used in the video to set up and run the voice assistant.
-
Install
uv(a fast Python package installer and resolver):pip install uv
-
Verify the
uvinstallation:uv --version
-
Navigate to your project directory:
cd path/to/your/project -
Create a virtual environment using
uv:uv venv
-
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate
- On Windows:
-
Run the application: This command will automatically install all required dependencies listed in your
pyproject.tomlfile and run the script.uv run python code.py
-
Download a model with Ollama: You can download different models to use with the assistant.
ollama pull <model_name>
Example used in the video:
ollama pull gemma:2b
-
List all downloaded Ollama models:
ollama list