From a66b4855a39f8778da13795ef12feae3032d46af Mon Sep 17 00:00:00 2001 From: Ayush Somani <25874080+geekyayush@users.noreply.github.com> Date: Sun, 3 Dec 2023 12:28:05 +0530 Subject: [PATCH 1/5] feat: add docker-compose file --- docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..35e283966a1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3.9" +services: + litellm: + image: ghcr.io/berriai/litellm:main-v1.10.3 + ports: + - "8000:8000" # 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", "8000", "--num_workers", "8" ] + +# ...rest of your docker-compose config if any From 28bd07657912a452f1951190ffd1a55c90506b19 Mon Sep 17 00:00:00 2001 From: Ayush Somani <25874080+geekyayush@users.noreply.github.com> Date: Sun, 3 Dec 2023 12:28:28 +0530 Subject: [PATCH 2/5] (docs) add docker compose guide --- docs/my-website/docs/proxy/quick_start.md | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/my-website/docs/proxy/quick_start.md b/docs/my-website/docs/proxy/quick_start.md index f2ae9ea22a1..a63e7d3ada5 100644 --- a/docs/my-website/docs/proxy/quick_start.md +++ b/docs/my-website/docs/proxy/quick_start.md @@ -142,6 +142,43 @@ Here's how you can run the docker image and start litellm on port 8002 with `num docker run ghcr.io/berriai/litellm:main-v1.10.0 --port 8002 --num_workers 8 ``` +#### Run the Docker Image using docker compose + +**Step 1** + +(Recommended) Use the `docker-compose.yml` given in the project root. e.g. https://github.com/BerriAI/litellm/blob/main/docker-compose.yml + +Here's an example `docker-compose.yml` file +```yaml +version: "3.9" +services: + litellm: + image: ghcr.io/berriai/litellm:main-v1.10.3 + ports: + - "8000:8000" # 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", "8000", "--num_workers", "8" ] + +# ...rest of your docker-compose config if any +``` + +**Step 2** + +Create a `litellm-config.yaml` file with your LiteLLM config relative to your `docker-compose.yml` file. + +Check the config doc [here](https://docs.litellm.ai/docs/proxy/configs) + +**Step 3** + +Run the command `docker-compose up` or `docker compose up` as per your docker installation. + +> Use `-d` flag to run the container in detached mode (background) e.g. `docker compose up -d` + + +Your LiteLLM container should be running now. + ## Server Endpoints - POST `/chat/completions` - chat completions endpoint to call 100+ LLMs - POST `/completions` - completions endpoint From 7d2078d89fec0d4eebbb973ccfb2759fe78cd0fb Mon Sep 17 00:00:00 2001 From: Ayush Somani <25874080+geekyayush@users.noreply.github.com> Date: Sun, 3 Dec 2023 12:29:18 +0530 Subject: [PATCH 3/5] (docs) update docker compose guide --- docs/my-website/docs/proxy/quick_start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/my-website/docs/proxy/quick_start.md b/docs/my-website/docs/proxy/quick_start.md index a63e7d3ada5..3751e45db5d 100644 --- a/docs/my-website/docs/proxy/quick_start.md +++ b/docs/my-website/docs/proxy/quick_start.md @@ -177,7 +177,7 @@ Run the command `docker-compose up` or `docker compose up` as per your docker in > Use `-d` flag to run the container in detached mode (background) e.g. `docker compose up -d` -Your LiteLLM container should be running now. +Your LiteLLM container should be running now on the defined port e.g. `8000`. ## Server Endpoints - POST `/chat/completions` - chat completions endpoint to call 100+ LLMs From 0bf3de0a01f0dde5ce68a751796557c5fadfe32b Mon Sep 17 00:00:00 2001 From: Ayush Somani <25874080+geekyayush@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:37:45 +0530 Subject: [PATCH 4/5] (docs) update docker compose docs --- docker-compose.yml => docker-compose.example.yml | 2 +- docs/my-website/docs/proxy/quick_start.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename docker-compose.yml => docker-compose.example.yml (90%) diff --git a/docker-compose.yml b/docker-compose.example.yml similarity index 90% rename from docker-compose.yml rename to docker-compose.example.yml index 35e283966a1..6fdaf1506d0 100644 --- a/docker-compose.yml +++ b/docker-compose.example.yml @@ -1,7 +1,7 @@ version: "3.9" services: litellm: - image: ghcr.io/berriai/litellm:main-v1.10.3 + image: ghcr.io/berriai/litellm:main ports: - "8000:8000" # Map the container port to the host, change the host port if necessary volumes: diff --git a/docs/my-website/docs/proxy/quick_start.md b/docs/my-website/docs/proxy/quick_start.md index ad45afbd7ab..76a043e3373 100644 --- a/docs/my-website/docs/proxy/quick_start.md +++ b/docs/my-website/docs/proxy/quick_start.md @@ -328,14 +328,16 @@ docker run ghcr.io/berriai/litellm:main-v1.10.0 --port 8002 --num_workers 8 **Step 1** -(Recommended) Use the `docker-compose.yml` given in the project root. e.g. https://github.com/BerriAI/litellm/blob/main/docker-compose.yml +- (Recommended) Use the example file `docker-compose.example.yml` given in the project root. e.g. https://github.com/BerriAI/litellm/blob/main/docker-compose.example.yml + +- Rename the file `docker-compose.example.yml` to `docker-compose.yml`. Here's an example `docker-compose.yml` file ```yaml version: "3.9" services: litellm: - image: ghcr.io/berriai/litellm:main-v1.10.3 + image: ghcr.io/berriai/litellm:main ports: - "8000:8000" # Map the container port to the host, change the host port if necessary volumes: From f0df1fade7b1625214e44e437666e543ad7c52a4 Mon Sep 17 00:00:00 2001 From: Ayush Somani <25874080+geekyayush@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:38:52 +0530 Subject: [PATCH 5/5] (docs) update docs --- docs/my-website/docs/proxy/quick_start.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/my-website/docs/proxy/quick_start.md b/docs/my-website/docs/proxy/quick_start.md index 76a043e3373..3b5426b4cd9 100644 --- a/docs/my-website/docs/proxy/quick_start.md +++ b/docs/my-website/docs/proxy/quick_start.md @@ -117,6 +117,7 @@ print(response) + ### Supported LLMs All LiteLLM supported LLMs are supported on the Proxy. Seel all [supported llms](https://docs.litellm.ai/docs/providers)