Skip to content

ModelOption.THINKING fails sometimes #6

Closed

Description

@HendrikStrobelt

OpenAIBackend by default assumes open ai semantic. e.g. THINKING = medium. However, a user may use OpenAIBackend with litellm proxy and so on. In my case, I am using litellm proxy to access granite-4 family on rits cluster. AFAIK, granite does not set thinking effort as medium instead it uses "thinking=True"

        thinking = model_opts.get(ModelOption.THINKING, None)
        if type(thinking) is bool and thinking:
            # OpenAI uses strings for its reasoning levels.
            thinking = "medium"

following throws an error TypeError: openai.resources.chat.completions.completions.Completions.create() got multiple values for keyword argument 'reasoning_effort'

                    backend = OpenAIBackend(
                        base_url="http://0.0.0.0:4000/",
                        model_id=model,
                        api_key="API KEY",
                        header=True,
                        model_options={
                            ModelOption.MAX_NEW_TOKENS: 4096,
                            ModelOption.SYSTEM_PROMPT: "You are an expert Site Reliability Engineer.",
                            ModelOption.THINKING: True
                            }
...```

credit: Saurabh Jha

Activity

  1. nrfulton commented on Jan 7, 2026

    @nrfulton
    Member

    this has been solved by thinking-effort model option management code.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions