gemini via litellm fails #6856

Closed
opened 2026-02-16 18:05:26 -05:00 by yindo · 3 comments
Owner

Originally created by @geoHeil on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

output of google:

litellm.BadRequestError: Vertex_ai_betaException BadRequestError - b'{\n  "error": {\n    "code": 400,\n    "message": "Unable to submit request because `todoread` functionDeclaration parameters schema should be of type OBJECT. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",\n    "status": "INVALID_ARGUMENT"\n  }\n}\n'

for an opencode configuraiton of

    "oai-compatible": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "my LiteLLM",
      "options": {
        "baseURL": "https://my.corp.com/v1",
        "apiKey": "{env:MY_LITELLM_KEY}"
      },
    
        "gemini-3-pro-preview": {
          "name": "Gemini 3 Pro Preview (via LiteLLM)",
          "limit": { "context": 1000000, "output": 64000 },
          "tool_call": true
        },
        "gemini-3-flash-preview": {
          "name": "Gemini 3 Flash Preview (via LiteLLM)",
          "limit": { "context": 1048576, "output": 65536 },
          "tool_call": true
        },

and litellm config of

- model_name: gemini-3-pro-preview
    litellm_params:
      model: vertex_ai/gemini-3-pro-preview
      #model: /v1/publishers/google/models/gemini-3-pro-preview
      vertex_project: "projectid"
      vertex_location: global
      vertex_credentials: "/secrets/jsonkey.json"
- model_name: gemini-3-flash-preview
    litellm_params:
      model: vertex_ai/gemini-3-flash-preview
      vertex_project: "projectid"
      vertex_location: global
      vertex_credentials: "/secrets/jsonkey.json"

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @geoHeil on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description output of google: ``` litellm.BadRequestError: Vertex_ai_betaException BadRequestError - b'{\n "error": {\n "code": 400,\n "message": "Unable to submit request because `todoread` functionDeclaration parameters schema should be of type OBJECT. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",\n "status": "INVALID_ARGUMENT"\n }\n}\n' ``` for an opencode configuraiton of ``` "oai-compatible": { "npm": "@ai-sdk/openai-compatible", "name": "my LiteLLM", "options": { "baseURL": "https://my.corp.com/v1", "apiKey": "{env:MY_LITELLM_KEY}" }, "gemini-3-pro-preview": { "name": "Gemini 3 Pro Preview (via LiteLLM)", "limit": { "context": 1000000, "output": 64000 }, "tool_call": true }, "gemini-3-flash-preview": { "name": "Gemini 3 Flash Preview (via LiteLLM)", "limit": { "context": 1048576, "output": 65536 }, "tool_call": true }, ``` and litellm config of ``` - model_name: gemini-3-pro-preview litellm_params: model: vertex_ai/gemini-3-pro-preview #model: /v1/publishers/google/models/gemini-3-pro-preview vertex_project: "projectid" vertex_location: global vertex_credentials: "/secrets/jsonkey.json" - model_name: gemini-3-flash-preview litellm_params: model: vertex_ai/gemini-3-flash-preview vertex_project: "projectid" vertex_location: global vertex_credentials: "/secrets/jsonkey.json" ``` ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 18:05:26 -05:00
yindo closed this issue 2026-02-16 18:05:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9233: LiteLLM Proxy: Vertex AI Gemini models fail for tools with empty parameters

The error you're encountering is the same: Vertex AI Gemini requires the functionDeclaration parameters schema to include "type": "object", which is currently not being set for tools with empty parameters.

Feel free to ignore if your specific case is different from the proposed solution there.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #9233: LiteLLM Proxy: Vertex AI Gemini models fail for tools with empty parameters The error you're encountering is the same: Vertex AI Gemini requires the `functionDeclaration parameters schema` to include `"type": "object"`, which is currently not being set for tools with empty parameters. Feel free to ignore if your specific case is different from the proposed solution there.
Author
Owner

@geoHeil commented on GitHub (Jan 19, 2026):

For mistral I was able to fix something similar with:

litellm_settings:
      request_timeout: 300
      drop_params: true
      set_verbose: true
      modify_params: true
      default_litellm_params:

however, this does not seem to work for gemini

@geoHeil commented on GitHub (Jan 19, 2026): For mistral I was able to fix something similar with: ``` litellm_settings: request_timeout: 300 drop_params: true set_verbose: true modify_params: true default_litellm_params: ``` however, this does not seem to work for gemini
Author
Owner

@geoHeil commented on GitHub (Jan 19, 2026):

turns out an error on my side -this fixes it also for gemini

@geoHeil commented on GitHub (Jan 19, 2026): turns out an error on my side -this fixes it also for gemini
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6856