Skip to content

Conversation

@drifkin
Copy link

@drifkin drifkin commented Jan 6, 2026

This is an alternate PR to solving the same problem as #8227.

In this PR, when Ollama is used via --oss (or via model_provider = "ollama"), we default it to use the Responses format. At runtime, we do an Ollama version check, and if the version is older than when Responses support was added to Ollama, we print out a warning.

Because there's no way of configuring the wire api for a built-in provider, we temporarily add a new oss_provider/model_provider called "ollama-chat" that will force the chat format.

Once the "chat" format is fully removed (see #7782), ollama-chat can be removed as well

This is an alternate PR to solving the same problem as
<openai#8227>.

In this PR, when Ollama is used via `--oss` (or via
`model_provider = "ollama`), we default it to use the Responses format.
At runtime, we do an Ollama version check, and if the version is older
than when Responses support was added to Ollama, we print out a warning.

Because there's no way of configuring the wire api for a built-in
provider, we temporarily add a new `oss_provider`/`model_provider`
called `"ollama-chat"` that will force the chat format.

Once the `"chat"` format is fully removed (see
<openai#7782>), `ollama-chat` can
be removed as well
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188273a3bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

@drifkin I have to run to dinner, so I went through this quickly, but I only found one small issue, so this seems promising! Much better than the mut Config stuff from before!

/// Returns a deprecation notice if Ollama doesn't support the responses wire API.
pub async fn ollama_chat_deprecation_notice(
config: &Config,
) -> io::Result<Option<DeprecationNoticeEvent>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function returns Result, but it always returns the Ok variant, never Err.

If detect_wire_api returns Err, should that flow through?

Because if only Ok is possible, then the Result wrapper seems unnecessary.

Copy link
Author

Choose a reason for hiding this comment

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

just pushed a new commit that makes it flow through and logs a warning. I don't think it should propagate as far as preventing startup (because the call itself just a best-effort explanation for users on older versions).

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