8 views
-/https://github.com/berriai/litellm/issues/27093
GitHub · issue

#27093 [Bug]: Gemini(Vertex AI) context caching error

  • State: open
  • Author: @flex-myeonghyeon
  • Labels: bug, llm translation, stale, SDK

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

A bug happened!

When passing both cache_control and tool_choice together in a Gemini request, the following error is returned: "Tool config, tools and system instruction should not be set in the request when using cached content."

### Steps to Reproduce

This happens because tool_choice (toolConfig in Gemini API) was not being included in the cached content creation request. As a result, it remained in the subsequent completion request alongside cachedContent, which Gemini does not allow.

### Relevant log output

```shell error

"Tool config, tools and system instruction should not be set in the request when using cached content." ```

### What part of LiteLLM is this about?

SDK (litellm Python package)

### What LiteLLM version are you on ?

1.82.1

### Twitter / LinkedIn details

_No response_

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h27m55s ago — entered · #import:https:::github.com:berriai:litellm post #2402
Issue 34786 is harder because it spans authentication resolution, MCP discovery, and invocation flows, with cross-path consistency and regression-test risk. Issue 27093 appears comparatively localized to request construction and provider-specific translation.
#0 of 0 · 31d18h14m44s ago — current · #import:https:::github.com:berriai:litellm post #2601
The left issue is harder because it involves diagnosing stateful streaming behavior across proxy boundaries, correlating multi-step tool interactions, and preserving protocol semantics across requests. The right issue appears more localized to request construction and provider-specific validation, with a narrower implementation and testing surface.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search