This is project is an AI assistant satelite, that can access any OpenAI API compliant language model both remotely and locally thanks to NordVPN's Meshnet, Ollama and Vosk.
Consider running Ollama in a Docker container with GPU support. Ollama containers works very well through WSL. Install the NVIDIA Container Toolkit
Note: You can skip to the Container section if you will not be running Ollama with a Nvidia GPU.
- Configure the repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
- Install the NVIDIA Container Toolkit packages
sudo apt-get install -y nvidia-container-toolkit
- Configure Docker to use the Nvidia driver
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
- Start the container
With GPU support:
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
CPU only:
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
- Download and interact with the model
docker exec -it ollama ollama run llama3
There are other models available. See the official Ollama repository - Ollama/Ollama
- Exit the interactive shell
/bye
- Install NordVPN on the satellite device - Raspberry Pi 4B in my case Installing NordVPN on Linux distributions
- Log in How to log in to NordVPN on Linux devices without a GUI
- Enable Meshnet Using Meshnet on Linux
- Installing NordVPN on the host device - Windows 10 in my case Installing and using NordVPN on Windows 10 and 11
- Log in
- Enable Meshnet Using Meshnet on Windows
- Adjust the permissions for the satelite device. a. Remote Access - Enabled b. Local Network Access - Enabled Explaining permissions
- Install Miniconda Latest Miniconda installer links
- Create a new Conda environment that has Python3.9 installed
conda create --name vosk python=3.9
- Activate vosk environment
conda activate vosk
- Clone the repository
git clone https://github.com/RoseyWasTaken/ASR-AI.git
- Open the directory
cd ASR-AI
- Install the repository requirements with pip
pip install -r requirements.txt
- Download and extract the VOSK model
wget - https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip
unzip vosk-model-small-en-us-0.15.zip
- Install PortAudio package
sudo apt-get install portaudio19-dev
- Define your Microphone Device ID. In your terminal you can run:
python
Then the following lines:
import sounddevice as sd
sd.query_devices()
Output should look similar to this:
>>> import sounddevice as sd
>>> sd.query_devices()
0 Microsoft Sound Mapper - Input, MME (2 in, 0 out)
> 1 Desktop Microphone (RØDE VideoM, MME (2 in, 0 out)
2 Microphone (Steam Streaming Mic, MME (2 in, 0 out)
3 Microsoft Sound Mapper - Output, MME (0 in, 2 out)
- Replace the device number in the mic variable with the desired ID.
mic = 1
-
Replace the host device address in the ModelRequest function with the Meshnet address
-
Run the assistant.py script and use the wake word "hey robot" to activate the assistant.