Repository navigation
feat(llm): add built-in Ollama Cloud provider preset - #375
Conversation
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
|
✅ 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.
|
@lizhengfeng101 PR is up with the runtime verification you requested. What's included:
This supersedes #310, which shipped only 2 models and explicitly skipped runtime verification. Ready for review. |
lizhengfeng101
left a comment
There was a problem hiding this comment.
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 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. |
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.
* 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]>
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.
Description
Adds a built-in
ollama-cloudprovider preset to the registry ininternal/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 fromOLLAMA_API_KEY(sent asAuthorization: Bearer <key>, the shared default for OpenAI-protocol entries — no per-providerAuthHeader).The model list mirrors Ollama Cloud's live
/v1/modelsendpoint (queried during verification). Every entry was runtime-verified to support thetools/tool_callsflow required byocr review— see the full verification section below.Type of Change
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 fortools/tool_callssupport and through the fullocr reviewpipeline.ocr llm testConnectivity was confirmed for all 18 models in the preset:
deepseek-v4-flashdeepseek-v4-progemma4:31bglm-5.1glm-5.2gpt-oss:120bgpt-oss:20bkimi-k2.5kimi-k2.6kimi-k2.7-codeminimax-m2.5minimax-m2.7minimax-m3mistral-large-3:675bnemotron-3-nano:30bnemotron-3-supernemotron-3-ultraqwen3.5:397bocr reviewA minimal
ocr reviewwas 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:deepseek-v4-flashdeepseek-v4-progemma4:31bglm-5.1glm-5.2gpt-oss:120bgpt-oss:20bkimi-k2.5kimi-k2.6kimi-k2.7-codeminimax-m2.5minimax-m2.7minimax-m3mistral-large-3:675bnemotron-3-nano:30bnemotron-3-supernemotron-3-ultraqwen3.5:397bAll 18 models completed successfully with no errors, confirming that the OpenAI-compatible
/v1/chat/completionsendpoint on Ollama Cloud reliably supports the tool-calling flow thatocr reviewrequires.Function calling support
Every model returned by Ollama Cloud's
/v1/modelsendpoint was probed with atoolspayload against/v1/chat/completions. All 18 models returned a well-formedtool_callsresponse:tool_callsdeepseek-v4-flashdeepseek-v4-progemma4:31bglm-5.1glm-5.2gpt-oss:120bgpt-oss:20bkimi-k2.5kimi-k2.6kimi-k2.7-codeminimax-m2.5minimax-m2.7minimax-m3mistral-large-3:675bnemotron-3-nano:30bnemotron-3-supernemotron-3-ultraqwen3.5:397bAll 18 models support function calling via the OpenAI-compatible endpoint.
Limitations Discovered
minimax-m2.5(1m17s, 62660 tokens in),minimax-m3(51s, 64670 tokens in), anddeepseek-v4-pro(36s, 46131 tokens in) consumed noticeably more tokens and took longer than smaller/faster models likegemma4:31b(1s, 3102 tokens in) orkimi-k2.6(8s, 2475 tokens in) for the same diff. Users who care about latency/cost should prefer faster models for large diffs.gemma4:31blow output: produced only 15 output tokens — the review completed successfully but the model was terse. May be less thorough for complex diffs./v1/modelsendpoint returned at verification time (Jul 2026); future deprecations may require updating the preset.How Has This Been Tested
go build ./...— clean compilego vet ./...— cleango test ./internal/llm/— all tests pass, including the newTestLookupProvider_OllamaCloudDetails(pins Protocol, BaseURL, EnvVar, empty AuthHeader, and all 18 model names in order) and the updatedTestListProviders_Order(new sorted position)gofmt— no diffsRuntime verification against live Ollama Cloud — all 18 models tested via
ocr llm testandocr reviewmake testpasses locallyManual testing (runtime verification against live Ollama Cloud, described above)
Checklist
go fmt,go vet)ocr llm providersand the interactiveocr config providerUI, consistent with existing built-ins)Related Issues
Closes #305
Supersedes #310 with runtime verification of all 18 Ollama Cloud models included.