Skip to content

Commit

Permalink
docs: Update Backend Setup documentation with direct API key links an…
Browse files Browse the repository at this point in the history
…d improved guidance
  • Loading branch information
skywinder committed Mar 10, 2025
1 parent 352af95 commit ddd6bd4
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions docs/docs/developer/backend/Backend_Setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Before you start, make sure you have the following:

- **Google Cloud Project:** You need a Google Cloud project with Firebase enabled. If you've already set up Firebase for the Omi app, you're good to go.
- **API Keys: 🔑** Obtain API keys for:
- **OpenAI:** For AI language models ([platform.openai.com](https://platform.openai.com/))
- **Deepgram:** For speech-to-text ([deepgram.com](https://deepgram.com/))
- **Redis:** Upstash is recommended ([upstash.com](https://upstash.com/))
- **Pinecone:** For vector database; use "text-embedding-3-large" model ([pinecone.io](https://www.pinecone.io/))
- **Modal: [optional]** For serverless deployment ([modal.com](https://modal.com/))
- **Hugging Face:** For voice activity detection ([huggingface.co](https://huggingface.co/))
- **GitHub:[optional]** For firmware updates ([github.com](https://github.com/))
- **Google Maps API Key: [optional]** For location features ([mapsplatform.google.com](https://mapsplatform.google.com/))
- **Typesense Credentials:** For search functionality ([typesense.org](https://typesense.org/))
- **Stripe Credentials: [optional]** For paid apps payment processing ([stripe.com](https://stripe.com/))
- **OpenAI:** For AI language models ([OpenAI API Keys](https://platform.openai.com/settings/organization/api-keys))
- **Deepgram:** For speech-to-text ([Deepgram API Keys](https://console.deepgram.com/api-keys))
- **Redis:** Upstash is recommended ([Upstash Redis Console](https://console.upstash.com/))
- **Pinecone:** For vector database; use "text-embedding-3-large" model ([Pinecone API Keys](https://app.pinecone.io/organizations/-/projects/-/api-keys))
- **Modal: [optional]** For serverless deployment ([Modal Dashboard](https://modal.com/settings#tokens))
- **Hugging Face:** For voice activity detection ([Hugging Face Access Tokens](https://huggingface.co/settings/tokens))
- **GitHub:[optional]** For firmware updates ([GitHub Personal Access Tokens](https://github.com/settings/tokens))
- **Google Maps API Key: [optional]** For location features ([Google Maps API Key](https://console.cloud.google.com/google/maps-apis/credentials))
- **Typesense Credentials:** For search functionality ([Typesense Cloud Dashboard](https://cloud.typesense.org/clusters))
- **Stripe Credentials: [optional]** For paid apps payment processing ([Stripe API Keys](https://dashboard.stripe.com/apikeys))

**Note:** If you are not very experienced in backend development, we recommend installing [Homebrew](https://docs.brew.sh/Installation) (for macOS or Linux) or [Chocolatey](https://chocolatey.org/install) (for Windows).

#### Video Walkthrough
Expand All @@ -42,8 +42,8 @@ Before you start, make sure you have the following:
- Select your project
- Navigate to APIs & Services -> Library
- Enable the following APIs:
- Cloud Resource Manager API
- Firebase Management API
- [Cloud Resource Manager API](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com)
- [Firebase Management API](https://console.cloud.google.com/apis/library/firebase.googleapis.com)

3. **Authenticate with Google Cloud: 🔐**
- Open your terminal
Expand Down Expand Up @@ -81,7 +81,7 @@ Before you start, make sure you have the following:
```bash
git clone https://github.com/BasedHardware/Omi.git
cd Omi
cd backend
cd backend
```

3. **Set up Pusher Service: 📡 [Optional]**
Expand Down Expand Up @@ -119,15 +119,15 @@ Before you start, make sure you have the following:
cp .env.template .env
```
- Open the `.env` file and fill in the following:
- **OPENAI_API_KEY:** Obtained from your OpenAI account
- **DEEPGRAM_API_KEY:** Obtained from your Deepgram account
- **Redis Credentials:** Host, port, username, and password for your Redis instance
- **Modal API Key:** Obtained from your Modal account
- **OPENAI_API_KEY:** Obtained from your [OpenAI API Settings](https://platform.openai.com/settings/organization/api-keys)
- **DEEPGRAM_API_KEY:** Obtained from your [Deepgram Console](https://console.deepgram.com/api-keys)
- **Redis Credentials:** Host, port, username, and password from your [Upstash Redis Console](https://console.upstash.com/)
- **Modal API Key:** Obtained from your [Modal Dashboard](https://modal.com/settings#tokens)
- **ADMIN_KEY:** Set to a temporary value (e.g., `123`) for local development
- **HOSTED_PUSHER_API_URL:** Endpoint of your hosted pusher service (if you are using it, see step 3)
- **Typesense Credentials:** Host, port, and API key for your Typesense instance (if you are using it, see step 4)
- **Typesense Credentials:** Host, port, and API key from your [Typesense Cloud Dashboard](https://cloud.typesense.org/clusters)
- **NO_SOCKET_TIMEOUT: (Optional)** Set to `True` to disable the socket timeout for the backend server (socket will stay connected for as long as the app is open)
- **Other API Keys:** Fill in any other API keys required by your integrations (e.g., Google Maps API key)
- **Other API Keys:** Fill in any other API keys required by your integrations (e.g., [Google Maps API key](https://console.cloud.google.com/google/maps-apis/credentials))

5. **Install Python Dependencies: 📚**
- In your terminal (inside the backend directory), run:
Expand All @@ -142,14 +142,14 @@ Before you start, make sure you have the following:
- Follow their instructions to authenticate Ngrok with your account
- During the onboarding, Ngrok will provide you with a command to create a tunnel to your localhost. Modify the port in the command to `8000` (the default port for the backend). For example:
```bash
ngrok http --domain=example.ngrok-free.app 8000
ngrok http --domain=example.ngrok-free.app 8000
```
- Run this command in your terminal. Ngrok will provide you with a public URL (like `https://example.ngrok-free.app`) that points to your local backend

2. **Start the Backend Server: 🖥️**
- In your terminal, run:
```bash
uvicorn main:app --reload --env-file .env
uvicorn main:app --reload --env-file .env
```
- `--reload` automatically restarts the server when code changes are saved, making development easier
- `--env-file .env` loads environment variables from your `.env` file
Expand Down Expand Up @@ -178,21 +178,19 @@ Now, your Omi app should be successfully connected to the locally running backen

Here's a detailed explanation of each environment variable you need to define in your `.env` file:

- **`HUGGINGFACE_TOKEN`:** Your Hugging Face Hub API token, used to download models for speech processing (like voice activity detection)
- **`HUGGINGFACE_TOKEN`:** Your [Hugging Face Hub API token](https://huggingface.co/settings/tokens), used to download models for speech processing (like voice activity detection)
- **`BUCKET_SPEECH_PROFILES`:** The name of the Google Cloud Storage bucket where user speech profiles are stored
- **`BUCKET_BACKUPS`:** The name of the Google Cloud Storage bucket used for backups (if applicable)
- **`GOOGLE_APPLICATION_CREDENTIALS`:** The path to your Google Cloud service account credentials file (`google-credentials.json`). This file is generated in step 3 of **I. Setting Up Google Cloud &
Firebase**
- **`PINECONE_API_KEY`:** Your Pinecone API key, used for vector database operations. Storing Memory Embeddings: Each memory is converted into a numerical representation (embedding). Pinecone
efficiently stores these embeddings and allows Omi to quickly find the most relevant memories related to a user's query
- **`GOOGLE_APPLICATION_CREDENTIALS`:** The path to your [Google Cloud service account credentials file](https://console.cloud.google.com/iam-admin/serviceaccounts) (`google-credentials.json`). This is generated in step 3 of **I. Setting Up Google Cloud & Firebase**
- **`PINECONE_API_KEY`:** Your [Pinecone API key](https://app.pinecone.io/organizations/-/projects/-/api-keys), used for vector database operations. Storing Memory Embeddings: Each memory is converted into a numerical representation (embedding). Pinecone efficiently stores these embeddings and allows Omi to quickly find the most relevant memories related to a user's query
- **`PINECONE_INDEX_NAME`:** The name of your Pinecone index where memory embeddings are stored
- **`REDIS_DB_HOST`:** The host address of your Redis instance
- **`REDIS_DB_PORT`:** The port number of your Redis instance
- **`REDIS_DB_PASSWORD`:** The password for your Redis instance
- **`DEEPGRAM_API_KEY`:** Your Deepgram API key, used for real-time and pre-recorded audio transcription
- **`DEEPGRAM_API_KEY`:** Your [Deepgram API key](https://console.deepgram.com/api-keys), used for real-time and pre-recorded audio transcription
- **`ADMIN_KEY`:** A temporary key used for authentication during local development (replace with a more secure method in production)
- **`OPENAI_API_KEY`:** Your OpenAI API key, used for accessing OpenAI's language models for chat, memory processing, and more
- **`GITHUB_TOKEN`:** Your GitHub personal access token, used to access GitHub's API for retrieving the latest firmware version
- **`OPENAI_API_KEY`:** Your [OpenAI API key](https://platform.openai.com/settings/organization/api-keys), used for accessing OpenAI's language models for chat, memory processing, and more
- **`GITHUB_TOKEN`:** Your [GitHub personal access token](https://github.com/settings/tokens), used to access GitHub's API for retrieving the latest firmware version
- **`WORKFLOW_API_KEY`:** Your custom API key for securing communication with external workflows or integrations

Make sure to replace the placeholders (`<api-key>`, `<bucket-name>`, etc.) with your actual values.
Expand All @@ -211,4 +209,3 @@ If you're stuck, have questions, or just want to chat about Omi:
- **Documentation: 📚** Check out our [full documentation](https://docs.omi.me/) for in-depth guides

Happy coding! 💻 If you have any questions or need further assistance, don't hesitate to reach out to our community.

0 comments on commit ddd6bd4

Please sign in to comment.