mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
* fix(azure_ai): call Responses natively for a model router on a Foundry project base A model_router entry whose api_base is a Foundry project path on an Azure OpenAI v1 host now uses AzureAIResponsesAPIConfig instead of bridging to chat, so POST /v1/responses goes to <host>/api/projects/<project>/openai/v1/responses with the deployment name as the body model. Resource v1 bases, non-v1 hosts, the default route, and Foundry agents are unchanged, and the chat-to-Responses bridge check still keeps chat on chat for router entries The non-streaming response records the routed model in the hidden model-router key the same way chat does, so the spend log shows the routed model, and cost stays routed model price plus the router flat fee once A streamed call on that route streams natively. The deployment name has no cost-map row, so the inherited supports_native_streaming lookup would have faked the stream and held every token until the answer finished * fix(azure_ai): send the bare deployment name when compacting through a model router On a Foundry project base a model router entry now has a Responses config, so /v1/responses/compact reaches the project instead of failing with "not supported". The compact body carried model_router/<deployment>, which Azure answers with 404 DeploymentNotFound, so compact now strips the name the same way create does * fix(azure_ai): call Responses natively for a model router on a Foundry project base behind any host * fix(azure_ai): drop custom tools for a model router under drop_params * fix(azure_ai): send a resource-base model router to Responses, convert custom tool history, and record the streamed routed model * fix(azure_ai): keep a model router on a /models or deployments base on chat, and drop a tool_choice naming a custom tool * fix(azure_ai): send a model router's custom tools as function tools, answer its calls as custom tool calls, and accept a full Responses URL base * fix(azure_ai): keep a model router on an openai.azure.com or cognitiveservices resource base on the chat bridge Those hosts already served router Responses through the chat bridge in released versions, so running conversations, store: false follow-ups, and litellm-managed file_search keep working there. Only a Foundry project base or a services.ai.azure.com resource base goes native. The test helpers also get full types. * fix(azure_ai): keep a model router on a gateway project base on the chat bridge and match custom calls by namespace A router behind a gateway project base used the chat bridge in released versions, so only a services.ai.azure.com base now goes native. A top-level function that shares its name with a namespaced custom tool no longer comes back as a custom call, since custom calls are matched by namespace and name. * fix(azure_ai): keep a bridged turn's follow-ups on the chat bridge and keep replayed call namespaces A model router follow-up whose previous_response_id names a turn the chat bridge answered now stays on the bridge, the turn's spend row flushes at once, and an MCP first round does not chain through Azure. Replayed custom tool calls keep their namespace. * fix(azure_ai): keep only model router follow-ups to a bridged turn on the chat bridge A follow-up whose previous_response_id names a chat-bridged turn now stays on the bridge only for an azure_ai model router on a services.ai.azure.com v1 base, the one entry this PR moves to native Responses. Other deployments send such a follow-up as before, so a plain Foundry deployment still answers Azure's 400 instead of a reply that silently drops the earlier turns when prompts are not stored * fix(azure_ai): write a native model router turn's spend row at once Every router turn used to go over the chat bridge, whose rows skip the batch write. A native router turn now writes at once too, so a follow-up that lands on a router entry in the same group that still bridges, an openai.azure.com base say, can replay it right away instead of answering without it --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| agents | ||
| anthropic | ||
| chat | ||
| claude | ||
| embed | ||
| image_edit | ||
| image_generation | ||
| passthrough | ||
| rerank | ||
| responses | ||
| vector_stores | ||
| __init__.py | ||
| test_azure_ai_agents_handler.py | ||
| test_azure_ai_cost_calculator.py | ||
| test_azure_ai_entra_auth.py | ||
| test_azure_ai_foundry_catalog_model_metadata.py | ||
| test_azure_ai_fw_models_metadata.py | ||
| test_azure_ai_kimi_k26_metadata.py | ||