From 98c1fb0fbd0dcc306e049722cef35b7cce8cca93 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 26 Aug 2024 08:47:01 -0700 Subject: [PATCH] docs - explain how custom guardrail is mounted --- .../docs/proxy/guardrails/custom_guardrail.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/my-website/docs/proxy/guardrails/custom_guardrail.md b/docs/my-website/docs/proxy/guardrails/custom_guardrail.md index 09819b5dcb2..57d292d4236 100644 --- a/docs/my-website/docs/proxy/guardrails/custom_guardrail.md +++ b/docs/my-website/docs/proxy/guardrails/custom_guardrail.md @@ -163,11 +163,39 @@ guardrails: ### 3. Start LiteLLM Gateway + + + +Mount your `custom_guardrail.py` on the LiteLLM Docker container + +This mounts your `custom_guardrail.py` file from your local directory to the `/app` directory in the Docker container, making it accessible to the LiteLLM Gateway. + + +```shell +docker run -d \ + -p 4000:4000 \ + -e OPENAI_API_KEY=$OPENAI_API_KEY \ + --name my-app \ + -v $(pwd)/my_config.yaml:/app/config.yaml \ + -v $(pwd)/custom_guardrail.py:/app/custom_guardrail.py \ + my-app:latest \ + --config /app/config.yaml \ + --port 4000 \ + --detailed_debug \ +``` + + + + + ```shell litellm --config config.yaml --detailed_debug ``` + + + ### 4. Test it