litellm - ✅(Solved) Fix [Bug]: Azure GPT-5.2 chat rejects leaked vector_store_ids from extra_body passthrough [1 pull requests, 4 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#22898Fetched 2026-04-08 00:39:27
View on GitHub
Comments
4
Participants
4
Timeline
12
Reactions
0
Author
Timeline (top)
commented ×4subscribed ×3mentioned ×2closed ×1

When routing Azure GPT-5.2 chat requests through LiteLLM, vector_store_ids can leak into provider payload via extra_body, causing Azure to reject the request with:

litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'vector_store_ids'

Root Cause

In litellm/utils.py (add_provider_specific_params_to_optional_params), non-openai params are moved into extra_body for openai/azure providers. vector_store_ids / vector_store_id are LiteLLM internal orchestration params, not valid Azure/OpenAI chat completion body params, but they get forwarded.

Fix Action

Fixed

PR fix notes

PR #22899: fix(azure): prevent vector_store_ids leak into extra_body passthrough

Description (problem / solution / changelog)

Summary

  • prevent LiteLLM internal vector_store_id(s) params from being forwarded into extra_body for openai/azure/openai-compatible providers
  • keep non-internal unknown params pass-through behavior unchanged
  • add regression tests for Azure GPT-5.2 optional param construction path

Why

Azure GPT-5.2 chat rejects vector_store_ids as unknown top-level input when it leaks via extra_body passthrough.

Fixes #22898.

Test

  • poetry run pytest tests/test_litellm/test_utils.py -k "vector_store_ids or get_optional_params_azure_gpt5" -vv
  • poetry run pytest tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py -vv

Changed files

  • litellm/utils.py (modified, +9/-1)
  • tests/test_litellm/test_utils.py (modified, +37/-0)

Code Example

import litellm

resp = litellm.completion(
    model="gpt-5.2",
    custom_llm_provider="azure",
    messages=[{"role": "user", "content": "hi"}],
    temperature=1,
    vector_store_ids=["vs_123"],
)
RAW_BUFFERClick to expand / collapse

Summary

When routing Azure GPT-5.2 chat requests through LiteLLM, vector_store_ids can leak into provider payload via extra_body, causing Azure to reject the request with:

litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'vector_store_ids'

Repro

import litellm

resp = litellm.completion(
    model="gpt-5.2",
    custom_llm_provider="azure",
    messages=[{"role": "user", "content": "hi"}],
    temperature=1,
    vector_store_ids=["vs_123"],
)

Observed: request fails with unknown parameter vector_store_ids.

Root cause

In litellm/utils.py (add_provider_specific_params_to_optional_params), non-openai params are moved into extra_body for openai/azure providers. vector_store_ids / vector_store_id are LiteLLM internal orchestration params, not valid Azure/OpenAI chat completion body params, but they get forwarded.

Proposed fix

Block internal vector store orchestration keys from extra_body pass-through:

  • vector_store_id
  • vector_store_ids

Validation

Added tests (local branch):

  1. openai-compatible passthrough should not forward vector store keys.
  2. get_optional_params(model=\"gpt-5.2\", custom_llm_provider=\"azure\", vector_store_ids=[...]) should not include vector_store_ids in extra_body.

Happy to open PR with code + tests.

extent analysis

Fix Plan

To fix the issue, we need to modify the add_provider_specific_params_to_optional_params function in litellm/utils.py to exclude internal vector store orchestration keys from the extra_body pass-through.

Code Changes

We can achieve this by adding a simple check to filter out the unwanted keys:

def add_provider_specific_params_to_optional_params(params, provider):
    # ... existing code ...
    extra_body = {}
    for key, value in params.items():
        if key in ["vector_store_id", "vector_store_ids"] or key.startswith("_"):
            continue
        extra_body[key] = value
    # ... existing code ...

Alternatively, we can use a more explicit approach by defining a set of allowed keys:

ALLOWED_KEYS = set(["temperature", "max_tokens", ...])  # add all allowed keys here

def add_provider_specific_params_to_optional_params(params, provider):
    # ... existing code ...
    extra_body = {}
    for key, value in params.items():
        if key in ALLOWED_KEYS:
            extra_body[key] = value
    # ... existing code ...

Verification

To verify the fix, we can run the added tests:

  1. Test that openai-compatible passthrough does not forward vector store keys.
  2. Test that get_optional_params does not include vector_store_ids in extra_body for the gpt-5.2 model with azure provider.

Example Use Case

After applying the fix, the following code should work as expected:

resp = litellm.completion(
    model="gpt-5.2",
    custom_llm_provider="azure",
    messages=[{"role": "user", "content": "hi"}],
    temperature=1,
    vector_store_ids=["vs_123"],
)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING