litellm/litellm/proxy/example_config_yaml
ishaan-berri b593b88ec6
Ishaan - May 13th Staging LiteLLM (#27877)
* fix: strip Gemini thought-signature from tool_use.id in non-streaming path; example websearch config (#27873)

- adapters/transformation.py: mirror the streaming path and strip the
  `__thought__<b64>` suffix off `tool_call.id` before building the
  AnthropicResponseContentBlockToolUse. Base64's `+ / =` characters
  violate Anthropic's `^[a-zA-Z0-9_-]+$` tool_use.id pattern, so when a
  conversation that flowed through Gemini is later replayed to an
  Anthropic-native provider (Bedrock or Anthropic API) the request 400s.
- example_config_yaml/websearch_interception_config.yaml: register the
  interceptor under `callbacks:` not `success_callback:`. `success_callback`
  does not run pre-request hooks, so the tool-conversion step never fires
  on `/v1/messages` and the raw `web_search_20250305` tool is forwarded
  to Bedrock, which 400s.
- adds a unit test pinning the non-streaming strip behavior and the
  surviving `^[a-zA-Z0-9_-]+$` shape of the resulting id.

Co-authored-by: oss-agent-shin <279349115+oss-agent-shin@users.noreply.github.com>

* Fix/azure image edit auth header (#27863)

* fix(azure/image_edit): use api-key header instead of Authorization Bearer

Delegate `AzureImageEditConfig.validate_environment` to
`BaseAzureLLM._base_validate_azure_environment` so the image-edit route
follows the same auth resolution as every other Azure provider:

- prefer the Azure-native `api-key` header when an API key is available
- fall back to `Authorization: Bearer <azure_ad_token>` only for AAD auth

The previous implementation unconditionally set
`Authorization: Bearer <api_key>`, which is the OpenAI-direct convention
and is rejected by Azure OpenAI / APIM-fronted deployments with
`401 Access denied due to missing subscription key`.

Adds regression tests covering api_key kwarg, litellm_params.api_key, and
the AAD-token fallback path.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(azure/image_edit): pin api-key precedence semantics + add regression test

Address review feedback that the move to
``BaseAzureLLM._base_validate_azure_environment`` changed the relative
priority of the positional ``api_key`` kwarg vs. ``litellm_params["api_key"]``.

The new behavior — ``litellm_params["api_key"]`` wins, positional only fills
in when ``litellm_params["api_key"]`` is empty — is intentional and matches
every other Azure ``validate_environment``: ``AzureVideosConfig`` uses the
exact same merge logic, while ``AzureVectorStoresConfig`` and
``AzureResponsesAPIConfig`` don't accept a positional ``api_key`` at all.
The old ``or`` chain (positional wins) was the outlier and was part of the
same OpenAI-vs-Azure convention drift that produced the original
``Authorization: Bearer`` bug.

The only production caller (``llm_http_handler.image_edit``) sources both
values from the same ``litellm_params.api_key``, so this change is
behaviorally a no-op there. Document the precedence in the docstring and
lock it in with an explicit test so future refactors can't quietly
re-invert it.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: yuneng-jiang <yuneng@berri.ai>
Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>
Co-authored-by: Adam Kirstein <adam.kirstein@disney.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* test(azure/image_edit): expect api-key header instead of Authorization Bearer

PR #27863 fixed Azure image edit to use the Azure-native api-key header
instead of OpenAI's Authorization: Bearer convention, but did not update
test_azure_image_edit_litellm_sdk to match. The test still asserted
'Authorization' in headers, which now fails since the new code routes
through BaseAzureLLM._base_validate_azure_environment and emits
api-key when an api_key is provided.

Update the assertion to pin the correct Azure behavior: api-key header
present with the resolved key, and no Authorization header.

---------

Co-authored-by: oss-agent-shin <ext-agent-shin@berri.ai>
Co-authored-by: oss-agent-shin <279349115+oss-agent-shin@users.noreply.github.com>
Co-authored-by: Adam Kirstein <107421694+justalittleadam@users.noreply.github.com>
Co-authored-by: yuneng-jiang <yuneng@berri.ai>
Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>
Co-authored-by: Adam Kirstein <adam.kirstein@disney.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
2026-05-13 16:37:15 -07:00
..
_health_check_test_config.yaml feat(utils.py): support google kms for secret management 2023-12-26 15:39:40 +05:30
adaptive_router_example.yaml fix(adaptive_router): 3 P1 review defects 2026-04-20 15:22:18 -07:00
aliases_config.yaml (chore) fix config yaml 2023-11-15 17:12:28 -08:00
azure_config.yaml (docs) add example config.yaml 2023-12-04 18:08:57 -08:00
bad_schema.prisma Litellm expose disable schema update flag (#6085) 2024-10-05 21:26:51 -04:00
custom_auth.py fix user_api_key_auth example config 2025-03-26 08:36:11 -07:00
custom_auth_basic.py [Infra] Merging RC Branch with Main (#23786) 2026-03-16 15:32:20 -07:00
custom_callbacks.py Litellm ruff linting enforcement (#5992) 2024-10-01 19:44:20 -04:00
custom_callbacks1.py feat(audio_transcriptions/): calculate duration of audio file for cost calculation + feat (image_generations): cost tracking accuracy improved with output_format, quality, size values fixed per openai model 2025-11-08 16:24:31 -08:00
custom_guardrail.py [Feat] Guardrails Load Balancing - Allow Platform admins to load balance between guardrails (#18181) 2025-12-19 00:08:03 +05:30
custom_handler.py Litellm remove circular imports (#7232) 2024-12-14 16:28:34 -08:00
disable_schema_update.yaml (Infra/DB) - Allow running older litellm version when out of sync with current state of DB (#8695) 2025-02-20 18:30:23 -08:00
enterprise_config.yaml (fix) don't block proxy startup if license check fails & using prometheus (#6839) 2024-11-20 17:55:39 -08:00
langfuse_config.yaml (docs) add example configs to proxy 2023-11-15 16:41:26 -08:00
load_balancer.yaml (docs) load balancer 2023-11-17 17:25:46 -08:00
multi_instance_simple_config.yaml (e2e testing) - add tests for using litellm /team/ updates in multi-instance deployments with Redis (#8440) 2025-02-10 19:33:27 -08:00
oai_misc_config.yaml [QA] E2E - Testing for bedrock batches api (#14525) 2025-09-12 19:31:19 -07:00
opentelemetry_config.yaml (docs) proxy: add example OTEL config yaml 2023-12-02 11:22:40 -08:00
otel_test_config.yaml [Fix] Tests: Restore /metrics access for prometheus test suite 2026-05-04 20:54:54 -07:00
pass_through_config.yaml pt tests fix 2025-10-25 11:08:33 -07:00
pipeline_test_guardrails.py [Guardrails] Add guardrail pipeline support for conditional sequential execution (#21177) 2026-02-13 19:49:12 -08:00
reject_clientside_metadata_tags_config.yaml Add enforce user param functionality (#17088) 2025-11-25 09:36:24 -08:00
simple_config.yaml (test) proxy: reading config.yaml 2023-12-04 13:16:19 -08:00
spend_tracking_config.yaml [Fix] Update otel and spend tracking test configs to use gpt-3.5-turbo 2026-03-13 13:08:36 -07:00
store_model_db_config.yaml (Bug fix) - Langfuse / Callback settings stored in DB (#8251) 2025-02-04 21:09:37 -08:00
test_pipeline_config.yaml [Guardrails] Add guardrail pipeline support for conditional sequential execution (#21177) 2026-02-13 19:49:12 -08:00
tool_permission_example.yaml feat: allow custom violation message for tool-permission guardrail (#16916) 2025-11-21 08:52:01 -08:00
websearch_interception_config.yaml Ishaan - May 13th Staging LiteLLM (#27877) 2026-05-13 16:37:15 -07:00