Files
EventHubAiRouter/scripts/litellm-entrypoint.sh
T
aleksey 83d516afa1
CI / build-gateway (push) Successful in 27s
CI / sync-config (push) Successful in 1s
feat(ift): EventHub AI Router stack for Zed
FastAPI gateway with A/B/C lane orchestration, LiteLLM proxy config,
Swarm stack (postgres, redis, VPN off-by-default), deploy/smoke/audit scripts.
2026-08-07 22:06:41 +03:00

32 lines
1.0 KiB
Bash

#!/bin/sh
# Load Swarm secrets into env and start LiteLLM proxy
set -eu
read_secret() {
if [ -f "$1" ]; then
tr -d '\n\r' < "$1"
fi
}
if [ -f /run/secrets/novita_api_key ]; then
export NOVITA_API_KEY="$(read_secret /run/secrets/novita_api_key)"
fi
if [ -f /run/secrets/litellm_master_key ]; then
export LITELLM_MASTER_KEY="$(read_secret /run/secrets/litellm_master_key)"
fi
if [ -f /run/secrets/litellm_salt_key ]; then
export LITELLM_SALT_KEY="$(read_secret /run/secrets/litellm_salt_key)"
fi
if [ -f /run/secrets/groq_api_key ]; then
export GROQ_API_KEY="$(read_secret /run/secrets/groq_api_key)"
fi
if [ -f /run/secrets/gemini_api_key ]; then
export GEMINI_API_KEY="$(read_secret /run/secrets/gemini_api_key)"
fi
if [ -f /run/secrets/postgres_password ]; then
export POSTGRES_PASSWORD="$(read_secret /run/secrets/postgres_password)"
export DATABASE_URL="postgresql://${POSTGRES_USER:-litellm}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-litellm}"
fi
exec litellm --config /app/config.yaml --port 4000 --num_workers 2 "$@"