diff --git a/docs/my-website/docs/proxy/pass_through.md b/docs/my-website/docs/proxy/pass_through.md index 4554f80135f..bad23f0de0a 100644 --- a/docs/my-website/docs/proxy/pass_through.md +++ b/docs/my-website/docs/proxy/pass_through.md @@ -193,6 +193,53 @@ curl --request POST \ }' ``` +### Use Langfuse client sdk w/ LiteLLM Key + +**Usage** + +1. Set-up yaml to pass-through langfuse /api/public/ingestion + +```yaml +general_settings: + master_key: sk-1234 + pass_through_endpoints: + - path: "/api/public/ingestion" # route you want to add to LiteLLM Proxy Server + target: "https://us.cloud.langfuse.com/api/public/ingestion" # URL this route should forward + auth: true # 👈 KEY CHANGE + custom_auth_parser: "langfuse" # 👈 KEY CHANGE + headers: + LANGFUSE_PUBLIC_KEY: "os.environ/LANGFUSE_DEV_PUBLIC_KEY" # your langfuse account public key + LANGFUSE_SECRET_KEY: "os.environ/LANGFUSE_DEV_SK_KEY" # your langfuse account secret key +``` + +2. Start proxy + +```bash +litellm --config /path/to/config.yaml +``` + +3. Test with langfuse sdk + + +```python + +from langfuse import Langfuse + +langfuse = Langfuse( + host="http://localhost:4000", # your litellm proxy endpoint + public_key="sk-1234", # your litellm proxy api key + secret_key="anything", # no key required since this is a pass through +) + +print("sending langfuse trace request") +trace = langfuse.trace(name="test-trace-litellm-proxy-passthrough") +print("flushing langfuse request") +langfuse.flush() + +print("flushed langfuse request") +``` + + ## `pass_through_endpoints` Spec on config.yaml All possible values for `pass_through_endpoints` and what they mean