Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
73781d9
feat(bedrock): add bedrock mantle gemma 4 models (#30264)
emerzon Jun 12, 2026
571ec52
feat(responses): enable the responses API for the Tensormesh provider…
daitran-tensormesh Jun 12, 2026
e74c1d2
fix(langfuse_otel): mark LLM spans as generations (#30250)
CNSeniorious000 Jun 12, 2026
c07f644
fix(bedrock): stop stream_chunk_size leaking into invoke request bodi…
fangkangmi Jun 12, 2026
dd34b09
fix(bedrock): stop buffering streamed tool-call argument deltas (#30231)
fangkangmi Jun 12, 2026
4cc8ca4
feat(otel): emit v2 cost breakdown + stamp tracer scope version (#30156)
choogeboom Jun 12, 2026
a00f769
fix(proxy): cancel in-flight upstream LLM request on client disconnec…
kursadlacin Jun 12, 2026
4edf1ce
fix(bedrock): grant aws-external-anthropic:* in OIDC session policy f…
hclsys Jun 12, 2026
badffac
fix(proxy): set Retry-After header on RouterRateLimitError 429 respon…
Cyberfilo Jun 12, 2026
6bc5807
fix(router): route aspeech through async_function_with_fallbacks (#30…
Cyberfilo Jun 12, 2026
b4a3d37
fix(slack_alerting): stop false-positive hanging request alerts for r…
Cyberfilo Jun 12, 2026
c772b8b
fix(health): treat all-proxy-models keys as unrestricted in /health (…
Cyberfilo Jun 12, 2026
e084559
feat(proxy): auto-enable drop_params for Claude Code requests (#30218)
mateo-berri Jun 12, 2026
489531a
fix(snowflake): migrate to native endpoints with auto-routing for Cla…
sfc-gh-nashukla Jun 12, 2026
3bfc6a8
fix: evict last deleted model in multi-instance deployments (#28608)
RudraDudhat2509 Jun 12, 2026
db48755
fix: invalidate Redis spend counter on /key/reset_spend (#29694)
michaelxer Jun 12, 2026
a1c6a56
fix: add scaleway models pricing (#27659)
Quentinchampenois Jun 12, 2026
338e495
fix(main): clarify backend route handling for Swagger static assets (…
mauriceberentsen Jun 12, 2026
7bfcae0
fix(voyage): route multimodal embeddings to correct endpoint (#30193)
lost9999 Jun 12, 2026
7a2c500
fix(ui): infer Azure API version from API base (#30204)
GaetanVDB07 Jun 12, 2026
6ee7a4a
Update litellm/llms/snowflake/chat/transformation.py
Sameerlite Jun 12, 2026
b52b3b1
feat(datadog): add team-scoped Datadog callback support (#29947)
aanchal22 Jun 11, 2026
88b0e2a
Merge pull request #29528 from aanchal22/litellm_byok-alias-merge
aanchal22 Jun 11, 2026
fda7b92
feat: add EmpirioLabs as an OpenAI-compatible provider (#30278)
Adam-Dalloul Jun 12, 2026
1a32821
fix: resolve failing tests and lint in snowflake/team endpoints
Sameerlite Jun 12, 2026
4d301c4
fix(test): update test_db_error_new_model_check for new _delete_deplo…
Sameerlite Jun 12, 2026
1ae254b
feat(proxy): register cancel_on_disconnect in ConfigGeneralSettings a…
kursadlacin Jun 12, 2026
d6da3af
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri Jun 12, 2026
52495ae
fix(datadog): never fall back to env DD_API_KEY for caller-supplied d…
mateo-berri Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

from litellm.proxy.proxy_server import app

from backend.routes.allowlist import BACKEND_EXACT_PATHS, BACKEND_PATH_PREFIXES
from backend.routes.allowlist import (
BACKEND_EXACT_PATHS,
BACKEND_MOUNT_PATHS,
BACKEND_PATH_PREFIXES,
)


def _is_backend_route(route) -> bool:
Expand All @@ -29,8 +33,9 @@ def _is_backend_route(route) -> bool:
if path is None:
return False
if isinstance(route, Mount):
# Static UI mounts are served by the dedicated UI container, not here.
return False
# The dashboard UI static mounts are served by the dedicated UI container.
# Only Mounts in the backend allowlist (e.g. swagger docs) remain on backend.
return path in BACKEND_MOUNT_PATHS
if path in BACKEND_EXACT_PATHS:
return True
return any(path.startswith(prefix) for prefix in BACKEND_PATH_PREFIXES)
Expand Down
6 changes: 6 additions & 0 deletions backend/routes/allowlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@
"/fallback/login",
}
)

BACKEND_MOUNT_PATHS: frozenset[str] = frozenset(
{
"/swagger", # API documentation static assets belong to the backend
}
)
3 changes: 3 additions & 0 deletions litellm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,9 @@ def set_global_gitlab_config(config: Dict[str, Any]) -> None:
from .llms.voyage.embedding.transformation_contextual import (
VoyageContextualEmbeddingConfig as VoyageContextualEmbeddingConfig,
)
from .llms.voyage.embedding.transformation_multimodal import (
VoyageMultimodalEmbeddingConfig as VoyageMultimodalEmbeddingConfig,
)
from .llms.infinity.embedding.transformation import (
InfinityEmbeddingConfig as InfinityEmbeddingConfig,
)
Expand Down
5 changes: 5 additions & 0 deletions litellm/_lazy_imports_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
"GenAIHubOrchestrationConfig",
"VoyageEmbeddingConfig",
"VoyageContextualEmbeddingConfig",
"VoyageMultimodalEmbeddingConfig",
"InfinityEmbeddingConfig",
"PerplexityEmbeddingConfig",
"AzureAIStudioConfig",
Expand Down Expand Up @@ -903,6 +904,10 @@
".llms.voyage.embedding.transformation_contextual",
"VoyageContextualEmbeddingConfig",
),
"VoyageMultimodalEmbeddingConfig": (
".llms.voyage.embedding.transformation_multimodal",
"VoyageMultimodalEmbeddingConfig",
),
"InfinityEmbeddingConfig": (
".llms.infinity.embedding.transformation",
"InfinityEmbeddingConfig",
Expand Down
4 changes: 2 additions & 2 deletions litellm/anthropic_beta_headers_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"effort-2025-11-24": "effort-2025-11-24",
"fast-mode-2026-02-01": null,
"files-api-2025-04-14": null,
"fine-grained-tool-streaming-2025-05-14": null,
"fine-grained-tool-streaming-2025-05-14": "fine-grained-tool-streaming-2025-05-14",
"interleaved-thinking-2025-05-14": null,
"mcp-client-2025-11-20": null,
"mcp-client-2025-04-04": null,
Expand Down Expand Up @@ -106,7 +106,7 @@
"effort-2025-11-24": "effort-2025-11-24",
"fast-mode-2026-02-01": null,
"files-api-2025-04-14": null,
"fine-grained-tool-streaming-2025-05-14": null,
"fine-grained-tool-streaming-2025-05-14": "fine-grained-tool-streaming-2025-05-14",
"interleaved-thinking-2025-05-14": null,
"mcp-client-2025-11-20": null,
"mcp-client-2025-04-04": null,
Expand Down
30 changes: 22 additions & 8 deletions litellm/integrations/SlackAlerting/hanging_request_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import asyncio
import time
from typing import TYPE_CHECKING, Any, Optional

import litellm
Expand Down Expand Up @@ -36,11 +37,15 @@ def __init__(
slack_alerting_object: SlackAlerting,
):
self.slack_alerting_object = slack_alerting_object
# checks run every alerting_threshold / 2 seconds, so entries must
# stay cached for at least 1.5x the threshold to guarantee a check
# happens after they cross it
self.hanging_request_cache_ttl = int(
self.slack_alerting_object.alerting_threshold * 1.5
+ HANGING_ALERT_BUFFER_TIME_SECONDS
)
self.hanging_request_cache = InMemoryCache(
default_ttl=int(
self.slack_alerting_object.alerting_threshold
+ HANGING_ALERT_BUFFER_TIME_SECONDS
),
default_ttl=self.hanging_request_cache_ttl,
)

async def add_request_to_hanging_request_check(
Expand Down Expand Up @@ -76,10 +81,7 @@ async def add_request_to_hanging_request_check(
await self.hanging_request_cache.async_set_cache(
key=hanging_request_data.request_id,
value=hanging_request_data,
ttl=int(
self.slack_alerting_object.alerting_threshold
+ HANGING_ALERT_BUFFER_TIME_SECONDS
),
ttl=self.hanging_request_cache_ttl,
)
return

Expand Down Expand Up @@ -111,6 +113,9 @@ async def send_alerts_for_hanging_requests(self):
if hanging_request_data is None:
continue

if hanging_request_data.alerted:
continue

request_status = (
await proxy_logging_obj.internal_usage_cache.async_get_cache(
key="request_status:{}".format(hanging_request_data.request_id),
Expand All @@ -127,12 +132,21 @@ async def send_alerts_for_hanging_requests(self):
)
continue

request_age_seconds = time.time() - hanging_request_data.created_at
if request_age_seconds < self.slack_alerting_object.alerting_threshold:
# in-flight but below the alerting threshold; keep it cached
# so a later check can alert if it never completes
continue

################
# Send the Alert on Slack
################
await self.send_hanging_request_alert(
hanging_request_data=hanging_request_data
)
# flag so the entry is skipped on later ticks; one alert per hang,
# with the existing TTL still handling cleanup
hanging_request_data.alerted = True

return

Expand Down
69 changes: 53 additions & 16 deletions litellm/integrations/datadog/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,22 @@ class DataDogLogger(
# Class variables or attributes
def __init__(
self,
dd_api_key: Optional[str] = None,
dd_site: Optional[str] = None,
dd_agent_host: Optional[str] = None,
dd_agent_port: Optional[str] = None,
**kwargs,
):
"""
Initializes the datadog logger, checks if the correct env variables are set

Required environment variables (Direct API):
Args:
dd_api_key: Datadog API key. Falls back to DD_API_KEY env var.
dd_site: Datadog site (e.g. "us5.datadoghq.com"). Falls back to DD_SITE env var.
dd_agent_host: Hostname or IP of DataDog agent. Falls back to LITELLM_DD_AGENT_HOST env var.
dd_agent_port: Port of DataDog agent (default: 10518). Falls back to LITELLM_DD_AGENT_PORT env var.

Required environment variables (Direct API) when kwargs not provided:
`DD_API_KEY` - your datadog api key
`DD_SITE` - your datadog site, example = `"us5.datadoghq.com"`

Expand Down Expand Up @@ -130,12 +140,19 @@ def __init__(
)

# Configure DataDog endpoint (Agent or Direct API)
# Use LITELLM_DD_AGENT_HOST to avoid conflicts with ddtrace's DD_AGENT_HOST
dd_agent_host = os.getenv("LITELLM_DD_AGENT_HOST")
if dd_agent_host:
self._configure_dd_agent(dd_agent_host=dd_agent_host)
# Prefer explicit kwargs, then fall back to env vars
resolved_agent_host = dd_agent_host or os.getenv("LITELLM_DD_AGENT_HOST")
if resolved_agent_host:
self._configure_dd_agent(
dd_agent_host=resolved_agent_host,
dd_agent_port=dd_agent_port,
dd_api_key=dd_api_key,
)
else:
self._configure_dd_direct_api()
self._configure_dd_direct_api(
dd_api_key=dd_api_key,
dd_site=dd_site,
)

# Optional override for testing
dd_base_url = get_datadog_base_url_from_env()
Expand Down Expand Up @@ -172,34 +189,54 @@ def _get_datadog_params(self) -> Dict:
).model_dump()
return dict_datadog_params

def _configure_dd_agent(self, dd_agent_host: str) -> None:
def _configure_dd_agent(
self,
dd_agent_host: str,
dd_agent_port: Optional[str] = None,
dd_api_key: Optional[str] = None,
) -> None:
"""
Configure DataDog Agent for log forwarding

Args:
dd_agent_host: Hostname or IP of DataDog agent
dd_agent_port: Port of DataDog agent. Falls back to LITELLM_DD_AGENT_PORT env var (default: 10518).
dd_api_key: Datadog API key. Falls back to DD_API_KEY env var. Optional when using agent.
"""
dd_agent_port = os.getenv(
resolved_port = dd_agent_port or os.getenv(
"LITELLM_DD_AGENT_PORT", "10518"
) # default port for logs
self.intake_url = f"http://{dd_agent_host}:{dd_agent_port}/api/v2/logs"
self.DD_API_KEY = os.getenv("DD_API_KEY") # Optional when using agent
self.intake_url = f"http://{dd_agent_host}:{resolved_port}/api/v2/logs"
Comment thread
veria-ai[bot] marked this conversation as resolved.
Resolved
self.DD_API_KEY = dd_api_key or os.getenv(
Comment thread
Sameerlite marked this conversation as resolved.
Resolved
"DD_API_KEY"
) # Optional when using agent
verbose_logger.debug(f"Datadog: Using DD Agent at {self.intake_url}")

def _configure_dd_direct_api(self) -> None:
def _configure_dd_direct_api(
self,
dd_api_key: Optional[str] = None,
dd_site: Optional[str] = None,
) -> None:
"""
Configure direct DataDog API connection

Args:
dd_api_key: Datadog API key. Falls back to DD_API_KEY env var.
dd_site: Datadog site. Falls back to DD_SITE env var.

Raises:
Exception: If required environment variables are not set
Exception: If required credentials are not provided via args or env vars
"""
if os.getenv("DD_API_KEY", None) is None:
resolved_api_key = dd_api_key or os.getenv("DD_API_KEY")
resolved_site = dd_site or os.getenv("DD_SITE")

if resolved_api_key is None:
raise Exception("DD_API_KEY is not set, set 'DD_API_KEY=<>")
if os.getenv("DD_SITE", None) is None:
if resolved_site is None:
raise Exception("DD_SITE is not set in .env, set 'DD_SITE=<>")

self.DD_API_KEY = os.getenv("DD_API_KEY")
self.intake_url = f"https://http-intake.logs.{os.getenv('DD_SITE')}/api/v2/logs"
self.DD_API_KEY = resolved_api_key
self.intake_url = f"https://http-intake.logs.{resolved_site}/api/v2/logs"

async def async_log_success_event(self, kwargs, response_obj, start_time, end_time):
"""
Expand Down
117 changes: 117 additions & 0 deletions litellm/integrations/datadog/datadog_team_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
"""
DataDog Team Handler

Used to get the DataDogLogger for a given request.
Handles Key/Team Based Datadog Logging, following the same pattern as LangFuseHandler.
"""

from typing import TYPE_CHECKING, Any, Dict, Optional, TypedDict

from litellm._logging import verbose_logger
from litellm.litellm_core_utils.litellm_logging import StandardCallbackDynamicParams

from .datadog import DataDogLogger

if TYPE_CHECKING:
from litellm.litellm_core_utils.litellm_logging import DynamicLoggingCache
else:
DynamicLoggingCache = Any


class DatadogLoggingConfig(TypedDict):
dd_api_key: Optional[str]
dd_site: Optional[str]
dd_agent_host: Optional[str]
dd_agent_port: Optional[str]


class DataDogHandler:
@staticmethod
def get_datadog_logger_for_request(
standard_callback_dynamic_params: StandardCallbackDynamicParams,
in_memory_dynamic_logger_cache: DynamicLoggingCache,
) -> DataDogLogger:
"""
Get a team-scoped DataDogLogger for a given request.

Resolves and caches per-team DataDogLogger instances using DynamicLoggingCache,
keyed by the team's DD credentials. Each unique set of credentials gets its own
logger instance with its own batch/flush loop.

Note: This handler is only called when team-scoped DD credentials are present.
The global (env-var based) DataDogLogger is managed separately by
_init_custom_logger_compatible_class via _in_memory_loggers.
"""
_credentials = DataDogHandler.get_dynamic_datadog_logging_config(
standard_callback_dynamic_params=standard_callback_dynamic_params,
)
credentials_dict = dict(_credentials)

# check if datadog logger is already cached
temp_datadog_logger = in_memory_dynamic_logger_cache.get_cache(
credentials=credentials_dict, service_name="datadog"
)

# if not cached, create a new datadog logger and cache it
if temp_datadog_logger is None:
temp_datadog_logger = (
DataDogHandler._create_datadog_logger_from_credentials(
credentials=credentials_dict,
in_memory_dynamic_logger_cache=in_memory_dynamic_logger_cache,
)
)

return temp_datadog_logger

@staticmethod
def _create_datadog_logger_from_credentials(
credentials: Dict,
in_memory_dynamic_logger_cache: DynamicLoggingCache,
) -> DataDogLogger:
"""
Create a DataDogLogger from the credentials and cache it.
"""
datadog_logger = DataDogLogger(
dd_api_key=credentials.get("dd_api_key"),
dd_site=credentials.get("dd_site"),
dd_agent_host=credentials.get("dd_agent_host"),
dd_agent_port=credentials.get("dd_agent_port"),
)
in_memory_dynamic_logger_cache.set_cache(
credentials=credentials,
service_name="datadog",
logging_obj=datadog_logger,
)
verbose_logger.debug(
"Datadog: Created and cached new DataDogLogger for team-scoped credentials"
)
return datadog_logger

@staticmethod
def get_dynamic_datadog_logging_config(
standard_callback_dynamic_params: StandardCallbackDynamicParams,
) -> DatadogLoggingConfig:
"""
Get the Datadog logging config for a given request from dynamic params.
"""
return DatadogLoggingConfig(
dd_api_key=standard_callback_dynamic_params.get("dd_api_key"),
dd_site=standard_callback_dynamic_params.get("dd_site"),
dd_agent_host=standard_callback_dynamic_params.get("dd_agent_host"),
dd_agent_port=standard_callback_dynamic_params.get("dd_agent_port"),
)

@staticmethod
def _dynamic_datadog_credentials_are_passed(
standard_callback_dynamic_params: StandardCallbackDynamicParams,
) -> bool:
"""
Check if dynamic Datadog credentials are passed in standard_callback_dynamic_params.
"""
if (
standard_callback_dynamic_params.get("dd_api_key") is not None
or standard_callback_dynamic_params.get("dd_site") is not None
or standard_callback_dynamic_params.get("dd_agent_host") is not None
):
return True
return False
1 change: 1 addition & 0 deletions litellm/integrations/langfuse/langfuse_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def set_langfuse_otel_attributes(span: Span, kwargs, response_obj):
"""

_utils.set_attributes(span, kwargs, response_obj, LangfuseLLMObsOTELAttributes)
span.set_attribute("langfuse.observation.type", "generation")

#########################################################
# Set Langfuse specific attributes
Expand Down
Loading
Loading