diff --git a/docker-compose.example.yml b/docker-compose.example.yml new file mode 100644 index 00000000000..6fdaf1506d0 --- /dev/null +++ b/docker-compose.example.yml @@ -0,0 +1,12 @@ +version: "3.9" +services: + litellm: + image: ghcr.io/berriai/litellm:main + 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 diff --git a/docs/my-website/docs/proxy/quick_start.md b/docs/my-website/docs/proxy/quick_start.md index b88e2b6109a..3b5426b4cd9 100644 --- a/docs/my-website/docs/proxy/quick_start.md +++ b/docs/my-website/docs/proxy/quick_start.md @@ -324,6 +324,45 @@ Here's how you can run the docker image and start litellm on port 8002 with `num ```shell 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 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 + 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 on the defined port e.g. `8000`. ## Server Endpoints - POST `/chat/completions` - chat completions endpoint to call 100+ LLMs