Flame Audio AI is a powerful speech transcription, translation, and AI chat application built by FlameheadLabs. It allows users to easily convert spoken language to text through recorded audio or uploaded files, with optional account creation for saving transcription history and chatting with AI agents about your documents.
- Live Audio Recording: Record audio directly in the browser with high-quality settings
- File Upload: Support for multiple audio formats (flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm)
- Multiple Models: Integration with Groq API's advanced audio transcription models
- Language Support: Automatic language detection or manual language selection
- Task Options: Transcribe in original language or translate to English
- Vector Store Integration: Store and retrieve documents using advanced vector embeddings
- Multiple Embedding Models: Select from various embedding models for optimal semantic search
- Customizable Chunking: Configure chunk size and overlap to optimize document retrieval
- Document Organization: Associate documents with specific AI agents
- Dedicated Service for Audio and Chat Processing: The MCP backend provides scalable, isolated processing for audio, chat, and agent tools.
- Status Monitoring and Tool Management: Configure and monitor MCP status, manage tools, and enable advanced orchestration features.
- AI Chat Agents: Create customizable AI agents with different personalities and expertise
- Document-Aware Chat: Chat about your transcribed documents with contextual understanding
- Chat Session Management: Save and reload chat sessions for continued conversations
- Realtime Updates: Vector store configurations update in real-time across the application
- Intuitive Navigation: Easily move between Home, Playground, Documents, MCP, and Chat interfaces
- Responsive Design: Clean, modern UI that works across devices
- Flexible Authentication: Optional user authentication that can be enabled/disabled via configuration
- Persistent Settings: User preferences persist between sessions
- Python 3.9+
- FastAPI backend server
- Groq API key
- PostgreSQL database
- Supabase account (for authentication features, optional if AUTH_ENABLED=false)
git clone https://github.com/Flamehead-Labs-Ug/flame-audio.git
cd flame-audiopython -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r requirements.txtCopy the .env.template file to .env and fill in your API keys:
cp .env.template .env
# Edit the .env file with your credentialsRequired environment variables:
GROQ_API_KEY: Your Groq API keyBACKEND_URL: URL for the FastAPI backend (e.g., http://localhost:8000)FRONTEND_URL: URL for the Streamlit frontend (e.g., http://localhost:8501)SUPABASE_URLandSUPABASE_ANON_KEY: Only required if AUTH_ENABLED=trueDATABASE_URL: PostgreSQL connection string
Optional configuration:
AUTH_ENABLED: Set to "true" to enable authentication or "false" to disable it (default: "true")API_KEY_INPUT_ENABLED: Set to "true" to show the API key input field or "false" to hide it and use only the key from .env (default: "true")EMBEDDING_PROVIDER: Choose embedding provider ("local", "openai", or "hf-inference")HUGGINGFACE_API_KEY: Required if using HuggingFace Inference API for embeddings
Here's an example of what your .env file might look like:
# Groq API Configuration
GROQ_API_KEY=your_groq_api_key
API_KEY_INPUT_ENABLED=true # Set to false to hide the API key input field
# Backend URL Configuration (required)
BACKEND_URL=http://localhost:8000 # Required
FRONTEND_URL=http://localhost:8501 # URL for the Streamlit frontend
# Supabase Configuration for Authentication
SUPABASE_URL=your_supabase_url_here
SUPABASE_ANON_KEY=your_supabase_anon_key_here
AUTH_ENABLED=true # Set to false to disable authentication
# Database Configuration
DATABASE_URL=postgresql://username:password@localhost:5432/flame_audio
# Vector Store Configuration
EMBEDDING_PROVIDER=hf-inference # Options: local, openai, hf-inference
HUGGINGFACE_API_KEY=your_huggingface_api_key # Only needed for hf-inference
python -m uvicorn main:app --reloadIn a new terminal window:
streamlit run flamehome.pyOpen your web browser and navigate to:
http://localhost:8501
- Authentication: Log in or create an account (if authentication is enabled)
- API Key: Enter your Groq API key in the sidebar
- Select Model: Choose a speech transcription model from the dropdown
- Create Audio: Either record audio directly with the microphone button or upload an audio file
- Task Selection: Choose between transcription (original language) or translation (to English)
- Process Audio: Click the Transcribe/Translate button to process your audio
- Save Document: Save transcribed content to your vector store for future reference
- Access the Documents page to view all your saved transcriptions
- Filter documents by agent or search for specific content
- Configure vector store settings for optimal document retrieval
- Delete documents you no longer need
- Create or Select an Agent: Choose an existing agent or create a new one
- Configure Settings: Adjust model settings, system prompt, and vector store parameters
- Choose Documents: Select a specific document the agent should focus on
- Start Chatting: Engage in conversation with the AI about your transcribed content
- Manage Sessions: Save multiple chat sessions and switch between them
- Vector Store Configuration: Fine-tune embedding model, chunk size, and similarity thresholds
- Language Selection: Manually select the source language or use auto-detection
- Chunk Length: Control how audio is divided for processing (in seconds)
- Overlap: Set overlap between chunks for smoother transitions
- Temperature: Adjust randomness in model output
The application uses separate Groq API endpoints for different tasks:
- Transcription: https://api.groq.com/openai/v1/audio/transcriptions
- Translation: https://api.groq.com/openai/v1/audio/translations
Authentication is handled by Supabase and can be enabled/disabled through the AUTH_ENABLED environment variable.
This guide will help you deploy the Flame Audio application on an AWS EC2 instance with Nginx as a reverse proxy.
Launch an Ubuntu EC2 instance with at least 2GB RAM. Make sure to allow HTTP (port 80) and HTTPS (port 443) traffic in your security group settings.
ssh -i your-key.pem ubuntu@your-ec2-public-ipsudo apt update
sudo apt install -y python3-pip python3-venv nginx certbot python3-certbot-nginx ffmpeggit clone https://github.com/Flamehead-Labs-Ug/flame-audio.git
cd flame-audiopython3 -m venv venv
source venv/bin/activate
pip install -U pip
pip install -r requirements.txtcp .env.template .env
nano .envEdit the .env file to set your configuration:
GROQ_API_KEY=your_groq_api_key
API_KEY_INPUT_ENABLED=false
AUTH_ENABLED=true
BACKEND_URL=https://your-domain-name/api # Use your domain name if configured
FRONTEND_URL=https://your-domain-name # Must match your domain name for authentication to work
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
DATABASE_URL=postgresql://username:password@localhost:5432/flame_audio
Important: When using a custom domain, make sure both
BACKEND_URLandFRONTEND_URLuse your domain name rather than the EC2 IP address. This is crucial for authentication workflows and API requests to function correctly.
sudo nano /etc/systemd/system/flame-fastapi.serviceAdd the following content:
[Unit]
Description=Flame Audio FastAPI Backend
After=network.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/flame-audio
EnvironmentFile=/home/ubuntu/flame-audio/.env
ExecStart=/home/ubuntu/flame-audio/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000
Restart=always
[Install]
WantedBy=multi-user.target
sudo nano /etc/systemd/system/flame-streamlit.serviceAdd the following content:
[Unit]
Description=Flame Audio Streamlit Frontend
After=network.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/flame-audio
EnvironmentFile=/home/ubuntu/flame-audio/.env
ExecStart=/home/ubuntu/flame-audio/venv/bin/streamlit run flamehome.py --server.address=0.0.0.0 --server.port=8501
Restart=always
[Install]
WantedBy=multi-user.target
sudo nano /etc/systemd/system/flame-mcp.serviceAdd the following content:
[Unit]
Description=Flame Audio MCP Backend
After=network.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/flame-audio
EnvironmentFile=/home/ubuntu/flame-audio/.env
ExecStart=/home/ubuntu/flame-audio/venv/bin/python -m mcp.main --host 0.0.0.0 --port 8001
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl start flame-fastapi
sudo systemctl enable flame-fastapi
sudo systemctl start flame-streamlit
sudo systemctl enable flame-streamlit
sudo systemctl start flame-mcp
sudo systemctl enable flame-mcpsudo nano /etc/nginx/sites-available/flame-audioAdd the following content, replacing your-domain-name with your actual domain and your-ec2-public-ip with your EC2 instance's public IP address:
server {
server_name your-domain-name your-ec2-public-ip;
client_max_body_size 100M;
# FastAPI Backend
location /api/ {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://your-ec2-public-ip:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100M;
}
# MCP Backend
location /mcp/ {
rewrite ^/mcp/(.*)$ /$1 break;
proxy_pass http://your-ec2-public-ip:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100M;
}
# Streamlit Frontend
location / {
proxy_pass http://your-ec2-public-ip:8501;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 86400;
}
}
sudo ln -s /etc/nginx/sites-available/flame-audio /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxsudo certbot --nginx -d your-domain-nameAccess your application by visiting your domain name in a browser. You should see the Flame Audio interface.
If you see "502 Bad Gateway" errors when accessing your application:
-
Check if services are running:
sudo systemctl status flame-fastapi sudo systemctl status flame-streamlit
-
Verify both services are accessible directly:
curl http://localhost:8000/languages curl http://localhost:8501 -I
-
Install ffmpeg if it's missing:
sudo apt install -y ffmpeg
-
Check Nginx error logs:
sudo tail -n 50 /var/log/nginx/error.log
-
If you see "Connection refused" errors, update your Nginx config to use your EC2 public IP directly in the proxy_pass directives.
If users can see each other's logins or authentication isn't working properly:
-
Make sure FRONTEND_URL and BACKEND_URL are correctly set in your .env file.
-
Consider disabling authentication for testing by setting
AUTH_ENABLED=falsein your .env file. -
Check for Supabase version compatibility issues. If you see proxy-related errors:
pip uninstall -y supabase gotrue httpx postgrest realtime storage3 supafunc pip install supabase==1.0.3 gotrue==1.0.1
To update your deployment with the latest code:
cd ~/flame-audio
git pull
sudo systemctl restart flame-fastapi
sudo systemctl restart flame-streamlit
sudo systemctl restart nginxContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Website: http://flameheadlabs.tech/
- GitHub: https://github.com/Flamehead-Labs-Ug/flame-audio
- Twitter: https://x.com/flameheadlabsug
- LinkedIn: https://www.linkedin.com/in/flamehead-labs-919910285
Powered by FlameheadLabs AI