24 lines
707 B
Bash
24 lines
707 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Starting LiteLLM Proxy..."
|
|
|
|
# Railway injects PORT. Fall back to LiteLLM's default for local Docker runs.
|
|
APP_PORT="${PORT:-4000}"
|
|
|
|
# Railway's Redis service exposes REDISHOST/REDISPORT/REDISPASSWORD.
|
|
# Keep supporting REDIS_HOST/REDIS_PORT/REDIS_PASSWORD for portability.
|
|
export REDIS_HOST="${REDIS_HOST:-${REDISHOST:-}}"
|
|
export REDIS_PORT="${REDIS_PORT:-${REDISPORT:-}}"
|
|
export REDIS_PASSWORD="${REDIS_PASSWORD:-${REDISPASSWORD:-}}"
|
|
|
|
# Build startup command
|
|
CMD_ARGS="--config /app/config.yaml --host 0.0.0.0 --port $APP_PORT"
|
|
|
|
if [ -n "$NUM_WORKERS" ]; then
|
|
CMD_ARGS="$CMD_ARGS --num_workers $NUM_WORKERS"
|
|
fi
|
|
|
|
echo "Launching LiteLLM with: $CMD_ARGS"
|
|
exec litellm $CMD_ARGS
|