Skip to content

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]

Fix : enterprise tests

Sameer Kankute9bf369d53b54
diff --git a/litellm/types/integrations/prometheus.py b/litellm/types/integrations/prometheus.py
index 482b87085dd..2c75276d9ca 100644
--- a/litellm/types/integrations/prometheus.py
+++ b/litellm/types/integrations/prometheus.py
@@ -3,7 +3,7 @@ from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Tuple
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, Field, field_validator
from typing_extensions import Annotated
import litellm
@@ -721,6 +721,13 @@ class UserAPIKeyLabelValues(BaseModel):
Optional[str], Field(..., alias=UserAPIKeyLabelNames.STREAM.value)
] = None
+ @field_validator("stream", mode="before")
+ @classmethod
+ def coerce_stream_to_str(cls, v: Any) -> Optional[str]:
+ if v is None:
+ return None
+ return str(v)
+
class PrometheusMetricsConfig(BaseModel):
"""Configuration for filtering Prometheus metrics"""