From 8b23a2334f883370a0aa76c1c74b2bc5b56dffa4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 20 Aug 2024 07:56:40 -0700 Subject: [PATCH] docs update Aporia Example --- .../docs/tutorials/litellm_proxy_aporia.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/my-website/docs/tutorials/litellm_proxy_aporia.md b/docs/my-website/docs/tutorials/litellm_proxy_aporia.md index 522d6aba4..1fea3037f 100644 --- a/docs/my-website/docs/tutorials/litellm_proxy_aporia.md +++ b/docs/my-website/docs/tutorials/litellm_proxy_aporia.md @@ -61,7 +61,7 @@ guardrails: - `pre_call` Run **before** LLM call, on **input** - `post_call` Run **after** LLM call, on **input & output** -- `during_call` Run **during** LLM call, on **input** +- `during_call` Run **during** LLM call, on **input** Same as `pre_call` but runs in parallel as LLM call. Response not returned until guardrail check completes ## 3. Start LiteLLM Gateway @@ -72,6 +72,8 @@ litellm --config config.yaml --detailed_debug ## 4. Test request +**[Langchain, OpenAI SDK Usage Examples](../proxy/user_keys##request-format)** + @@ -134,11 +136,10 @@ curl -i http://localhost:4000/v1/chat/completions \ -## Advanced -### Control Guardrails per Project (API Key) +## 5. Control Guardrails per Project (API Key) Use this to control what guardrails run per project. In this tutorial we only want the following guardrails to run for 1 project (API Key) -- `guardrails`: ["aporia-pre-guard", "aporia"] +- `guardrails`: ["aporia-pre-guard", "aporia-post-guard"] **Step 1** Create Key with guardrail settings @@ -150,7 +151,7 @@ curl -X POST 'http://0.0.0.0:4000/key/generate' \ -H 'Authorization: Bearer sk-1234' \ -H 'Content-Type: application/json' \ -D '{ - "guardrails": ["aporia-pre-guard", "aporia"] + "guardrails": ["aporia-pre-guard", "aporia-post-guard"] } }' ``` @@ -164,7 +165,7 @@ curl --location 'http://0.0.0.0:4000/key/update' \ --header 'Content-Type: application/json' \ --data '{ "key": "sk-jNm1Zar7XfNdZXp49Z1kSQ", - "guardrails": ["aporia-pre-guard", "aporia"] + "guardrails": ["aporia-pre-guard", "aporia-post-guard"] } }' ```