Files
infra-docker-configs/servers/bwh-hk-dc3/litellm/compose.yaml
T

29 lines
1015 B
YAML

services:
litellm:
image: ghcr.io/berriai/litellm:main-stable
restart: unless-stopped
ports:
- "${LISTEN_IP:-127.0.0.1}:${HOST_PORT:-4000}:4000"
environment:
GOOGLE_ADC_B64: ${GOOGLE_ADC_B64}
GOOGLE_APPLICATION_CREDENTIALS: /tmp/application_default_credentials.json
VERTEXAI_PROJECT: ${VERTEXAI_PROJECT}
VERTEXAI_LOCATION: ${VERTEXAI_LOCATION:-global}
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
volumes:
- ./config.yaml:/app/config.yaml:ro
entrypoint: ["python3", "-c"]
command:
- |
import base64, os
path = "/tmp/application_default_credentials.json"
with open(path, "wb") as credential_file:
credential_file.write(base64.b64decode(os.environ["GOOGLE_ADC_B64"]))
os.chmod(path, 0o600)
os.execvp("litellm", ["litellm", "--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"])
logging:
driver: json-file
options:
max-size: 1m
max-file: "2"