From 9b4a19b3aa67bab6cce7e88617cfc655878f9a64 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 1 Jun 2024 16:18:12 -0700 Subject: [PATCH 1/2] build(docker-compose.yml): startup docker compose with postgres --- docker-compose.yml | 22 ++++++++++++++++------ docs/my-website/docs/proxy/deploy.md | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 05439b1df..807fdd388 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,26 @@ -version: "3.9" +version: "3.11" services: litellm: build: context: . args: target: runtime - image: ghcr.io/berriai/litellm:main-latest + image: ghcr.io/berriai/litellm:main-stable ports: - "4000:4000" # Map the container port to the host, change the host port if necessary - volumes: - - ./litellm-config.yaml:/app/config.yaml # Mount the local configuration file - # You can change the port or number of workers as per your requirements or pass any new supported CLI augument. Make sure the port passed here matches with the container port defined above in `ports` value - command: [ "--config", "/app/config.yaml", "--port", "4000", "--num_workers", "8" ] + environment: + DATABASE_URL: "postgresql://postgres:example@db:5432/postgres" + STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI + + db: + image: postgres + restart: always + environment: + POSTGRES_PASSWORD: example + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 1s + timeout: 5s + retries: 10 # ...rest of your docker-compose config if any \ No newline at end of file diff --git a/docs/my-website/docs/proxy/deploy.md b/docs/my-website/docs/proxy/deploy.md index f9a7db2d4..6fb8c5bfe 100644 --- a/docs/my-website/docs/proxy/deploy.md +++ b/docs/my-website/docs/proxy/deploy.md @@ -7,6 +7,23 @@ You can find the Dockerfile to build litellm proxy [here](https://github.com/Ber ## Quick Start +To start using Litellm, run the following commands in a shell: + +```bash +# Get the code +git clone https://github.com/BerriAI/litellm + +# Go to folder +cd litellm + +# Add the master key +echo 'LITELLM_MASTER_KEY="sk-1234"' > .env +source .env + +# Start +docker-compose up +``` + From ce4ba80fd4629ce315e64d52df626ec18d3c5c31 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 1 Jun 2024 16:27:07 -0700 Subject: [PATCH 2/2] build(docker-compose.yml): load local .env in docker compose quick start --- docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 807fdd388..6c1f5f57b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,9 @@ services: environment: DATABASE_URL: "postgresql://postgres:example@db:5432/postgres" STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI + env_file: + - .env # Load local .env file + db: image: postgres