Your AI companion to support you during your lows and highs, providing intelligent, real-time assistance.
The AI Companion is a low-latency voice assistant that:
- Converts voice input to text using OpenAI's Whisper.
- Processes text using Hugging Face's Large Language Model (LLM).
- Converts responses back to speech with Edge-TTS.
- Features a web interface and real-time performance optimization for seamless interaction.
- Voice Activity Detection (VAD): Detects speech activity and ignores silence.
- Speech-to-Text (STT): High-accuracy transcription using the
faster-whisper
model. - Text-to-Speech (TTS): Converts text to natural speech with tunable pitch, speed, and voice type.
- LLM Integration: Generates intelligent responses with Hugging Face models.
- Streamlit Interface: Offers a user-friendly web-based interaction mode.
-
Run the following command to install Daytona:
curl -sf -L https://download.daytona.io/daytona/install.sh | sudo bash
-
Start the Daytona server:
daytona server -y && daytona
-
If the server daemon stops at any point, restart it using:
daytona serve
-
Create a workspace for the AI Companion:
daytona create https://github.com/Ankur2606/AI-Companion.git --devcontainer-path=.devcontainer/devcontainer.json
-
Ensure dependencies are installed (if not already present):
apt-get update && apt-get install -y portaudio19-dev python3-pyaudio pip install black pylint autopep8 yapf bandit flake8 mypy pycodestyle pydocstyle
- Python 3.11+
- Git
- Hugging Face API Token
-
Clone the Repository:
git clone https://github.com/Ankur2606/AI-Companion.git cd AI-Companion
-
Install System Dependencies (if not available):
sudo apt-get update && sudo apt-get install -y portaudio19-dev python3-pyaudio
-
Set Up a Virtual Environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install Development Dependencies:
pip install black pylint autopep8 yapf bandit flake8 mypy pycodestyle pydocstyle
-
Install Project Dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Configure Hugging Face Token:
- Create an account at Hugging Face and generate an API token.
- Set the token as an environment variable:
export HUGGINGFACE_API_TOKEN=your_token # On Windows: set HUGGINGFACE_API_TOKEN=your_token
-
Run the Application:
streamlit run app.py
Run the project through Daytona for optimized performance:
-
Start Daytona if not already running:
daytona serve
-
Launch the AI Companion:
daytona run
- Web Interface:
Launch the Streamlit web app:
streamlit run app.py
-
Daytona Server Issues:
If the server stops, restart it with:daytona serve
-
Initial Model Downloads:
Thefaster-whisper
model may take time to download (~2GB). Ensure a stable internet connection. -
Environment Variable Issues:
Verify the Hugging Face API token is correctly set in your environment.
We welcome contributions! Please feel free to:
- Open issues for bugs or suggestions.
- Submit pull requests for improvements.
This project is licensed under the MIT License.