Skip to content

Configuration reference

The proxy reads a YAML config file on startup. The path is set via the CONFIG_FILE environment variable (default: config/config.yaml). In Kubernetes the file is mounted from a ConfigMap generated from values.yaml.

Set DATABASE_URL to an async SQLAlchemy URL. Local development defaults to sqlite+aiosqlite:///./proxy.db; production should use PostgreSQL with postgresql+asyncpg://....

Relay applies versioned Alembic migrations at startup. You can run or inspect them explicitly before a rollout:

Terminal window
python -m app.db.migrate upgrade
python -m app.db.migrate current

Use this wrapper when upgrading an installation that predates Alembic. It recognizes complete legacy schema stages, stamps the correct revision, and applies only missing migrations. Concurrent replicas serialize upgrades with a database advisory lock. The wrapper refuses partial or unrelated schemas instead of guessing.

KeyTypeDefaultDescription
workersint4Number of uvicorn worker processes
log_levelstring"info"Log level: debug, info, warning, error
allow_passthrough_keysboolfalseAccept non-gr- provider keys. Enable only for explicitly trusted BYOK deployments
expose_docsboolfalseExpose /docs, /redoc, and /openapi.json
metrics_require_authbooltrueRequire the master key on /metrics
cors_allowed_originslist[]Browser origins allowed by CORS. Empty disables CORS middleware

Helm: config.workers, config.logLevel, config.allowPassthroughKeys, config.exposeDocs, config.metricsRequireAuth, config.corsAllowedOrigins

KeyTypeDefaultDescription
default_modelstring"gpt-4o"Model used when none is specified in the request
default_embedding_modelstring""Model used by /v1/embeddings when none is specified
allowed_modelslistsee belowRequests for any other model are rejected with 400
fallback_modelslist[]Tried in order when the primary model returns an error
model_aliasesmap{}e.g. gpt-4: gpt-4o — rewrite model names before routing
per_model_max_tokensmap{}Override max output tokens per model
deploymentsmap{}Logical alias → model, capabilities, and fallback chain

Default allowed_models:

- gpt-4o
- gpt-4o-mini
- anthropic/claude-sonnet-4-6
- anthropic/claude-haiku-4-5-20251001

Helm: config.llm.*

KeyTypeDefaultDescription
active_policy_versionstring"default"Policy snapshot applied to new requests
require_declared_capabilitiesboolfalseReject direct/undeclared models when capabilities are requested
policiesmap{}Versioned deployment allowlists, capability rules, routes, and team overrides

See Deployment and policy routing.

KeyTypeDefaultDescription
default_storeboolfalseDefault provider-side storage behavior for /v1/responses
KeyTypeDefaultDescription
enabledboolfalseEnable the MCP protocol and REST gateway endpoints
protocol_versionstring"2025-11-25"MCP version offered during initialization
serversmap{}Registered remote Streamable HTTP servers and credential environment mappings
active_policy_versionstring"default"Active MCP authorization policy snapshot
policiesmap{}Ordered versioned allow, deny, and approval rules
approval_ttl_secondsint900Lifetime of pending and approved operations
request_timeout_secondsfloat60Per-request remote MCP timeout
max_result_bytesint1000000Maximum sanitized tool-result size
allow_insecure_httpboolfalsePermit non-TLS remote MCP URLs; development only
allowed_originslist[]Browser origins accepted by POST /mcp when an Origin header is present

See MCP gateway and approvals.

KeyTypeDefaultDescription
enabledboolfalseEnable OpenTelemetry FastAPI and HTTPX instrumentation
service_namestring"geeper-relay"OTLP resource service name
otlp_endpointstring""OTLP/HTTP traces endpoint
otlp_headersmap{}OTLP exporter headers
sample_ratiofloat1.0Parent-based trace sampling ratio
KeyTypeDefaultDescription
issuer_urlstring""OIDC issuer; enables discovery when credentials are present
scopeslist[openid,email,profile]Authorization request scopes
require_verified_emailbooltrueRequire a verified-email claim for general OIDC
allowed_email_domainslist[]Optional sign-in domain allowlist
default_key_scopeslist[chat,responses]Maximum scopes users may select for portal keys
token_endpoint_auth_methodstringclient_secret_postclient_secret_post or client_secret_basic

Client ID/secret should be supplied through OIDC__CLIENT_ID and OIDC__CLIENT_SECRET or the equivalent Helm Secret.

