From 3ac420dec52b157c09d921f1f2d8b36cd1ab8c4b Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Tue, 23 Jul 2024 09:18:24 -0700 Subject: [PATCH 1/3] update header --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index cb4c9fd7..8d76fbe0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -107,7 +107,7 @@ nav: - Optimization: tutorials/optimization.md - Local Models: tutorials/notebooks/local_models.ipynb - OpenAI SDK: tutorials/openai.md - - Across 100+ LLMs: tutorials/litellm.md + - Across 100+ LLMs (LiteLLM): tutorials/litellm.md - Langchain: tutorials/notebooks/langchain.ipynb - Retrieval-augmented Generation: tutorials/rag.md - Secure RAG with Langchain: tutorials/notebooks/langchain_rag.ipynb From a27e7ee4f77bb409fbcea19ae4b4a423142765a6 Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Tue, 23 Jul 2024 09:22:40 -0700 Subject: [PATCH 2/3] cleanup docs --- docs/tutorials/litellm.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/litellm.md b/docs/tutorials/litellm.md index 3e6b1aba..e686846b 100644 --- a/docs/tutorials/litellm.md +++ b/docs/tutorials/litellm.md @@ -7,6 +7,13 @@ LiteLLM currently supports requests in: - [The OpenAI format](https://docs.litellm.ai/docs/completion/input) - `/chat/completion`, `/embedding`, `completion`, `/audio/transcription`, etc. - [The Anthropic format](https://docs.litellm.ai/docs/anthropic_completion) - `/messages` + +[**Detailed Docs**](https://docs.litellm.ai/docs/proxy/quick_start) + +## Pre-Requisites +- Install litellm proxy - `pip install 'litellm[proxy]'` +- Setup [LLM Guard Docker](https://llm-guard.com/api/deployment/#from-docker) + ## Quick Start Let's add LLM Guard content mod for Anthropic API calls @@ -18,7 +25,7 @@ export LLM_GUARD_API_BASE="http://0.0.0.0:8192" # deployed llm guard api export ANTHROPIC_API_KEY="sk-..." # anthropic api key ``` -Add `llmguard_moderations` as a callback +Add `llmguard_moderations` as a callback in a config.yaml ```yaml model_list: @@ -32,7 +39,11 @@ litellm_settings: callbacks: ["llmguard_moderations"] ``` -Now you can easily test it +Now you can easily test it: + +```bash +litellm --config /path/to/config.yaml +``` - Make a regular /chat/completion call From b0af3ca7c63eb559f40b65e5ad6fd5d83a2a014e Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Tue, 23 Jul 2024 10:22:34 -0700 Subject: [PATCH 3/3] trim trailing whitespace --- docs/tutorials/litellm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/litellm.md b/docs/tutorials/litellm.md index e686846b..824ee2cc 100644 --- a/docs/tutorials/litellm.md +++ b/docs/tutorials/litellm.md @@ -25,7 +25,7 @@ export LLM_GUARD_API_BASE="http://0.0.0.0:8192" # deployed llm guard api export ANTHROPIC_API_KEY="sk-..." # anthropic api key ``` -Add `llmguard_moderations` as a callback in a config.yaml +Add `llmguard_moderations` as a callback in a config.yaml ```yaml model_list: @@ -39,10 +39,10 @@ litellm_settings: callbacks: ["llmguard_moderations"] ``` -Now you can easily test it: +Now you can easily test it: ```bash -litellm --config /path/to/config.yaml +litellm --config /path/to/config.yaml ``` - Make a regular /chat/completion call