feat(ollama-cloud): wire reasoning_effort (xhigh→max) [salvage #29221] - #51494
Merged
Conversation
Map Hermes xhigh→max to unlock DeepSeek V4's 'Max thinking' tier through Ollama Cloud's OpenAI-compatible /v1/chat/completions endpoint. low/medium/high pass through unchanged; disabled/none suppress reasoning entirely. Empirically confirmed: reasoning_effort:max produces ~2.5× more thinking tokens than high on deepseek-v4-pro:cloud (1576 vs 642).
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
unresolved-import |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:2984: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/plugins/model_providers/test_ollama_cloud_profile.py:15: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
Unchanged: 5858 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
Collaborator
Related (salvage, not duplicate): salvages #29221 (@s010mn) onto current main with authorship preserved. This is the core-maintainer version of the ollama-cloud |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ollama Cloud now honors
agent.reasoning_effort— previously it was dead config there.The
ollama-cloudprofile was a bare 14-lineProviderProfilewhosebuild_api_kwargs_extras()returned({}, {}), soreasoning_configwas silently dropped and the model always ran at the server default (high for DeepSeek). This adds the samebuild_api_kwargs_extrasoverride Kimi/DeepSeek already have.Changes
plugins/model-providers/ollama-cloud/__init__.py:OllamaCloudProfilesubclass emits top-levelreasoning_effort.xhigh/max→max(DeepSeek V4 "Max thinking"),low/medium/highpass through,none/enabled: falseomit it.tests/plugins/model_providers/test_ollama_cloud_profile.py(new): 17 tests — mapping, pass-through, disabled/none suppression, full transport integration.scripts/release.py: AUTHOR_MAP entry for @s010mn (CI strict-mode gate).Validation
reasoning_effortxhigh/maxmaxlow/medium/highnone/ disabledCherry-picked clean onto current main; 61 tests pass (new + existing ollama-cloud suite); E2E through the real
ChatCompletionsTransport.build_kwargspath confirms each mapping. Contributor's live curl test:high→ 642 chars reasoning,max→ 1576 chars (2.45×).Salvage of #29221 by @s010mn — authorship preserved via rebase-merge.
Infographic