Install uv: Install the uv package manager:
curl -LsSf https://astral.sh/uv/install.sh | shEnsure ~/.local/bin is in your PATH.
-
Ensure Docker is Installed: Verify that Docker is installed and running on your system.
-
Set Up the Environment: Create a
.envfile based on the provided.env.templatein the repository. This file should include all necessary configuration settings for the application. Ensure that:isDevelopmentMode=enabled ENV=development OPENAI_API_KEY=<your-openai-key>
Install dependencies with uv:
uv sync
This will automatically create a
.venvdirectory and install all dependencies frompyproject.toml. -
You can use the following env config to run potpie with local models:
INFERENCE_MODEL=ollama_chat/qwen2.5-coder:7b CHAT_MODEL=ollama_chat/qwen2.5-coder:7b
To run potpie with any other models, you can use the following env configuration:
{PROVIDER}_API_KEY=sk-or-your-key #your provider key e.g. OPENAI_API_KEY for Openai INFERENCE_MODEL=openrouter/deepseek/deepseek-chat #provider model name CHAT_MODEL=openrouter/deepseek/deepseek-chat #provider model nameINFERENCE_MODELandCHAT_MODELcorrespond to the models that will be used for generating knowledge graph and for agent reasoning respectively. These model names should be in the format ofprovider/model_nameformat or as expected by Litellm. For more information, refer to the Litellm documentation. -
Run Potpie: Execute the following command:
./start.sh
You may need to make it executable by running:
chmod +x start.sh
-
Start using Potpie with your local codebases!
For a production deployment with Firebase authentication, Github access, Secret Management etc
To set up Firebase, follow these steps:
- Create a Firebase Project: Go to Firebase Console and create a new project.
- Generate a Service Account Key:
- Click on Project Overview Gear ⚙ from the sidebar.
- Open the Service Accounts tab.
- Click on the option to generate a new private key in the Firebase Admin SDK sub-section.
- Read the warning and generate the key. Rename the downloaded key to
firebase_service_account.jsonand move it to the root of the potpie source code.
- Create a Firebase App
- Go to the Project Overview Gear ⚙ from the sidebar.
- Create a Firebase app.
- You will find keys for hosting, storage, and other services. Use these keys in your
.envfile.
PostHog is an open-source platform that helps us analyze user behavior on Potpie.
- Sign Up: Create a free account at PostHog and keep your API key in
.envasPOSTHOG_API_KEY, andPOSTHOG_HOST
To enable login via GitHub, create a GitHub app by following these steps:
-
Visit GitHub App Creation.
-
Name Your App: Choose a name relevant to Potpie (e.g.,
potpie-auth). -
Set Permissions:
- Repository Permissions:
- Contents: Read Only
- Metadata: Read Only
- Pull Requests: Read and Write
- Secrets: Read Only
- Webhook: Read Only
- Organization Permissions: Members : Read Only
- Account Permissions: Email Address: Read Only
- Homepage URL : https://potpie.ai
- Webhook : Inactive
- Repository Permissions:
-
Generate a Private Key: Download the private key and place it in the project root . Add your app ID to
GITHUB_APP_ID. -
Format your Private Key: Use the
format_pem.shto format your key:chmod +x format_pem.sh ./format_pem.sh your-key.pem
The formatted key will be displayed in the terminal. Copy the formatted key and add it to env under
GITHUB_PRIVATE_KEY. -
Install the App: From the left sidebar, select Install App and install it next to your organization/user account.
-
Create a GitHub Token: Go to your GitHub Settings > Developer Settings > Personal Access Tokens > Tokens (classic). Add the token to your
.envfile underGH_TOKEN_LIST
- Open Firebase and navigate to Authentication.
- Enable GitHub sign-in capability by adding a GitHub OAuth app from your account. This will provide you with a client secret and client ID to add to Firebase.
- Copy the callback URL from Firebase and add it to your GitHub app. GitHub Auth with Firebase is now ready.
Potpie uses Google Secret Manager to securely manage API keys. If you created a Firebase app, a linked Google Cloud account will be automatically created. You can use that or create a new one as needed. Follow these steps to set up the Secret Manager and Application Default Credentials (ADC) for Potpie:
-
Install gcloud CLI. Follow the official installation guide: https://cloud.google.com/sdk/docs/install
After installation, initialize gcloud CLI:
gcloud init
Say yes to configuring a default compute region. Select your local region when prompted.
-
Set up the gcloud Secret Manager API.
-
Configure Application Default Credentials for local use: https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment
Once completed, you are ready to proceed with the Potpie setup.
-
Ensure Docker is Installed: Verify that Docker is installed and running on your system.
-
Set Up the Environment: Create a
.envfile based on the provided.env.templatein the repository. This file should include all necessary configuration settings for the application. -
Google Cloud Authentication: Log in to your Google Cloud account and set up Application Default Credentials (ADC). Detailed instructions can be found in the documentation. Alternatively place the service account key file for your gcp project in service-account.json file in the root of the codebase.
-
Run Potpie: Execute the following command:
./start.sh
You may need to make it executable by running:
chmod +x start.sh