Skip to content

Conversation

@ludwig-n
Copy link
Contributor

Summary of PR

Adds an option to LLMConfig that allows the user to pass custom kwargs to litellm.completion.

This is useful to pass in parameters that OpenHands doesn't have a dedicated setting for, such as:

  • "chat_template_kwargs": {"enable_thinking": False} to disable "thinking mode" for the Qwen3 series of models
  • some sampling parameters, e.g. repetition_penalty, min_p

Example of usage in config.toml:

[llm.qwen3]
completion_kwargs.chat_template_kwargs.enable_thinking = false

Change Type

  • New feature

Checklist

  • I have read and reviewed the code and I understand what the code is doing.
  • I have tested the code to the best of my ability and ensured it works as expected.

Release Notes

  • Include this change in the Release Notes.

Copy link
Contributor

@raymyers raymyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test, looks good thanks!

@raymyers raymyers enabled auto-merge (squash) October 27, 2025 20:02
@raymyers raymyers merged commit 92b1fca into OpenHands:main Oct 27, 2025
25 checks passed
@ludwig-n ludwig-n deleted the custom-completion-kwargs-pr branch October 31, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants