Skip to content

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

Closed

Description

@wenkangjing

Description

When using OpenCode with LiteLLM proxy configured for Vertex AI Gemini models (e.g., gemini-3-pro-image-preview), tool calls fail because function declarations with empty parameters don't include "type": "object" in the parameters schema. Vertex AI strictly requires this field, while OpenAI-compatible APIs typically accept schemas without it.

Error Message

litellm.ServiceUnavailableError: litellm.BadRequestError: Vertex_ai_betaException BadRequestError - 
{
  "error": {
    "code": 400,
    "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",
    "status": "INVALID_ARGUMENT"
  }
}

Vertex AI Gemini requires:

{
  name: todoread,
  description: Use this tool to read your todo list,
  parameters: {
    type: object,  // ← REQUIRED
    properties: {},
    required: []
  }
}

Provider Settings

  "provider": {
    "a-ramdon-name": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "a ramdon name",
      "options": {
        "baseURL": "{baseUIL}/v1",
        "apiKey": "a litellm key"
      },
      "models": {
        "gemini-3-pro-image-preview": {
          "name": "gemini-3-pro-image-preview"
        }
      }
    }

Proposed Solution

When serializing tool schemas for Vertex AI models, ensure, always include "type": "object" in parameters schema

Plugins

Oh My OpenCode

OpenCode version

1.1.25

Steps to reproduce

  1. Configure LiteLLM proxy with a Vertex AI Gemini model
  2. Ask OpenCode to generate a random image
  3. Observe the Vertex AI 400 error

Screenshot and/or share link

https://opncd.ai/share/Ud6K8Z1N

Operating System

macOS SequoiaVersion 15.7.3

Terminal

Ghostty

Activity

  1. github-actions commented on Jan 18, 2026

    @github-actions
    Contributor

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

    All of these issues relate to tools with empty parameters not including the required "type": "object" field in the parameters schema, which causes validation failures on strict backends like Vertex AI, SGLang, Antigravity API, and others.

    Feel free to ignore if your specific case differs from these issues.

  2. geoHeil commented on Jan 19, 2026

    @geoHeil

    even without the image - even when texting Hi it fails for me. Is there any workaround?

  3. wenkangjing commented on Jan 20, 2026

    @wenkangjing
    Author

    the same behaviour on my side, just "Hi", no images fails as well.

  4. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions