Add local Ollama model selection to the web composer#147
Merged
Conversation
Expose locally-installed Ollama models as selectable chat models in the composer's model picker. The Claude Agent SDK only speaks the Anthropic Messages API, so Ollama (OpenAI-compatible) is reached through the bundled CLIProxyAPI proxy, registered as an openai-compatibility upstream — this requires proxy.enabled. Backend: - OllamaConfig + ollama_routable gate (Ollama enabled AND proxy enabled) - nerve/ollama.py: best-effort model discovery via Ollama GET /api/tags - proxy/service.py: register discovered models as a proxy upstream - GET /api/models route for the picker - engine: thread per-session model, recreate the SDK client on a mid-session model switch, and suppress Anthropic-only knobs (extended thinking, effort, context-1m beta) for non-Claude models - server: pass the WS per-message model through to run() - startup warning when ollama.enabled but proxy.enabled is false Frontend: - api.getModels() + optional model arg on ws.sendMessage - chatStore holds available/selected/default model (persisted to localStorage) - ChatInput renders a model picker, shown only when more than one model is offered config.example.yaml: document the proxy and ollama blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Sorry, I guess this isn’t the right way or the right code for this feature, but I was doing it locally and in the end the Nerve agent uploaded it itself, with my help running the Git commands! |
pufit
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose locally-installed Ollama models as selectable chat models in the composer's model picker. The Claude Agent SDK only speaks the Anthropic Messages API, so Ollama (OpenAI-compatible) is reached through the bundled CLIProxyAPI proxy, registered as an openai-compatibility upstream — this requires proxy.enabled.
Backend:
Frontend:
config.example.yaml: document the proxy and ollama blocks.