Skip to content

feat: Ollama implementation#16681

Closed
koryboyd wants to merge 24 commits intoanomalyco:devfrom
koryboyd:dev
Closed

feat: Ollama implementation#16681
koryboyd wants to merge 24 commits intoanomalyco:devfrom
koryboyd:dev

Conversation

@koryboyd
Copy link

@koryboyd koryboyd commented Mar 9, 2026

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.

Kory and others added 8 commits March 9, 2026 09:58
- 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
- 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)
- configModel.reasoning instead of configModel.capabilities.reasoning
- configModel.interleaved instead of configModel.capabilities.interleaved
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()
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.
The createOpenAICompatible provider may not have a chat method in newer
AI SDK versions. Added fallback to languageModel like other providers.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 9, 2026
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
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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.

@koryboyd koryboyd changed the title Ollama implementation feat: Ollama implementation Mar 9, 2026
@koryboyd koryboyd marked this pull request as draft March 9, 2026 03:18
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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.

@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant