litellm/litellm/integrations
yuneng-jiang 7899463c6a
fix(callbacks): forward callback_settings to callback initializers and guard consumers against non-dict values (#30161)
* fix(datadog): pass callback_specific_params so DatadogCostManagementLogger receives cost_tag_keys (#29590)

* fix(datadog): pass callback_specific_params so DatadogCostManagementLogger receives cost_tag_keys

* test(proxy): regression test that load_config forwards callback_specific_params

* fix(proxy): guard lakera_prompt_injection callback_specific_params against non-dict

Addresses review feedback: forwarding callback_settings as callback_specific_params
(so DatadogCostManagementLogger receives cost_tag_keys) exposed the
lakera_prompt_injection branch, which did lakeraAI_Moderation(**callback_specific_params
["lakera_prompt_injection"]) with no type guard. A config like
`callback_settings: {lakera_prompt_injection: "any-string"}` then hit `**"any-string"`
-> TypeError: argument after ** must be a mapping, not str.

Guard the lakera branch with isinstance(dict), matching the existing presidio and
datadog_cost_management branches (non-dict values fall back to {}). Add a regression
test asserting initialize_callbacks_on_proxy ignores a non-dict value instead of crashing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test: inject fake lakera_ai module to avoid importing the real one

CI fix for the lakera regression test: it stubbed litellm.proxy.proxy_server with
a SimpleNamespace and then monkeypatch.setattr'd the real lakera_ai module, which
forces importing it — and lakera_ai does `from litellm.proxy.proxy_server import
LiteLLM_TeamTable`, absent on the stub -> ImportError under proxy-infra tests.

Inject a fake lakera_ai module into sys.modules instead, so the callbacks branch's
`from ...lakera_ai import lakeraAI_Moderation` resolves to the stub without loading
the real module. The guard under test (isinstance(dict) in the lakera branch) is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(callbacks): guard compression/websearch interceptors against non-dict callback_settings (#30153)

#29590 forwards the full callback_settings dict into initialize_callbacks_on_proxy, which activates the compression_interception and websearch_interception consumers. Their initialize_from_proxy_config read the callback_settings subkey without an isinstance(dict) guard, so a non-dict value such as `compression_interception: true` reached from_config_yaml(...).get(...) and aborted proxy startup with AttributeError. #29590 added that guard for lakera_prompt_injection but not for these two

Mirror the isinstance(dict) guard already used by the lakera, presidio, and datadog branches so a non-dict value is ignored and the callback initializes with defaults. A parametrized test feeds every callback_settings consumer a non-dict value through initialize_callbacks_on_proxy to catch a future consumer that forgets the guard

* fix(callbacks): normalize non-dict callback_specific_params to empty dict

A blank callback_settings: key in YAML loads as None, and
config.get('callback_settings', {}) returns None because dict.get only
falls back to the default when the key is absent. Forwarding that value
verbatim to initialize_callbacks_on_proxy made the first
'<name>' in callback_specific_params membership test raise
TypeError: argument of type 'NoneType' is not iterable, aborting proxy
startup. Same failure for any non-dict root such as callback_settings: true.

Normalize the value at the function boundary so both callsites (and any
future ones) initialize callbacks with their defaults instead of crashing.

---------

Co-authored-by: Hedi Daoud <150018939+hdaoud23@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 15:22:00 -07:00
..
_types style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
agentops style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
arize feat(arize/phoenix): OpenInference rendering parity — tool_calls, cost, passthrough I/O, session/user, multimodal, cache tokens (#28800) 2026-06-03 12:09:50 -07:00
azure_sentinel Add Azure Sentinel audit log support (#27280) 2026-05-06 15:50:06 -07:00
azure_storage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bitbucket fix(security): sandbox jinja2 in gitlab/arize/bitbucket prompt managers 2026-05-02 09:14:02 +00:00
cloudzero style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
compression_interception fix(callbacks): forward callback_settings to callback initializers and guard consumers against non-dict values (#30161) 2026-06-10 15:22:00 -07:00
datadog fix(datadog): split oversized batches on 413 instead of re-queueing forever (#29444) 2026-06-01 14:01:31 -07:00
deepeval
dotprompt fix(proxy): improve input validation on management endpoints 2026-04-09 14:14:53 -07:00
email_templates style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
focus feat(vantage): include organization metadata in FOCUS Tags export (#28184) 2026-06-09 02:59:21 +03:00
gcs_bucket fix cloud storage file guards 2026-05-01 15:34:11 -07:00
gcs_pubsub
generic_api feat(logging): add retry settings for generic API logger (#26645) 2026-04-28 08:38:17 -07:00
generic_prompt_management style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
gitlab fix(security): sandbox jinja2 in gitlab/arize/bitbucket prompt managers 2026-05-02 09:14:02 +00:00
langfuse Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
levo docs: remove docs/my-website, point contributors to litellm-docs 2026-04-24 14:17:46 -07:00
litellm_agent Agent Builder - support new experimental agent builder, to ensure agents pass compliance checks (#21817) 2026-02-21 15:32:47 -08:00
opentelemetry_utils feat: add OTEL GenAI latest-experimental semantic convention support (#27418) 2026-05-15 17:20:04 -07:00
opik Litellm oss staging 030626 (#29578) 2026-06-03 11:01:51 -07:00
otel fix: 400 on Anthropic context overflow; seed identity on failed auth (#29848) 2026-06-06 14:57:41 -07:00
prometheus_helpers perf: cap Prometheus end-user metric cardinality with TTL + LRU eviction (#27272) 2026-05-06 13:35:13 -07:00
SlackAlerting feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
vantage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vector_store_integrations style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
weave style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
websearch_interception fix(callbacks): forward callback_settings to callback initializers and guard consumers against non-dict values (#30161) 2026-06-10 15:22:00 -07:00
__init__.py
additional_logging_utils.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
anthropic_cache_control_hook.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
argilla.py
athina.py
braintrust_logging.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
braintrust_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
callback_configs.json fix(galileo): use ingest traces API and standard logging payload (#29651) 2026-06-05 09:03:17 -07:00
custom_batch_logger.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
custom_guardrail.py [internal copy of #29511] feat(guardrails): add sensitive data routing to on-premise models (#29531) 2026-06-04 22:22:28 -07:00
custom_logger.py Emit native web_search_tool_result blocks for Anthropic clients (Claude Desktop / Cowork citations) (#27886) 2026-05-14 12:30:47 -07:00
custom_prompt_management.py
custom_secret_manager.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
custom_sso_handler.py chore(auth): require trusted proxy for header identity auth 2026-04-29 21:20:21 -07:00
dynamodb.py
email_alerting.py feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
galileo.py feat(galileo): add health check support for UI callback test (#29908) 2026-06-08 13:57:03 -07:00
greenscale.py
helicone_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
helicone.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
humanloop.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
lago.py
langsmith_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
langsmith.py Merge pull request #26894 from BerriAI/litellm_langsmithRedactApiInfo 2026-05-04 09:55:59 -07:00
langtrace.py
literal_ai.py
logfire_logger.py
lunary.py
mlflow.py
mock_client_factory.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
openmeter.py Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
opentelemetry.py Litellm oss staging 030626 (#29578) 2026-06-03 11:01:51 -07:00
posthog_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
posthog.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prometheus_services.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prometheus.py feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
prompt_layer.py
prompt_management_base.py fix: trim caller-supplied dicts from compile_prompt error message 2026-04-29 15:16:01 -07:00
Readme.md
rubrik.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
s3_v2.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
s3.py
sqs.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
supabase.py
test_httpx.py
traceloop.py
weights_biases.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00

Integrations

This folder contains logging integrations for litellm

eg. logging to Datadog, Langfuse, Prometheus, s3, GCS Bucket, etc.