[Fix] broaden RAG ingestion credential cleanup to AWS endpoint/identity fields - #26525
Conversation
…s) (#26361) * feat(azure): add azure/gpt-5.5 + azure/gpt-5.5-pro entries (+ dated variants) Azure variants of OpenAI's GPT-5.5 family. Microsoft has not yet shipped GPT-5.5 on Azure OpenAI (latest GA on the Foundry models page is GPT-5.4 as of 2026-04-24), but adding the entries day-0 mirrors the established precedent for azure/gpt-5.4* (which were in the cost map before the Azure rollout) so cost tracking and capability flags work the moment customers deploy. Schema follows the existing azure/gpt-5.4* shape: - Same base/long-context pricing as openai/gpt-5.5*: $5/$30 chat, $60/$360 pro per 1M, with priority tier 2x base - Azure variants drop the flex/batches keys (Azure has no flex tier) but keep priority pricing, matching gpt-5.4* precedent - mode=chat for the thinking model, mode=responses for pro reasoning_effort capability flags mirror the OpenAI variants exactly since Azure proxies the same API contract: minimal rejection on both chat and pro, low/none rejection on pro. Once #26456 (which sets supports_low_reasoning_effort + minimal=false on openai/gpt-5.5*) lands, OpenAI and Azure flag profiles align. Tests pin entry presence + pricing for all four Azure variants and verify the live-API-derived reasoning_effort flags. * test: register supports_low_reasoning_effort in cost-map JSON schema azure/gpt-5.5-pro and azure/gpt-5.5-pro-2026-04-23 added in this branch carry supports_low_reasoning_effort=false. The strict 'additionalProperties: false' schema in test_aaamodel_prices_and_context_window_json_is_valid rejected the new key. Register it alongside the other supports_*_reasoning_effort entries. Note: the runtime side of this flag (code that reads it) lands in #26456. Until that PR merges the flag is inert for both Azure and OpenAI pro entries, but having the schema accept it lets cost-map tests pass on either merge order.
…ity fields Mirrors the existing api_base handling in _load_credentials_from_config(): when a vector_store_config references litellm_credential_name and the stored credential does not itself define aws_sts_endpoint or aws_web_identity_token, any caller-supplied value on those keys is removed. Keeps endpoint and identity fields aligned with the credential definition.
Low: No security issues foundThis PR adds Azure GPT-5.5 model pricing entries and broadens the RAG ingestion credential cleanup to also strip caller-supplied Status: 0 open Posted by Veria AI · 2026-04-25T21:49:26.808Z |
Greptile SummaryThis PR has two independent parts: (1) a security fix in Confidence Score: 5/5Safe to merge; the credential-cleanup fix is correct and the only inline finding is a P2 test-coverage gap. All P0/P1-level concerns from the prior review thread (missing reasoning-effort flags on dated variants) are pre-existing and already tracked. The new code in base_ingestion.py is logically sound and covers the three documented scenarios. The sole new finding is a P2 missing assertion for supports_low_reasoning_effort in the parametrized test, which does not affect production correctness. model_prices_and_context_window.json — dated variant entries (azure/gpt-5.5-2026-04-23, azure/gpt-5.5-pro-2026-04-23) still lack reasoning-effort flags (tracked in prior review thread).
|
| Filename | Overview |
|---|---|
| litellm/rag/ingestion/base_ingestion.py | Core security fix: generalises the post-credential-overwrite strip from api_base-only to also cover aws_sts_endpoint and aws_web_identity_token, preventing a caller from pairing a stored credential with attacker-controlled STS/identity endpoints. |
| model_prices_and_context_window.json | Adds Azure GPT-5.5 / GPT-5.5-pro (and their 2026-04-23 dated variants). Dated variants are missing all reasoning-effort flags that their base counterparts define (flagged in a prior review thread). |
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Adds pricing and reasoning-effort tests for Azure GPT-5.5 entries; reasoning-effort parametrize doesn't cover supports_low_reasoning_effort or dated variants. |
| tests/test_litellm/test_utils.py | Adds supports_low_reasoning_effort to the JSON-schema validator — a necessary companion to the new azure/gpt-5.5-pro entry that first uses this field. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[__init__: vector_store_config\nloaded from caller ingest_options] --> B{litellm_credential_name\npresent AND credential_list set?}
B -- No --> Z[Use caller config as-is]
B -- Yes --> C[CredentialAccessor.get_credential_values]
C --> D{credential_values\nempty?}
D -- Yes --> Z
D -- No --> E[Write all credential values\ninto vector_store_config\noverwriting caller keys]
E --> F{For each key in\napi_base / aws_sts_endpoint /\naws_web_identity_token}
F --> G{Key in vector_store_config\nAND key NOT in credential_values?}
G -- Yes --> H[Delete key\nremoves caller-supplied\nendpoint / identity value]
G -- No --> I[Keep value\nstored credential owns it]
H --> J[Resolved vector_store_config\nfully controlled by credential]
I --> J
Reviews (2): Last reviewed commit: "style: black formatting" | Re-trigger Greptile
| "input_cost_per_token": 6e-05, | ||
| "input_cost_per_token_above_272k_tokens": 0.00012, | ||
| "litellm_provider": "azure", | ||
| "max_input_tokens": 1050000, | ||
| "max_output_tokens": 128000, | ||
| "max_tokens": 128000, | ||
| "mode": "responses", | ||
| "output_cost_per_token": 0.00036, | ||
| "output_cost_per_token_above_272k_tokens": 0.00054, | ||
| "supported_endpoints": [ | ||
| "/v1/batch", | ||
| "/v1/responses" | ||
| ], | ||
| "supported_modalities": [ | ||
| "text", | ||
| "image" | ||
| ], | ||
| "supported_output_modalities": [ | ||
| "text" | ||
| ], | ||
| "supports_function_calling": true, | ||
| "supports_native_streaming": true, | ||
| "supports_parallel_function_calling": true, | ||
| "supports_pdf_input": true, | ||
| "supports_prompt_caching": true, | ||
| "supports_reasoning": true, | ||
| "supports_response_schema": false, | ||
| "supports_system_messages": true, | ||
| "supports_tool_choice": true, | ||
| "supports_vision": true, | ||
| "supports_web_search": true, | ||
| "supports_none_reasoning_effort": false, | ||
| "supports_xhigh_reasoning_effort": true, | ||
| "supports_minimal_reasoning_effort": false, | ||
| "supports_low_reasoning_effort": false | ||
| }, | ||
| "azure/gpt-5.5-pro-2026-04-23": { | ||
| "cache_read_input_token_cost": 6e-06, | ||
| "cache_read_input_token_cost_above_272k_tokens": 1.2e-05, | ||
| "input_cost_per_token": 6e-05, | ||
| "input_cost_per_token_above_272k_tokens": 0.00012, | ||
| "litellm_provider": "azure", | ||
| "max_input_tokens": 1050000, | ||
| "max_output_tokens": 128000, | ||
| "max_tokens": 128000, |
There was a problem hiding this comment.
Dated variants missing reasoning-effort flags
azure/gpt-5.5-2026-04-23 and azure/gpt-5.5-pro-2026-04-23 omit all supports_*_reasoning_effort flags that their base counterparts define. Any caller querying these dated model keys via get_model_info will get None for those capabilities instead of the correct values, potentially causing incorrect request building (e.g., no guard against unsupported effort levels).
azure/gpt-5.5-2026-04-23 should include:
"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": falseazure/gpt-5.5-pro-2026-04-23 should include:
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false,
"supports_low_reasoning_effort": false
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
b021d5c
into
litellm_internal_staging
…t_cleanup [Fix] broaden RAG ingestion credential cleanup to AWS endpoint/identity fields
Relevant issues
Summary
Extends the cleanup logic in
BaseRAGIngestion._load_credentials_from_config()so caller-supplied
aws_sts_endpointandaws_web_identity_tokenareremoved when a
litellm_credential_nameis referenced and the storedcredential does not itself define those fields. Mirrors the existing
api_basehandling.Fix
The credential-overwrite loop already replaces caller-supplied entries on
keys that the stored credential defines, but the post-loop strip covered
only
api_base. Generalize the strip to a tuple of three keys(
api_base,aws_sts_endpoint,aws_web_identity_token) so the resolvedvector_store_configcannot pair the credential's keys with caller-chosenendpoint or identity values when the stored credential omits them.
Testing
uv run pytest tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.py tests/test_litellm/vector_stores/test_vector_store_registry.py tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py -v— 51 passed.aws_sts_endpointto a localhost listener → after the fix, the listener receives no traffic and the call routes to the real AWS STS.aws_sts_endpoint→ unchanged before/after; caller remains in control of their own endpoint.Type
🐛 Bug Fix
Screenshots