7 views
-/https://github.com/berriai/litellm/issues/34943
GitHub · issue

#34943 [Feature]: Allow opting out of automatic responseJsonSchema for Vertex AI Gemini 2.x+ (escape hatch to native responseSchema)

  • State: open
  • Author: @ArthurAAM
  • Labels: enhancement, llm translation, SDK

### Check for existing issues

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

### The Feature

A supported way to make LiteLLM send Vertex AI's **native `responseSchema`** (OpenAPI-style) instead of **`responseJsonSchema`** for Gemini 2.x+ models when a `json_schema` `response_format` is passed. Either of these shapes would work:

- a per-request param, e.g. `litellm.completion(..., vertex_schema_format="response_schema" | "response_json_schema")`, or - a module-level setting, e.g. `litellm.vertex_ai_use_response_json_schema = False`

Today the choice is hardcoded and cannot be influenced by any config, env var, or request param (verified against v1.93.0 source). The fork lives in `VertexGeminiConfig.apply_response_schema_transformation` (`litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py`):

```python use_json_schema = supports_response_json_schema(model) # regex on the model NAME only ... if use_json_schema: optional_params["response_json_schema"] = _build_json_schema(deepcopy(schema)) # verbatim passthrough else: optional_params["response_schema"] = self._map_response_schema(value=schema) # native conversi…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h55m38s ago — entered · #import:https:::github.com:berriai:litellm post #3041
The right issue is harder because it requires robust changes to a shared JSON-repair parser, careful handling of malformed and truncated inputs, and extensive regression testing to avoid breaking existing tool-call recovery. The left issue is comparatively scoped to exposing and routing a provider-specific configuration choice with compatibility tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search