Skip to content

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

Open
chethanuk wants to merge 1 commit into
alibaba:mainfrom
chethanuk:fix/issue-305-ollama-cloud-provider
Open

feat(llm): add built-in Ollama Cloud provider preset#310
chethanuk wants to merge 1 commit into
alibaba:mainfrom
chethanuk:fix/issue-305-ollama-cloud-provider

Conversation

@chethanuk

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). It ships two models, gpt-oss:120b and gpt-oss:20b. The base URL, env var, and model naming match Ollama Cloud's documented OpenAI-compatible endpoint.

Opened against my own fork first as a staging/review step.

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

How Has This Been Tested?

gofmt -l reports no diffs, go vet ./internal/llm/ is clean, and go test ./internal/llm/ passes (176 tests). Coverage includes the existing TestListProviders_Order (updated for the new sorted position) and a new TestLookupProvider_OllamaCloudDetails that pins Protocol, BaseURL, EnvVar, empty AuthHeader, and each model name individually.

Whether Ollama Cloud's OpenAI endpoint reliably supports the tool-calls flow that ocr review needs is a runtime/e2e concern, out of scope for this preset addition.

  • make test passes locally
  • Manual testing (describe below)

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 (if applicable)
  • I have signed the CLA

Related Issues

Closes #305

Add an ollama-cloud entry to the provider registry: OpenAI protocol,
base URL https://ollama.com/v1, env OLLAMA_API_KEY, models gpt-oss:120b
and gpt-oss:20b. Values match Ollama Cloud's OpenAI-compatible endpoint.
Tests cover provider order/count and per-field lookup details.

Closes alibaba#305
@CLAassistant

CLAassistant commented Jul 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot 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.

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ 1 posted as inline comment(s)
  • 📝 0 posted as summary

Comment thread internal/llm/providers.go
Comment on lines +232 to +237
BaseURL: "https://ollama.com/v1",
EnvVar: "OLLAMA_API_KEY",
Models: []string{
"gpt-oss:120b",
"gpt-oss:20b",
},

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.

Potential issue: The BaseURL https://ollama.com/v1 does not appear to be a documented or verified Ollama Cloud API endpoint. Ollama is primarily known as a local LLM runtime (default http://localhost:11434), and there is no well-known public cloud API at this URL. Similarly, the model names gpt-oss:120b and gpt-oss:20b do not correspond to any known publicly available models.

Please verify:

  1. Is this BaseURL correct and currently active?
  2. Are these model names accurate for this provider?

If this is a placeholder or speculative entry, consider adding a comment or marking it accordingly to avoid confusion.

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

2 participants