From eaf41829662f01f84738cfc41c0b1cfc288972b1 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 15 Dec 2023 15:59:06 +0530 Subject: [PATCH] (docs) log proxy i/o to dynamoDB --- docs/my-website/docs/proxy/logging.md | 41 ++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/proxy/logging.md b/docs/my-website/docs/proxy/logging.md index 253c299f643..f1af1384fd8 100644 --- a/docs/my-website/docs/proxy/logging.md +++ b/docs/my-website/docs/proxy/logging.md @@ -1,6 +1,8 @@ +import Image from '@theme/IdealImage'; + # Logging - Custom Callbacks, OpenTelemetry, Langfuse, Sentry -Log Proxy Input, Output, Exceptions using Custom Callbacks, Langfuse, OpenTelemetry +Log Proxy Input, Output, Exceptions using Custom Callbacks, Langfuse, OpenTelemetry, LangFuse, DynamoDB ## Custom Callback Class [Async] Use this when you want to run custom callbacks in `python` @@ -488,6 +490,43 @@ Expected output on Langfuse +## Logging Proxy Input/Output - DynamoDB + +We will use the `--config` to set `litellm.success_callback = ["dynamodb"]` this will log all successfull LLM calls to DynamoDB + +**Step 1** Set AWS Credentials in .env + +```shell +AWS_ACCESS_KEY_ID = "" +AWS_SECRET_ACCESS_KEY = "" +AWS_REGION_NAME = "" +``` + +**Step 2**: Create a `config.yaml` file and set `litellm_settings`: `success_callback` +```yaml +model_list: + - model_name: gpt-3.5-turbo + litellm_params: + model: gpt-3.5-turbo +litellm_settings: + success_callback: ["dynamodb"] +``` + +**Step 3**: Start the proxy, make a test request + +Start proxy +```shell +litellm --config config.yaml --debug +``` + +Test Request +``` +litellm --test +``` + + + + ## Logging Proxy Input/Output - Sentry If api calls fail (llm/database) you can log those to Sentry: