GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Ollama implementation by koryboyd · Pull Request #16681 · anomalyco/opencode

Conversation

@koryboyd

@koryboyd koryboyd commented Mar 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • [ X] New feature
  • [X ] Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

implemented reasoning into ollama local models and added detections for locally installed ollama models instead of just cloud

How did you verify your code works?

im using it and so am currently testing

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • [ X] I have tested my changes locally
  • [ X] I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Kory and others added 8 commits March 9, 2026 09:58
Kory
feat: auto-detect local Ollama models
0cc8e67
- Add Ollama detection utility that queries localhost:11434/api/tags
- Auto-register Ollama provider when running locally with detected models
- Add --local flag to /models command to show only local models
- Enable tool calling for Ollama models via custom loader
@koryboyd
Merge branch 'dev' into dev
84cc792
Kory Boyd
feat(ollama): add reasoning model detection with config overrides
3ffa090
- Auto-detect reasoning models (qwen3, phi4, gemma3, llama3, deepseek, qwq, gpt-oss)
- Add config support to force reasoning ON/OFF via capabilities.reasoning
- Enable interleaved with reasoning_content field for reasoning models
- Increase token limits (context: 200k, output: 32k) for reasoning models
- Add default reasoningEffort: medium for reasoning models
- Add think parameter support for Ollama API (true/false or low/medium/high for GPT-OSS)
@koryboyd
Merge branch 'dev' into dev
048d8c0
Kory Boyd
fix(ollama): fix type errors - use correct config model properties
034ada2
- configModel.reasoning instead of configModel.capabilities.reasoning
- configModel.interleaved instead of configModel.capabilities.interleaved
Kory Boyd
fix(ollama): generate variants for Ollama reasoning models
d73e696
Allow variants (low/medium/high) to be generated for Ollama models
that were previously blocked by the deepseek/minimax/glm/mistral/kimi
check in ProviderTransform.variants()
Kory Boyd
fix(ollama): apply reasoning detection to config-loaded Ollama models
47ade4e
Reasoning detection was only running for auto-detected Ollama models,
but was skipped when Ollama was configured in opencode.json. Now applies
reasoning detection to all Ollama models regardless of how they're loaded.
Kory Boyd
fix(ollama): add fallback to languageModel for OpenAI-compatible SDK
b578e75
The createOpenAICompatible provider may not have a chat method in newer
AI SDK versions. Added fallback to languageModel like other providers.
@github-actions github-actions Bot added the needs:title label Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title Ollama implementation doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Mar 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No "Type of change" checkbox is checked. Please select at least one.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 9, 2026
Kory Boyd
fix(ollama): only enable think parameter for models that support it
5caf077
Ollama only supports thinking for specific models: DeepSeek R1, DeepSeek
v3.1, Qwen 3, and GPT-OSS. Other models like phi4 and gemma3 don't
support the think parameter and will error if it's sent.
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate/Related PRs Found:

  1. PR opencode: added logic to probe loaded models from lmstudio, ollama an… #11951 - "opencode: added logic to probe loaded models from lmstudio, ollama an…"

    • Related: This PR appears to address model detection from locally installed Ollama and LM Studio, which directly relates to the current PR's feature of detecting locally installed Ollama models.
  2. PR feat(provider): auto-detect Ollama context limits #10758 - "feat(provider): auto-detect Ollama context limits"

    • Related: Focuses on Ollama integration and auto-detection, likely shares similar Ollama implementation details.
  3. PR feat(opencode): add dynamic model fetching for OpenAI-compatible provider #14277 - "feat(opencode): add dynamic model fetching for OpenAI-compatible provider"

    • Related: Addresses dynamic model discovery for compatible providers, which may overlap with the Ollama model detection logic.
  4. PR fix: improve tool name repair for local/Ollama models #10558 - "fix: improve tool name repair for local/Ollama models"

    • Related: Explicitly deals with local Ollama models, suggesting ongoing work in this area.

I recommend reviewing PRs #11951 and #10758 first, as they appear most directly related to local Ollama model detection and implementation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koryboyd koryboyd changed the title Ollama implementation feat: Ollama implementation Mar 9, 2026
@github-actions github-actions Bot removed the needs:title label Mar 9, 2026
@koryboyd
koryboyd marked this pull request as draft March 9, 2026 03:18
Kory Boyd added 13 commits March 9, 2026 13:26
Kory Boyd
Revert "fix(ollama): only enable think parameter for models that supp…
ab17a98
…ort it"

This reverts commit 5caf077.
Kory Boyd
Revert "fix(ollama): add fallback to languageModel for OpenAI-compati…
35e7c14
…ble SDK"

This reverts commit b578e75.
Kory Boyd
Revert "fix(ollama): apply reasoning detection to config-loaded Ollam…
5f941cf
…a models"

This reverts commit 47ade4e.
Kory Boyd
Revert "fix(ollama): generate variants for Ollama reasoning models"
a807e2f
This reverts commit d73e696.
Kory Boyd
Revert "fix(ollama): fix type errors - use correct config model prope…
351eb59
…rties"

This reverts commit 034ada2.
Kory Boyd
Revert "feat(ollama): add reasoning model detection with config overr…
0f40a61
…ides"

This reverts commit 3ffa090.
Kory Boyd
Revert "feat: auto-detect local Ollama models"
2b18b4e
This reverts commit 0cc8e67.
Kory Boyd
feat: add multi-model parallel execution and Ollama auto-detection
b1271d0
Kory Boyd
fix: improve Ollama model detection and ID generation
33ecf76
Kory Boyd
fix: force-add Ollama provider since it doesn't require API key
bd1c0b5
Kory Boyd
fix: force-add Ollama provider after mergeProvider is defined
61c4809
Kory Boyd
debug: add logging to trace Ollama provider loading
007c6bc
Kory Boyd
fix: directly assign Ollama provider to skip merging issues
87940ed
Kory Boyd added 2 commits March 9, 2026 14:03
Kory Boyd
fix: reuse localModels variable and add count to log
9805a40
Kory Boyd
fix: move Ollama force-add to end of provider processing
a0c2509
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 9, 2026
@github-actions github-actions Bot closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@koryboyd
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.