From 8e2653c6092d9dc55d3c48d433f40c744b0f37b6 Mon Sep 17 00:00:00 2001 From: vivek-athina <153479827+vivek-athina@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:17:12 +0530 Subject: [PATCH] Use environment variable for Athina logging URL (#7628) * Use environment variable for Athina logging URL * Added to docs as well * Changed the env var name --- .../docs/observability/athina_integration.md | 11 +++++++++++ litellm/integrations/athina.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/observability/athina_integration.md b/docs/my-website/docs/observability/athina_integration.md index cd1442f35ab..f7c99a4a9c6 100644 --- a/docs/my-website/docs/observability/athina_integration.md +++ b/docs/my-website/docs/observability/athina_integration.md @@ -79,6 +79,17 @@ Following are the allowed fields in metadata, their types, and their description * `expected_response: Optional[str]` - This is the reference response to compare against for evaluation purposes. This is useful for segmenting inference calls by expected response. * `user_query: Optional[str]` - This is the user's query. For conversational applications, this is the user's last message. + +## Using a self hosted deployment of Athina + +If you are using a self hosted deployment of Athina, you will need to set the `ATHINA_BASE_URL` environment variable to point to your self hosted deployment. + +```python +... +os.environ["ATHINA_BASE_URL"]= "http://localhost:9000" +... +``` + ## Support & Talk with Athina Team - [Schedule Demo 👋](https://cal.com/shiv-athina/30min) diff --git a/litellm/integrations/athina.py b/litellm/integrations/athina.py index f669b7c9ac3..250b384c75e 100644 --- a/litellm/integrations/athina.py +++ b/litellm/integrations/athina.py @@ -12,7 +12,7 @@ class AthinaLogger: "athina-api-key": self.athina_api_key, "Content-Type": "application/json", } - self.athina_logging_url = "https://log.athina.ai/api/v1/log/inference" + self.athina_logging_url = os.getenv("ATHINA_BASE_URL", "https://log.athina.ai") + "/api/v1/log/inference" self.additional_keys = [ "environment", "prompt_slug",