The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix _opik logger
Ishaan Jaffaadbbe9841cf
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.pyindex 9bea6b9a9a1..2d70975c932 100644--- a/litellm/litellm_core_utils/litellm_logging.py+++ b/litellm/litellm_core_utils/litellm_logging.py@@ -76,6 +76,7 @@ from ..integrations.literal_ai import LiteralAILoggerfrom ..integrations.logfire_logger import LogfireLevel, LogfireLoggerfrom ..integrations.lunary import LunaryLoggerfrom ..integrations.openmeter import OpenMeterLogger+from ..integrations.opik.opik import OpikLoggerfrom ..integrations.prometheus import PrometheusLoggerfrom ..integrations.prometheus_services import PrometheusServicesLoggerfrom ..integrations.prompt_layer import PromptLayerLogger@@ -2430,6 +2431,14 @@ def _init_custom_logger_compatible_class(_gcs_bucket_logger = GCSBucketLogger()_in_memory_loggers.append(_gcs_bucket_logger)return _gcs_bucket_logger # type: ignore+ elif logging_integration == "opik":+ for callback in _in_memory_loggers:+ if isinstance(callback, OpikLogger):+ return callback # type: ignore++ _opik_logger = OpikLogger()+ _in_memory_loggers.append(_opik_logger)+ return _opik_logger # type: ignoreelif logging_integration == "arize":if "ARIZE_SPACE_KEY" not in os.environ:raise ValueError("ARIZE_SPACE_KEY not found in environment variables")@@ -2563,6 +2572,10 @@ def get_custom_logger_compatible_class(for callback in _in_memory_loggers:if isinstance(callback, GCSBucketLogger):return callback+ elif logging_integration == "opik":+ for callback in _in_memory_loggers:+ if isinstance(callback, OpikLogger):+ return callbackelif logging_integration == "otel":from litellm.integrations.opentelemetry import OpenTelemetry