A modern, ultra-low latency web application for conversational AI via voice. AI Mate uses the GPT-5.4 family to allow real-time conversational STT/TTS (Speech-to-Text & Text-to-Speech), backed by a beautiful Glassmorphic frontend and a powerful Streamlit Admin Dashboard for persona management and history viewing.
- Ultra-Low Latency Streaming: Text is streamed directly from the
gpt-5.4-minimodel, chunked, and synthesized into MP3 bytes on the fly. The browser natively plays this HTTP stream without waiting for the full generation payload. - Glassmorphic Web Interface: A premium dark-mode graphic UI featuring intuitive Push-To-Talk micro-animations.
- Animated AI Avatar: Features a beautiful 2D digital avatar that automatically synchronizes its mouth movements and body bobbing to the generated speech audio stream in real-time.
- Streamlit Admin Dashboard: Launch a dedicated internal dashboard (
/run_streamlit) to visualize chat logs stored in Google BigQuery, manage your AI's persona parameters (persona.json), and clear histories dynamically. - Cloud Run Ready: Built on Flask and ready for highly scalable container deployments.
- Python 3.8+
- OpenAI API key
- Google Cloud SDK (for BigQuery logs and Cloud Run deployment)
-
Clone this repository:
git clone https://github.com/yourusername/ai_mate.git cd ai_mate -
Install dependencies:
pip install -r requirements.txt
-
Set your OpenAI token as an environment variable (note: the code expects
OPENAI_TOKEN):$env:OPENAI_TOKEN="your-api-key" # PowerShell # or export OPENAI_TOKEN="your-api-key" # Bash/Zsh
-
Run the Flask application locally:
python main.py
-
Open your browser and go to
http://localhost:8080. -
(Optional) Open the Streamlit Admin dashboard by clicking the
Admingear icon in the footer, or navigating directly tohttp://localhost:8501.
To deploy on Google Cloud Run:
-
Make sure you are authenticated with Google Cloud and have set your project (this is also required for the BigQuery logger):
gcloud auth login gcloud config set project YOUR_PROJECT_ID -
Deploy using the following command (replace parameters as needed):
gcloud run deploy ai-mate --allow-unauthenticated --region=asia-northeast1 --project=YOUR_PROJECT_ID --source .
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.