Skip to content

feat(models): support forwarding extra_body in OpenAILlm #8365

Description

@yibol9768-alt

Filed as a separate issue from #8191 per #8191 (comment).

Problem

OpenAILlm builds the chat.completions.create(**kwargs) request in src/google/adk/integrations/openai/_openai_llm.py (_build_request_kwargs / _generate_content_*) without any way to pass extra_body.

OpenAI-compatible inference servers (such as vLLM and SGLang) rely on extra_body for server-specific request controls — for example:

  • chat_template_kwargs={"enable_thinking": False} to toggle reasoning on Qwen3 / DeepSeek models;
  • top_k, repetition_penalty, min_p, or guided-decoding options.

Other ADK adapters already support this:

  • LiteLlm forwards http_options.extra_body (src/google/adk/models/lite_llm.py);
  • OpenAIResponsesLlm merges extra_body from extra_request_args (src/google/adk/integrations/openai/_openai_responses_llm.py).

Proposal

Allow callers of OpenAILlm to pass extra_body (e.g., via extra_request_args / GenerateContentConfig.http_options.extra_body, matching OpenAIResponsesLlm / LiteLlm conventions) and forward it to chat.completions.create(..., extra_body=...).

Happy to submit a focused PR with unit tests once the preferred configuration surface is confirmed.

Activity

  1. added
    models
    on Nov 27, 2026
  2. removed theissue type on Dec 1, 2026
  3. added
    needs review
    on Dec 1, 2026
  4. llalitkumarrr commented on Dec 1, 2026

    @llalitkumarrr
    Collaborator

    Hello @yibol9768-alt,

    Thank you for raising this request. We will review it and take the necessary action. We appreciate your patience in the meantime.

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

Metadata

Metadata

Labels

modelsneeds review

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions