Skip to content

Support for Parallel Tool Execution with Custom Models #735

@omricarmi4

Description

@omricarmi4

I am using adk-java version 0.5.0 with a custom model implementation (wrapping GPT-4.1 / GPT-5.1 via LangChain4j).

When these models return multiple tool calls in a single turn (Parallel Function Calling), the LlmAgent in the Java ADK executes them sequentially. This results in significant, avoidable latency compared to concurrent execution.

I have verified that this exact architecture works correctly in the Python ADK (v1.10.0) using the LiteLLM wrapper. In the Python environment, the same models successfully trigger parallel tool execution, drastically reducing the total response time.

I attempted to enforce parallelism using the RunConfig builder in Java, but it did not result in concurrent execution:

Java

RunConfig runConfig = RunConfig.builder()
    .setToolExecutionMode(ToolExecutionMode.PARALLEL)
    .build(); 
// Passed this config to the agent runner

Question Is parallel tool execution currently supported for custom model implementations in the Java ADK? If so, is there a specific configuration required beyond ToolExecutionMode.PARALLEL? If not, is this a planned enhancement for an upcoming release?

Metadata

Metadata

Assignees

Labels

contribwaiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions