Skip to content

feat(ai): add Ollama Cloud provider - #525

Draft
thisisjun786 wants to merge 1 commit into
code-yeongyu:mainfrom
thisisjun786:feat/ollama-official-provider
Draft

feat(ai): add Ollama Cloud provider#525
thisisjun786 wants to merge 1 commit into
code-yeongyu:mainfrom
thisisjun786:feat/ollama-official-provider

Conversation

@thisisjun786

@thisisjun786 thisisjun786 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • add Ollama Cloud as a built-in dynamic provider using OLLAMA_API_KEY
  • discover tool-capable models through /api/tags and /api/show, with bounded inspection concurrency and last-known cache preservation
  • expose thinking, vision, context-window, and OpenAI-compatible request metadata in the model catalog
  • preserve explicit local Ollama models.json catalogs while keeping Radius and other provider-owned refresh paths intact
  • document setup, model selection, environment configuration, and the local/Cloud compatibility rule

Why this belongs in core

Provider-owned catalog refresh is composed before extensions and models.json overlays. The runtime previously replaced a built-in provider's own refresh implementation with the generic remote catalog wrapper, so an extension could not make Ollama Cloud appear as a first-class provider or preserve its dynamic catalog lifecycle.

Verification

  • npm run check
  • npm run build:npm
  • CI=1 npm test with provider credentials unset
    • scripts: 72 passed
    • agent: 303 passed, 1 skipped
    • AI: 1,526 passed, 804 skipped
    • coding-agent: 6,015 passed, 33 skipped
    • pty: 44 passed
    • senpi-codemode: 466 passed, 6 skipped
    • server: 3 passed
    • TUI: passed (exit 0)
  • Senpi QA mock OpenAI-completions tool loop: 4/4 passed
  • Senpi CLI smoke: 8/8 passed
  • manual Ollama Cloud smoke: dynamic catalog discovery succeeded and a Kimi K3 text turn completed without an event-order error

Compatibility and failure handling

  • an explicit ollama model catalog remains local and does not trigger Cloud discovery
  • custom Radius gateways with explicit models still run their dynamic refresh
  • one stale /api/show result does not discard healthy models
  • failed or aborted refreshes cannot replace the last-known usable catalog
  • upstream error bodies and status text are not included in surfaced errors

Summary by cubic

Adds a built-in Ollama Cloud provider with OpenAI-compatible /v1 support using OLLAMA_API_KEY, featuring dynamic, cached model discovery from /api/tags and /api/show. The runtime now preserves provider-owned refresh so both Ollama Cloud and Radius keep their dynamic catalogs.

  • New Features

    • New ollama provider (Cloud) with /v1/chat/completions.
    • Discovers tool-capable models via /api/tags + /api/show; derives thinking, vision, and context window.
    • Bounded inspection concurrency; preserves last-known usable models on partial failures; aborts don’t overwrite cache.
    • Reasoning “max” clamps to Ollama’s highest supported “high” wire tier.
    • Zero-cost pricing metadata (no fabricated per-token rates).
    • Recognizes OLLAMA_API_KEY; docs and CLI help updated; default model set to qwen3.5:397b.
    • Runtime no longer wraps built-ins that implement refreshModels, keeping Ollama Cloud and Radius dynamic catalogs intact.
  • Migration

    • Set OLLAMA_API_KEY, then run: senpi update --models and select an Ollama Cloud model (e.g., qwen3.5:397b).
    • Existing local ollama entries with explicit models in models.json are unchanged and skip Cloud discovery.

Written for commit fb26e7c. Summary will update on new commits.

Review in cubic

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