Overview
The Omi backend powers all AI capabilities including transcription, conversation processing, chat, and integrations. This guide will help you set up a local development environment.Video Walkthrough
Prerequisites
Before starting, gather these API keys and credentials:Required Services
Optional Services
1. Google Cloud & Firebase Setup
Install Google Cloud SDK
- macOS
- Windows
- Linux/Nix
Enable Required APIs
Cloud Resource Manager API
Firebase Management API
Authenticate with Google Cloud
<project-id> with your Google Cloud project ID:~/.config/gcloud/application_default_credentials.json.Copy Credentials to Backend
- macOS/Linux
- Windows
2. OAuth Authentication Setup
OAuth is required for user authentication. You need to configure both Google and Apple sign-in.- Google OAuth
- Apple OAuth
Create OAuth 2.0 Client
- Go to Google Cloud Console → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Select Web application as the application type
- Set a name (e.g., “Omi Backend Auth”)
Configure Authorized Origins
https://your-domain.com(production)https://your-ngrok-domain.ngrok-free.app(local development)
Configure Redirect URIs
https://your-domain.com/v1/auth/callback/googlehttps://your-ngrok-domain.ngrok-free.app/v1/auth/callback/google
Save Credentials
.env file.Configure Consent Screen
- Fill in required app information
- Add your domain to Authorized domains
- Add scopes:
openid,email,profile
3. Backend Installation
Clone the Repository
Install System Dependencies
- macOS
- Windows
- Linux/Nix
Set Up Python Virtual Environment
- macOS/Linux
- Windows PowerShell
(.venv) at the beginning of your command prompt.Update Python Dependencies
requirements*.txt input, then refresh the locks:PYLOCK_UPGRADE=1 ./scripts/update-python-lock.sh only when intentionally upgrading dependency versions.Create Environment File
.env and fill in your API keys (see Environment Variables below).4. Optional Services
Pusher Service (for webhooks)
Pusher Service (for webhooks)
.env file and set SERVICE_ACCOUNT_JSON to your Google credentials string.Start the service:Typesense (for search)
Typesense (for search)
- Create an account on Typesense
- Create a collection named
conversationsusing the schema intypesense/conversations.schema - Install the Firebase Typesense extension
typesense_sync collection and add a document named backfill with {'trigger': true}.5. Running the Backend
Set Up Ngrok Tunnel
- Sign up at ngrok.com and install Ngrok
- Authenticate with your account
- Start the tunnel:
https://your-domain.ngrok-free.app).Start the Backend Server
Connect the Omi App
.dev.env file, set:When You're Done
Troubleshooting
SSL certificate errors during model downloads
SSL certificate errors during model downloads
utils/stt/vad.py:API key issues
API key issues
- Double-check all API keys in your
.envfile - Ensure there are no trailing spaces or quotes around values
- Verify keys are active and not expired
Ngrok connection issues
Ngrok connection issues
- Ensure your Ngrok tunnel is running
- Verify the URL is correctly set in the Omi app
- Check that OAuth redirect URIs match your Ngrok URL
Module not found errors
Module not found errors
Virtual environment not activating
Virtual environment not activating
- On Windows, you may need to enable script execution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Make sure you’re using Python 3.11
Environment Variables
Complete reference for all.env variables:
- Required
- OAuth
- Storage
- Optional
Code Formatting
We useblack for code formatting with a line length of 120 characters.