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:--impersonate-service-account expire in about an hour). Only use it when you
already have an org-provisioned lower-privilege SA and hold
roles/iam.serviceAccountTokenCreator on that account — replace the
placeholder below with a real SA email from your team; there is no default
dev-readonly@… account in this repo:SERVICE_ACCOUNT_JSON / GOOGLE_APPLICATION_CREDENTIALS are unset.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).For a self-hosted backend used by an existing Omi mobile build, set the
Firebase token audience separately from your data project:FIREBASE_AUTH_PROJECT_ID does not require Omi service-account credentials.
When it is unset, Firebase Admin uses its default project selection instead;
set the auth project explicitly when it differs from your data-project setup,
or stock mobile-build tokens will be rejected.
Do not enable LOCAL_DEVELOPMENT on an internet-accessible deployment: that
mode intentionally bypasses authentication for local harnesses.4. Optional Services
Pusher Service (for webhooks)
Pusher Service (for webhooks)
gcloud auth application-default login (leave
SERVICE_ACCOUNT_JSON unset). Only use a scoped secret for Modal/CI
compatibility paths that have not yet moved to Workload Identity (#6800).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
- Firebase projects
- Storage
- Optional
Code Formatting
We useblack for code formatting with a line length of 120 characters.