KeyTypeDefaultDescription
enabledbooltrueEnable the SSO-backed developer portal at /portal
session_ttl_secondsint28800Signed browser-session lifetime
secure_cookiesbooltrueSend the portal cookie only over HTTPS
max_active_keysint10Maximum active self-service keys per user
max_key_ttl_daysint365Longest expiry users may choose
KeyTypeDefaultDescription
enabledbooltrueEnable RAG context injection
top_kint5Maximum chunks to retrieve
score_thresholdfloat0.75Maximum dense cosine distance
embedding_modelstring"all-MiniLM-L6-v2"sentence-transformers model for embedding
require_aclbooltrueDerive repository filters from authenticated API-key scopes
hybrid_enabledbooltrueFuse dense and BM25-style lexical candidate rankings
candidate_multiplierint4Candidate pool size relative to top_k
rrf_kint60Reciprocal-rank-fusion smoothing constant
reranker_modelstring""Optional pinned/local sentence-transformers CrossEncoder
reranker_top_nint20Fused candidates sent to the cross-encoder
context_max_tokensint4000Maximum formatted retrieval-context tokens

With ACL enforcement enabled, keys require rag:repo:owner/name for individual repositories or rag:* for all repositories. X-Relay-Repo narrows access; it never grants access.

Helm: config.rag.*

KeyTypeDefaultDescription
enabledbooltrueEnable PII detection and scrubbing
score_thresholdfloat0.7Minimum Presidio confidence score to redact
entitieslistsee belowEntity types to detect

Default entities: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, CREDIT_CARD, US_SSN, IP_ADDRESS, LOCATION

Helm: config.pii.*

KeyTypeDefaultDescription
enabledbooltrueEnable rate limiting
backendstring"memory"memory or redis. Auto-set to redis when redis.enabled=true in Helm
defaults.requests_per_minuteint60Per-user req/min limit
defaults.tokens_per_minuteint100000Per-user tokens/min limit
defaults.tokens_per_dayint1000000Per-user tokens/day limit

Per-team limits are set via the admin API — see Teams & API keys.

Helm: config.rateLimiting.*

KeyTypeDefaultDescription
enabledbooltrueEnable content policy checks
max_input_tokensint32000Reject requests with more prompt tokens than this
blocked_patternslistsee belowLiteral strings (case-insensitive) to block

Default blocked patterns:

- "ignore previous instructions"
- "ignore all previous"
- "jailbreak"

Helm: config.contentPolicy.*

KeyTypeDefaultDescription
enabledboolfalseEnable response caching
typestring"local"local (in-process dict) or redis. Auto-set to redis when redis.enabled=true in Helm
ttlint3600Cache TTL in seconds

Helm: config.cache.*

KeyTypeDefaultDescription
enabledboolfalseEnable Langfuse trace export
providerstring"langfuse"Only langfuse supported currently

Langfuse credentials are set via environment variables: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST (empty = Langfuse Cloud).

Helm: config.analytics.*, secrets.langfuse*

server:
workers: 4
log_level: info
allow_passthrough_keys: false
expose_docs: false
metrics_require_auth: true
cors_allowed_origins: []
llm:
default_model: anthropic/claude-haiku-4-5-20251001
default_embedding_model: text-embedding-3-small
allowed_models:
- anthropic/claude-haiku-4-5-20251001
- anthropic/claude-sonnet-4-6
fallback_models: []
model_aliases: {}
per_model_max_tokens: {}
deployments: {}
routing:
active_policy_version: default
require_declared_capabilities: false
policies: {}
responses:
default_store: false
mcp:
enabled: false
protocol_version: "2025-11-25"
servers: {}
active_policy_version: default
policies: {}
approval_ttl_seconds: 900
request_timeout_seconds: 60
max_result_bytes: 1000000
allow_insecure_http: false
allowed_origins: []
telemetry:
enabled: false
service_name: geeper-relay
otlp_endpoint: ""
otlp_headers: {}
sample_ratio: 1.0
rag:
enabled: true
top_k: 5
score_threshold: 0.4
embedding_model: all-MiniLM-L6-v2
require_acl: true
pii:
enabled: true
score_threshold: 0.7
entities:
- PERSON
- EMAIL_ADDRESS
- PHONE_NUMBER
- CREDIT_CARD
- US_SSN
- IP_ADDRESS
- LOCATION
- INTERNAL_SECRET
rate_limiting:
enabled: true
backend: memory
defaults:
requests_per_minute: 60
tokens_per_minute: 100000
tokens_per_day: 1000000
content_policy:
enabled: true
max_input_tokens: 32000
blocked_patterns:
- "ignore previous instructions"
- "ignore all previous"
- "jailbreak"
cache:
enabled: false
type: local
ttl: 3600
analytics:
enabled: false
provider: langfuse