From cfdf893226e26264bdd99d2605c94ea460445979 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 18 Apr 2026 13:04:32 -0700 Subject: [PATCH] [Fix] Merge prometheus_helpers.py into prometheus_helpers/__init__.py to resolve file/package collision A previous refactor added `litellm/integrations/prometheus_helpers.py` as a sibling to the existing `litellm/integrations/prometheus_helpers/` directory (which contains `prometheus_api.py` and has no `__init__.py`). The file shadowed the namespace-package directory, so any deferred `from litellm.integrations.prometheus_helpers.prometheus_api import ...` raised `ModuleNotFoundError: 'litellm.integrations.prometheus_helpers' is not a package` at request time. Two runtime call sites hit that path: - /global/spend/logs (spend_management_endpoints.py) returned plain-text 500 "Internal Server Error" for every call, breaking the Admin UI Usage tab and programmatic consumers. - SlackAlerting.send_fallback_stats_from_prometheus silently failed inside its own try/except. Fix: move prometheus_helpers.py content into prometheus_helpers/__init__.py and delete the stray .py. The directory becomes a regular package, so both the package-root import (from ...prometheus_helpers import X) and the submodule import (from ...prometheus_helpers.prometheus_api import X) resolve correctly. No call sites change. --- .../{prometheus_helpers.py => prometheus_helpers/__init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename litellm/integrations/{prometheus_helpers.py => prometheus_helpers/__init__.py} (100%) diff --git a/litellm/integrations/prometheus_helpers.py b/litellm/integrations/prometheus_helpers/__init__.py similarity index 100% rename from litellm/integrations/prometheus_helpers.py rename to litellm/integrations/prometheus_helpers/__init__.py