Skip to content

ADK bug — LiteLlm: native tools silently dropped when routing through a proxy gateway #6091

Description

@RayaneKADEM

🔴 Required Information

Is your feature request related to a specific problem?

When using ADK's LiteLlm integration through a proxy gateway, native/built-in tools (tools without function_declarations, such as Google Search) are silently dropped — they never reach the gateway in the request body.

This affects at least two providers:

  • Vertex AI (Gemini models) via an OpenAI-compatible proxy — native tools are not serialized into the request; workaround via LiteLlm subclass confirmed working
  • OpenAI (GPT-4o) — same issue; a model-specific extra_body argument was suggested as a workaround but could not be made to work

There is no unified, provider-agnostic mechanism to forward native tools through a proxy. The failure is silent — no error is raised, the tools are simply absent from the outgoing request.

Describe the Solution You'd Like

A unified, provider-agnostic way to use native/built-in tools through a proxy gateway — without requiring the caller to manually construct model-specific extra_body arguments. The exact implementation is left to the ADK team's discretion.

Impact on your work

Any ADK agent using native tools (e.g. Google Search) through a gateway cannot rely on LiteLlm out of the box. We had to subclass LiteLlm and override generate_content_async to manually extract and inject native tools:

config=llm_request.configifconfigandconfig.tools:
builtin_tools= [tfortinconfig.toolsifnott.function_declarations]
ifbuiltin_tools:
func_tools= [
_function_declaration_to_tool_param(fd)
fortinconfig.toolsift.function_declarationsforfdint.function_declarations
]
builtin_json= [t.model_dump(by_alias=True, exclude_none=True) fortinbuiltin_tools]
config.tools=None# prevent LiteLLM from re-adding as duplicatesextra_body= {"tools": func_tools+builtin_json}

This is brittle, provider-specific, and should not be necessary.

Willingness to contribute

No — happy to provide more context or test a fix if the team proposes one.


🟡 Recommended Information

Describe Alternatives You've Considered

  • Model-specific extra_body argument — works for a single provider but requires a different implementation per model (Gemini vs GPT-4o), not portable.
  • Subclassing LiteLlm — current workaround, confirmed working but duplicates internal logic and breaks on any upstream refactor of generate_content_async.

Proposed API / Implementation

N/A — we have not investigated the internals of src/google/adk/models/lite_llm.py to propose a specific fix. The issue is reported from the caller's perspective.

Additional Context

Related constraint: ADK does not allow mixing native tools and AgentTool sub-agents in the same agent. This applies to all native tools (not just Google Search) — any built-in tool must be wrapped in a dedicated sub-agent when AgentTool entries are present. Fixing native tool forwarding through the gateway would make this constraint less painful in practice.

Metadata

Metadata

Labels

models[Component] This issue is related to model supportrequest clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions