fix: wrap official LiteLLM entrypoint for ADC
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
FROM ghcr.io/berriai/litellm:main-stable
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN apk add --no-cache coreutils
|
||||||
|
|
||||||
|
COPY vertex-entrypoint.sh /app/vertex-entrypoint.sh
|
||||||
|
RUN chmod 0755 /app/vertex-entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/vertex-entrypoint.sh"]
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
litellm:
|
litellm:
|
||||||
image: ghcr.io/berriai/litellm:main-stable
|
build: .
|
||||||
|
image: local/litellm-vertex:main-stable
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "${LISTEN_IP:-127.0.0.1}:${HOST_PORT:-4000}:4000"
|
- "${LISTEN_IP:-127.0.0.1}:${HOST_PORT:-4000}:4000"
|
||||||
@@ -12,19 +13,7 @@ services:
|
|||||||
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/config.yaml:ro
|
- ./config.yaml:/app/config.yaml:ro
|
||||||
- ./runtime:/runtime
|
command: ["--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"]
|
||||||
entrypoint: ["python3", "-c"]
|
|
||||||
command:
|
|
||||||
- |
|
|
||||||
import base64, os
|
|
||||||
log_fd = os.open("/runtime/litellm.log", os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
|
|
||||||
os.dup2(log_fd, 1)
|
|
||||||
os.dup2(log_fd, 2)
|
|
||||||
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:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
umask 077
|
||||||
|
printf '%s' "${GOOGLE_ADC_B64}" | base64 -d > "${GOOGLE_APPLICATION_CREDENTIALS}"
|
||||||
|
|
||||||
|
exec /app/docker/prod_entrypoint.sh "$@"
|
||||||
Reference in New Issue
Block a user