From ac8f05012122e37db68664488c5a73dfe97061e3 Mon Sep 17 00:00:00 2001 From: kev Date: Fri, 27 Dec 2024 15:51:16 +0800 Subject: [PATCH] update litellm --- litellm/data/config.yaml | 12 ++++++++++-- litellm/docker-compose.yml | 19 ++++++++++++++++--- postgres/docker-compose.yml | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/litellm/data/config.yaml b/litellm/data/config.yaml index cbd6d33..f8b98da 100644 --- a/litellm/data/config.yaml +++ b/litellm/data/config.yaml @@ -1,5 +1,6 @@ # -# https://docs.litellm.ai/docs/proxy/configs +# - https://docs.litellm.ai/docs/proxy/configs +# - https://github.com/BerriAI/litellm/blob/main/proxy_server_config.yaml # model_list: @@ -17,4 +18,11 @@ model_list: api_base: http://localhost:11434 general_settings: - master_key: sk-xxxxxx + master_key: os.environ/LITELLM_MASTER_KEY + # database_url: postgresql://litellm:litellm@postgres:5432/litellm + # store_model_in_db: True + +environment_variables: + OPENAI_API_KEY: sk-xxxxxx + ANTHROPIC_API_KEY: sk-xxxxxx + LITELLM_MASTER_KEY: sk-xxxxxx diff --git a/litellm/docker-compose.yml b/litellm/docker-compose.yml index 7a49d85..74569bc 100644 --- a/litellm/docker-compose.yml +++ b/litellm/docker-compose.yml @@ -1,12 +1,25 @@ services: + litellm: image: ghcr.io/berriai/litellm:main-stable command: --config /app/config.yaml --detailed_debug ports: - "4000:4000" volumes: - - ./data/config.yaml:/app/config.yaml + - ./data/litellm/config.yaml:/app/config.yaml environment: - - OPENAI_API_KEY=sk-xxxxxx - - ANTHROPIC_API_KEY=sk-xxxxxx + - DATABASE_URL=postgresql://litellm:litellm@postgres:5432/litellm + - STORE_MODEL_IN_DB=True + depends_on: + - postgres + restart: unless-stopped + + postgres: + image: postgres:17-alpine + volumes: + - ./data/postgres:/var/lib/postgresql/data + environment: + - POSTGRES_USER=litellm + - POSTGRES_PASSWORD=litellm + - POSTGRES_DB=litellm restart: unless-stopped diff --git a/postgres/docker-compose.yml b/postgres/docker-compose.yml index 34059b0..2cc437c 100644 --- a/postgres/docker-compose.yml +++ b/postgres/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: postgres: - image: postgres:16-alpine + image: postgres:17-alpine ports: - "5432:5432" volumes: