litellm - 💡(How to fix) Fix [Bug]: `file_search` tool results are missing from response for vertex_ai models, but returned correctly for bedrock models [1 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#25277Fetched 2026-04-08 03:02:18
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Root Cause

Possible Root Cause The file_search tool output may not be correctly surfaced or mapped into the response for Vertex AI Gemini models, even though the same flow works for Bedrock Claude models.

Code Example

**Expected Behavior**
The response should include the vector search results, for example under:

---

**Actual Behavior**
For `vertex_ai/gemini-2.0-flash-lite-001`, the response does not include `provider_specific_fields.search_results`.

**Comparison / Notes**

* `vertex_ai/gemini-2.0-flash-lite-001`: search results are missing
* `bedrock/global.anthropic.claude-opus-4-6-v1`: search results are returned correctly with the same `file_search` tool setup

**Impact**
This causes inconsistent behavior across models/providers and makes it difficult to rely on `file_search` tool output in a provider-agnostic way.

**Possible Root Cause**
The `file_search` tool output may not be correctly surfaced or mapped into the response for Vertex AI Gemini models, even though the same flow works for Bedrock Claude models.

**Suggested Fix**
Ensure that `file_search` tool results are consistently included in the response payload across providers, including Vertex AI models, ideally under the same response field structure as other supported providers.



### Steps to Reproduce

**Steps to Reproduce**
Send the following request:

---

### Relevant log output
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Description When calling /chat/completions with the file_search tool enabled, the response for vertex_ai or azure models, for example,vertex_ai/gemini-2.0-flash-lite-001 does not include the expected vector search results in provider_specific_fields.search_results.

The same request works as expected with bedrock models, e.g. bedrock/global.anthropic.claude-opus-4-6-v1, where the search results are returned correctly.

Steps to Reproduce Send the following request:

curl $LITELLM_BASE_URL/chat/completions -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d @- << EOF
{
  "model": "vertex_ai/gemini-2.0-flash-lite-001",
  "max_tokens": 1000,
  "messages": [{"role": "user", "content": "xxx"}],
  "stream": true,
  "tools": [{
    "type": "file_search",
    "vector_store_ids": ["my-vector-store"]
  }]
}
EOF

Expected Behavior The response should include the vector search results, for example under:

{
  "provider_specific_fields": {
    "search_results": [
      {
        "object": "vector_store.search_results.page",
        "search_query": "xxx",
        "data": [
          {
            "score": 0.6659582853317261,
            "content": ...
          }
        ]
      }
    ]
  }
}

Actual Behavior For vertex_ai/gemini-2.0-flash-lite-001, the response does not include provider_specific_fields.search_results.

Comparison / Notes

  • vertex_ai/gemini-2.0-flash-lite-001: search results are missing
  • bedrock/global.anthropic.claude-opus-4-6-v1: search results are returned correctly with the same file_search tool setup

Impact This causes inconsistent behavior across models/providers and makes it difficult to rely on file_search tool output in a provider-agnostic way.

Possible Root Cause The file_search tool output may not be correctly surfaced or mapped into the response for Vertex AI Gemini models, even though the same flow works for Bedrock Claude models.

Suggested Fix Ensure that file_search tool results are consistently included in the response payload across providers, including Vertex AI models, ideally under the same response field structure as other supported providers.

Steps to Reproduce

Steps to Reproduce Send the following request:

curl $LITELLM_BASE_URL/chat/completions -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d @- << EOF
{
  "model": "vertex_ai/gemini-2.0-flash-lite-001",
  "max_tokens": 1000,
  "messages": [{"role": "user", "content": "xxx"}],
  "stream": true,
  "tools": [{
    "type": "file_search",
    "vector_store_ids": ["my-vector-store"]
  }]
}
EOF

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.81.14

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue can be resolved by ensuring that the file_search tool results are consistently included in the response payload across providers, including Vertex AI models.

Guidance

  • Verify that the file_search tool is correctly configured and enabled for Vertex AI models.
  • Check the response payload structure for Vertex AI models to ensure it matches the expected format, including the provider_specific_fields.search_results field.
  • Compare the implementation of the file_search tool for Bedrock Claude models and Vertex AI models to identify any differences that may be causing the inconsistent behavior.
  • Test the file_search tool with different Vertex AI models to determine if the issue is specific to a particular model or a broader problem with the tool's implementation.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a review of the implementation and configuration of the file_search tool.

Notes

The issue may be related to a specific version of LiteLLM (v1.81.14), and upgrading to a newer version may resolve the problem. However, without further information, it is unclear if this is the case.

Recommendation

Apply a workaround to ensure consistent inclusion of file_search tool results in the response payload for Vertex AI models, as the root cause of the issue is likely related to the tool's implementation or configuration.

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

litellm - 💡(How to fix) Fix [Bug]: `file_search` tool results are missing from response for vertex_ai models, but returned correctly for bedrock models [1 participants]