Skip to content

Doesn't handle thinking key for ollama/gpt-oss responses #1011

@kovach

Description

@kovach

Please update gptel first -- errors are often fixed by the time they're reported.

  • I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

While using

  • ollama 0.11.2
  • gptel 20250808.939
  • model: gpt-oss:20b

gptel does not include any thinking output.

The reason for this seems to be that the API responses for this model have this shape: ... "message":{"role":"assistant","content":"","thinking":"..."}...,
unlike the others I tried which only use content and bracket their thinking with a special word. Now, every message either has a nonempty content or thinking field but not both.

Backend

Ollama

Steps to Reproduce

Using a gpt-oss model through ollama, attempt any request with "Include reasoning" enabled. No reasoning steps are included in output.

Additional Context

  • ollama 0.11.2
  • gptel 20250808.939
  • model: gpt-oss:20b

Backtrace

Log Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwaitingWaiting for a response from another party.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions