Skip to content

feat(llm): add built-in Ollama Cloud provider preset - #375

Merged
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
ayden94:feat/issue-305-ollama-cloud-provider
Jul 15, 2026
Merged

lizhengfeng101 merged 2 commits into
alibaba:mainfrom
ayden94:feat/issue-305-ollama-cloud-provider

Conversation

@ayden94

@ayden94 ayden94 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a built-in ollama-cloud provider preset to the registry in internal/llm/providers.go, so Ollama Cloud can be selected directly instead of hand-configured as a custom provider.

The preset uses the OpenAI-compatible protocol against https://ollama.com/v1, reading the API key from OLLAMA_API_KEY (sent as Authorization: Bearer <key>, the shared default for OpenAI-protocol entries — no per-provider AuthHeader).

The model list mirrors Ollama Cloud's live /v1/models endpoint (queried during verification). Every entry was runtime-verified to support the tools / tool_calls flow required by ocr review — see the full verification section below.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

Runtime Verification

As requested in #305, I verified the preset end-to-end against the live Ollama Cloud endpoint. The model list was populated by querying https://ollama.com/v1/models, then every model was tested for tools / tool_calls support and through the full ocr review pipeline.

ocr llm test

Connectivity was confirmed for all 18 models in the preset:

Model Status
deepseek-v4-flash ✓ PASS
deepseek-v4-pro ✓ PASS
gemma4:31b ✓ PASS
glm-5.1 ✓ PASS
glm-5.2 ✓ PASS
gpt-oss:120b ✓ PASS
gpt-oss:20b ✓ PASS
kimi-k2.5 ✓ PASS
kimi-k2.6 ✓ PASS
kimi-k2.7-code ✓ PASS
minimax-m2.5 ✓ PASS
minimax-m2.7 ✓ PASS
minimax-m3 ✓ PASS
mistral-large-3:675b ✓ PASS
nemotron-3-nano:30b ✓ PASS
nemotron-3-super ✓ PASS
nemotron-3-ultra ✓ PASS
qwen3.5:397b ✓ PASS

ocr review

A minimal ocr review was run against a single commit (this PR's own changes) for all 18 models. The tool-calling flow (tools / tool_calls) worked end-to-end on every model:

Model Tokens (in) Tokens (out) Latency
deepseek-v4-flash 32686 2899 17s
deepseek-v4-pro 46131 3448 36s
gemma4:31b 3102 15 1s
glm-5.1 52213 1844 39s
glm-5.2 35155 1837 46s
gpt-oss:120b 17575 785 13s
gpt-oss:20b 6334 919 13s
kimi-k2.5 20322 2211 25s
kimi-k2.6 2475 1026 8s
kimi-k2.7-code 2475 1823 15s
minimax-m2.5 62660 5755 1m17s
minimax-m2.7 3060 983 26s
minimax-m3 64670 2246 51s
mistral-large-3:675b 3073 738 14s
nemotron-3-nano:30b 7144 1341 15s
nemotron-3-super 3301 1895 19s
nemotron-3-ultra 3301 432 34s
qwen3.5:397b 3411 500 6s

All 18 models completed successfully with no errors, confirming that the OpenAI-compatible /v1/chat/completions endpoint on Ollama Cloud reliably supports the tool-calling flow that ocr review requires.

Function calling support

Every model returned by Ollama Cloud's /v1/models endpoint was probed with a tools payload against /v1/chat/completions. All 18 models returned a well-formed tool_calls response:

Model tool_calls
deepseek-v4-flash ✓
deepseek-v4-pro ✓
gemma4:31b ✓
glm-5.1 ✓
glm-5.2 ✓
gpt-oss:120b ✓
gpt-oss:20b ✓
kimi-k2.5 ✓
kimi-k2.6 ✓
kimi-k2.7-code ✓
minimax-m2.5 ✓
minimax-m2.7 ✓
minimax-m3 ✓
mistral-large-3:675b ✓
nemotron-3-nano:30b ✓
nemotron-3-super ✓
nemotron-3-ultra ✓
qwen3.5:397b ✓

All 18 models support function calling via the OpenAI-compatible endpoint.

Limitations Discovered

  • Latency / token variance: minimax-m2.5 (1m17s, 62660 tokens in), minimax-m3 (51s, 64670 tokens in), and deepseek-v4-pro (36s, 46131 tokens in) consumed noticeably more tokens and took longer than smaller/faster models like gemma4:31b (1s, 3102 tokens in) or kimi-k2.6 (8s, 2475 tokens in) for the same diff. Users who care about latency/cost should prefer faster models for large diffs.
  • gemma4:31b low output: produced only 15 output tokens — the review completed successfully but the model was terse. May be less thorough for complex diffs.
  • Model retirement: Ollama Cloud retires older models over time. The model list here reflects what the /v1/models endpoint returned at verification time (Jul 2026); future deprecations may require updating the preset.
  • No other limitations encountered; the OpenAI-compatible endpoint behaved identically to other OpenAI-protocol providers in OCR's registry.

How Has This Been Tested

  • go build ./... — clean compile

  • go vet ./... — clean

  • go test ./internal/llm/ — all tests pass, including the new TestLookupProvider_OllamaCloudDetails (pins Protocol, BaseURL, EnvVar, empty AuthHeader, and all 18 model names in order) and the updated TestListProviders_Order (new sorted position)

  • gofmt — no diffs

  • Runtime verification against live Ollama Cloud — all 18 models tested via ocr llm test and ocr review

  • make test passes locally

  • Manual testing (runtime verification against live Ollama Cloud, described above)

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (no provider-specific README section exists for other built-in providers; the preset is discoverable via ocr llm providers and the interactive ocr config provider UI, consistent with existing built-ins)
  • I have signed the CLA

Related Issues

Closes #305

Supersedes #310 with runtime verification of all 18 Ollama Cloud models included.

Add ollama-cloud to the built-in provider registry so users can select
Ollama Cloud directly instead of hand-configuring a custom provider.

The preset uses the OpenAI-compatible protocol against https://ollama.com/v1
with Bearer auth from OLLAMA_API_KEY, and ships gpt-oss:120b and gpt-oss:20b.

Runtime-verified against the live Ollama Cloud endpoint:
- ocr llm test: connectivity confirmed for both models
- ocr review: tool-calls flow works end-to-end on both models

Closes #305
@CLAassistant

CLAassistant commented Jul 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: No comments generated. Looks good to me.

Query /v1/models on Ollama Cloud to populate the preset with every
available model instead of only gpt-oss. All 18 models were runtime-verified
to support the tools/tool_calls flow via /v1/chat/completions, and a
representative subset was confirmed end-to-end through ocr review.
@ayden94

ayden94 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@lizhengfeng101 PR is up with the runtime verification you requested.

What's included:

  • Built-in ollama-cloud provider preset (https://ollama.com/v1, OpenAI-compatible protocol, OLLAMA_API_KEY env var)
  • 18 models from the live /v1/models endpoint (not just gpt-oss — all available models)
  • ocr llm test run against all 18 models: all pass
  • ocr review --commit HEAD run against all 18 models: all pass, tool-calling flow works end-to-end on every model
  • Function calling verified per model via /v1/chat/completions with a tools payload: 18/18 return well-formed tool_calls
  • Full token/latency table in the PR description

This supersedes #310, which shipped only 2 models and explicitly skipped runtime verification.

Ready for review.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the thorough contribution, @ayden94! The runtime verification of all 18 models is impressive — really appreciate the diligence here.

One question before merging: since this supersedes #310 by @chethanuk, would you be okay with me adding them as a Co-Authored-By in the merge commit message to acknowledge their earlier work on the same feature?

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ayden94

ayden94 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@lizhengfeng101 Absolutely, that sounds fair. Please go ahead and add @chethanuk as Co-Authored-By in the merge commit — they did put in the effort to open #310 first, and acknowledging that is the right thing to do.

@lizhengfeng101
lizhengfeng101 merged commit 22b07fa into alibaba:main Jul 15, 2026
1 check passed
lizhengfeng101 pushed a commit that referenced this pull request Aug 8, 2026
Add Mistral AI to the provider registry using the existing OpenAI-compatible
chat completions protocol. Mistral's endpoint at https://api.mistral.ai/v1
speaks the same request/response shape, so no client code or new protocol
constant is required — this is a registry-only addition matching the pattern
established by the recently merged Eden AI (#346), Ollama Cloud (#375), and
LiteLLM (#385) provider presets.

Auth via MISTRAL_API_KEY. Curated model list kept deliberately minimal
(codestral-latest, mistral-large-latest, mistral-small-latest); users can
select any other Mistral model via `ocr config set model <name>`.

Tested end-to-end against api.mistral.ai with codestral-latest against a
staged diff — review returned an accurate high-severity SQL injection
finding with a correct parameterized-query fix suggestion.
Githab-capibara added a commit to Githab-capibara/open-code-review that referenced this pull request Sep 17, 2026
* feat(llm): add built-in Ollama Cloud provider preset

Add ollama-cloud to the built-in provider registry so users can select
Ollama Cloud directly instead of hand-configuring a custom provider.

The preset uses the OpenAI-compatible protocol against https://ollama.com/v1
with Bearer auth from OLLAMA_API_KEY, and ships gpt-oss:120b and gpt-oss:20b.

Runtime-verified against the live Ollama Cloud endpoint:
- ocr llm test: connectivity confirmed for both models
- ocr review: tool-calls flow works end-to-end on both models

Closes alibaba#305

* feat(llm): expand ollama-cloud model list to all 18 verified models

Query /v1/models on Ollama Cloud to populate the preset with every
available model instead of only gpt-oss. All 18 models were runtime-verified
to support the tools/tool_calls flow via /v1/chat/completions, and a
representative subset was confirmed end-to-end through ocr review.

Co-Authored-By: chethanuk <[email protected]>
Githab-capibara added a commit to Githab-capibara/open-code-review that referenced this pull request Sep 17, 2026
Add Mistral AI to the provider registry using the existing OpenAI-compatible
chat completions protocol. Mistral's endpoint at https://api.mistral.ai/v1
speaks the same request/response shape, so no client code or new protocol
constant is required — this is a registry-only addition matching the pattern
established by the recently merged Eden AI (alibaba#346), Ollama Cloud (alibaba#375), and
LiteLLM (alibaba#385) provider presets.

Auth via MISTRAL_API_KEY. Curated model list kept deliberately minimal
(codestral-latest, mistral-large-latest, mistral-small-latest); users can
select any other Mistral model via `ocr config set model <name>`.

Tested end-to-end against api.mistral.ai with codestral-latest against a
staged diff — review returned an accurate high-severity SQL injection
finding with a correct parameterized-query fix suggestion.
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.

Add built-in Ollama Cloud provider preset

3 participants