Skip to content

Reference

Configuration

The API and the worker read the same settings, from environment variables or from backend/.env. Variable names are case-insensitive. Start from backend/.env.example.

GitHub App

See Create the GitHub App for where each value comes from.

VariableRequiredDefaultDescription
GITHUB_APP_IDYes—Numeric App ID of your GitHub App.
GITHUB_CLIENT_IDYes—OAuth Client ID of the app, used for “Login with GitHub”.
GITHUB_CLIENT_SECRET_IDYes—OAuth client secret of the app.
GITHUB_WEBHOOK_SECRETYes—Secret used to verify webhook signatures. Deliveries are rejected without it.
GITHUB_SECRET_KEY_PATHYes—Path to the app’s private key (.pem). Docker Compose sets this for you.

LLM provider

Metis calls models through LiteLLM, so switching providers is a configuration change. Set MODEL_NAME, then add the credentials that provider expects. LiteLLM reads them straight from the environment or from backend/.env.

VariableRequiredDefaultDescription
MODEL_NAMEYesvertex_ai/zai-org/glm-4.7-maasA LiteLLM model string. The prefix selects the provider. The model must support tool calling.
VERTEX_PROJECTNo—Google Cloud project ID. Vertex AI only.
VERTEX_LOCATIONNo—Vertex AI region. Gemini 3 models need global.
backend/.env — pick one
# OpenAI
MODEL_NAME=gpt-4o
OPENAI_API_KEY=sk-...

# Anthropic
MODEL_NAME=anthropic/claude-sonnet-5-5
ANTHROPIC_API_KEY=sk-ant-...

# Mistral
MODEL_NAME=mistral/mistral-large-latest
MISTRAL_API_KEY=...

# Azure OpenAI (the part after azure/ is your deployment name)
MODEL_NAME=azure/my-gpt-4o-deployment
AZURE_API_KEY=...
AZURE_API_BASE=https://my-resource.openai.azure.com
AZURE_API_VERSION=2024-10-21

# Google Vertex AI
MODEL_NAME=vertex_ai/gemini-3-flash-preview
VERTEX_PROJECT=my-gcp-project
VERTEX_LOCATION=global

Vertex AI credentials

  • Running natively: run gcloud auth application-default login once.
  • Docker Compose: save a service account key with the Vertex AI User role as backend/secrets/gcp-sa.json. It is mounted into the API and worker, and GOOGLE_APPLICATION_CREDENTIALS points at it.

Application & security

VariableRequiredDefaultDescription
FRONTEND_URLYes—Public URL of the dashboard. Used for CORS, the OAuth redirect, and links in review comments.
JWT_SECRET_KEYYes—Random secret that signs session tokens.
JWT_ACCESS_TOKEN_EXPIRE_MINUTESNo60Lifetime of the access token cookie.
JWT_REFRESH_TOKEN_EXPIRE_DAYSNo7Lifetime of the refresh token cookie.
ENCRYPTION_KEYYes—Fernet key that encrypts users’ GitHub tokens in the database. Changing it invalidates stored tokens.

Generate the two secrets with:

bash
openssl rand -hex 32                       # JWT_SECRET_KEY
openssl rand -base64 32 | tr '+/' '-_'     # ENCRYPTION_KEY

Database, Redis & Celery

Docker Compose sets these for you. You only need them when you run the processes yourself or point Metis at managed services.

VariableRequiredDefaultDescription
DATABASE_URLYes—Async SQLAlchemy URL, e.g. postgresql+asyncpg://user:pass@host:5432/metis.
DATABASE_POOL_SIZENo20Connections kept open per process.
DATABASE_MAX_OVERFLOWNo10Extra connections allowed under load.
REDIS_URLYes—Redis connection URL, e.g. redis://localhost:6379/0.
CELERY_BROKER_URLYes—Redis URL the worker pulls jobs from.
CELERY_RESULT_BACKENDYes—Redis URL for task results. Use a separate database number from the broker.
CELERY_TASK_TIME_LIMITNo600Default hard time limit in seconds. Agent tasks set their own, longer hard limits.
CELERY_TASK_SOFT_TIME_LIMITNo540Soft time limit in seconds, applied to every task. Raise it if reviews of very large PRs get cut off.

Daytona sandboxes

Every agent run gets a fresh sandbox. Metis clones the repository into it, the agent's tools run inside it, and the sandbox is deleted when the run ends.

VariableRequiredDefaultDescription
DAYTONA_API_KEYYes—API key from your Daytona dashboard.
DAYTONA_API_URLYes—API endpoint, e.g. https://app.daytona.io/api for Daytona Cloud.
DAYTONA_TARGETYes—Region where sandboxes run, e.g. us or eu on Daytona Cloud.

Self-hosting Daytona

Daytona's own repository ships a Compose setup for running it locally:

bash
git clone https://github.com/daytonaio/daytona.git
cd daytona
docker compose -f docker/docker-compose.yaml up -d
# dashboard on http://localhost:3000 (dev@daytona.io / password)

Create an API key in that dashboard and set DAYTONA_API_URL to http://localhost:3000/api. If the Metis worker runs in a container, use host.docker.internal instead of localhost. Daytona's stack also uses port 5050 for pgAdmin, so stop the Metis pgAdmin or remap one of them. See the Daytona docs for production setups.

Tracing (optional)

VariableRequiredDefaultDescription
LANGSMITH_TRACINGNotrueSends every LLM call to LangSmith. Set to false if you don’t use it.
LANGSMITH_API_KEYNo—LangSmith API key.
LANGSMITH_PROJECTNo—LangSmith project that traces are grouped under.
LANGSMITH_ENDPOINTNo—Override for self-hosted LangSmith.

Per-repository review settings

Review behavior is configured per repository from the dashboard's AI Review page, not through environment variables:

  • Sensitivity: LOW flags only critical bugs, security holes, and data-corruption risks. MEDIUM (the default) covers the few most important bugs, security, and error-handling problems. HIGH adds performance, design, and missing tests.
  • Custom instructions: free text added to the reviewer's instructions, such as team conventions or areas to focus on.
  • Ignore patterns: file patterns the reviewer skips, such as *.lock or migrations/**.