diff --git a/README.md b/README.md index 77512a514..468351770 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,21 @@ docker build -t litellm . && docker run -p 8000:8000 litellm [**Read the Docs**](https://docs.litellm.ai/docs/) ## Logging Observability - Log LLM Input/Output ([Docs](https://docs.litellm.ai/docs/observability/callbacks)) LiteLLM exposes pre defined callbacks to send data to LLMonitor, Langfuse, Helicone, Promptlayer, Traceloop, Slack +```python +from litellm import completion +## set env variables for logging tools +os.environ["PROMPTLAYER_API_KEY"] = "your-promptlayer-key" +os.environ["LLMONITOR_APP_ID"] = "your-llmonitor-app-id" + +os.environ["OPENAI_API_KEY"] + +# set callbacks +litellm.success_callback = ["promptlayer", "llmonitor"] # log input/output to promptlayer, llmonitor, supabase + +#openai call +response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}]) +``` ## Contributing To contribute: Clone the repo locally -> Make a change -> Submit a PR with the change.