Repository navigation
chore(oss): litellm oss staging 120626 #30292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 29 commits into
litellm_internal_staging
from
litellm_oss_staging_120626
Jun 12, 2026
Merged
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 571ec52
feat(responses): enable the responses API for the Tensormesh provider…
daitran-tensormesh e74c1d2
fix(langfuse_otel): mark LLM spans as generations (#30250)
CNSeniorious000 c07f644
fix(bedrock): stop stream_chunk_size leaking into invoke request bodi…
fangkangmi dd34b09
fix(bedrock): stop buffering streamed tool-call argument deltas (#30231)
fangkangmi 4cc8ca4
feat(otel): emit v2 cost breakdown + stamp tracer scope version (#30156)
choogeboom a00f769
fix(proxy): cancel in-flight upstream LLM request on client disconnec…
kursadlacin 4edf1ce
fix(bedrock): grant aws-external-anthropic:* in OIDC session policy f…
hclsys badffac
fix(proxy): set Retry-After header on RouterRateLimitError 429 respon…
Cyberfilo 6bc5807
fix(router): route aspeech through async_function_with_fallbacks (#30…
Cyberfilo b4a3d37
fix(slack_alerting): stop false-positive hanging request alerts for r…
Cyberfilo c772b8b
fix(health): treat all-proxy-models keys as unrestricted in /health (…
Cyberfilo e084559
feat(proxy): auto-enable drop_params for Claude Code requests (#30218)
mateo-berri 489531a
fix(snowflake): migrate to native endpoints with auto-routing for Cla…
sfc-gh-nashukla 3bfc6a8
fix: evict last deleted model in multi-instance deployments (#28608)
RudraDudhat2509 db48755
fix: invalidate Redis spend counter on /key/reset_spend (#29694)
michaelxer a1c6a56
fix: add scaleway models pricing (#27659)
Quentinchampenois 338e495
fix(main): clarify backend route handling for Swagger static assets (…
mauriceberentsen 7bfcae0
fix(voyage): route multimodal embeddings to correct endpoint (#30193)
lost9999 7a2c500
fix(ui): infer Azure API version from API base (#30204)
GaetanVDB07 6ee7a4a
Update litellm/llms/snowflake/chat/transformation.py
Sameerlite b52b3b1
feat(datadog): add team-scoped Datadog callback support (#29947)
aanchal22 88b0e2a
Merge pull request #29528 from aanchal22/litellm_byok-alias-merge
aanchal22 fda7b92
feat: add EmpirioLabs as an OpenAI-compatible provider (#30278)
Adam-Dalloul 1a32821
fix: resolve failing tests and lint in snowflake/team endpoints
Sameerlite 4d301c4
fix(test): update test_db_error_new_model_check for new _delete_deplo…
Sameerlite 1ae254b
feat(proxy): register cancel_on_disconnect in ConfigGeneralSettings a…
kursadlacin d6da3af
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 52495ae
fix(datadog): never fall back to env DD_API_KEY for caller-supplied d…
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.