Skip to content

feat(server): claude and codex pickers list models from ollama and other local gateways - #253

Merged
AadiJo merged 8 commits into
mainfrom
check-ollama-model-picker
Nov 15, 2026
Merged

AadiJo merged 8 commits into
mainfrom
check-ollama-model-picker

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Users who point Claude Code or Codex at local models through Ollama (or LM Studio, LiteLLM and similar gateways) saw only the built-in Anthropic or OpenAI models in the picker. Picking one failed, because the gateway has no model named claude-opus-5-5 or gpt-6.1-sol.

Neither CLI asks the gateway for its models, so the provider checks now do:

  • Claude. When the CLI's effective environment sets a non-Anthropic ANTHROPIC_BASE_URL (from the shell, or from a Claude settings file's env block, which wins), the check calls GET <base>/v1/models.
  • Codex. The check reads the resolved config from the app-server. It covers the built-in ollama and lmstudio providers and custom [model_providers] entries with a base_url. Providers with a model_catalog_url are skipped, because Codex lists that catalog itself.

If a gateway can't list its models, the picker keeps the built-in ones and the provider status says why. Ids the built-in catalog knows keep their name and options. A model the gateway lists only under another id, such as a proxy's dated claude-haiku-4-5-20251001, is listed and requested under the id the gateway uses.

A gateway that also serves Claude catalog models, such as a proxy in front of Anthropic, keeps the curated picker: those models come first in catalog order, and the gateway's other ids fold under "More models". Without this, a proxy listing 35 ids turned a 12-model Claude tab into 35 unordered rows.

Two changes also reach setups without a gateway:

  • Model lists replace instead of union. A list that names any built-in model is the provider's full list, so stale models leave the picker. Claude models the installed CLI is too old to run no longer linger from the startup snapshot.
  • Thread titles. When the title model can't run on its provider, titles use the chat's provider: its cheap title model if listed, else the chat's own model.

Behind a gateway, Claude sessions declare the CAD tools in full instead of deferring them behind ToolSearch, which local models never call. Sessions on Anthropic's own API send what they sent before.

Known limitation: a custom launch argument that changes which settings files Claude Code reads is not taken into account when deciding whether a session is behind a gateway.

Claude picker Codex picker Codex turn on a local model

Proof: the new apps/server/scripts/gateway-models-e2e.ts runs the dev stack against a real Ollama with fresh CLAUDE_CONFIG_DIR and CODEX_HOME, through a logging proxy. It passes with Codex on the built-in provider, on a custom provider, and unconfigured, and with a gateway that lists a Claude model by its catalog id or only by a dated id. In the dated-id run the gateway gets requests for the id it lists; before, it got 28 requests for claude-haiku-4-5 and rejected all of them. Both tabs list exactly the gateway's models, turns reach it as the picked model, Claude's turn declares the CAD tools, and each chat gets a generated title. Typecheck, vp check and the server suite (1735 tests) pass.

Paired against main with the method in CadReviewEvaluation.md (transfer review, eight-item key, three runs per arm, blind grader): Opus 5.5 scored 7.83 on both, GPT-6.1-Sol 8.00 on both. The runs went through a proxy in front of the cloud models, so the branch arm declared the CAD tools in full, and Opus processed 35% fewer tokens per review that way.

Reviewed with sol-loop: 16 rounds with gpt-6.1-sol on high. Sol verdict: approved

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cadsense Skipped Skipped Nov 15, 2026 3:37am UTC

@AadiJo
AadiJo force-pushed the check-ollama-model-picker branch from f773103 to 06a8d05 Compare November 12, 2026 04:56
@AadiJo AadiJo changed the title feat(server): claude picker lists models from ollama and other custom base urls feat(server): claude and codex pickers list models from ollama and other local gateways Nov 12, 2026
@AadiJo
AadiJo merged commit 6cbd232 into main Nov 15, 2026
12 checks passed
@AadiJo
AadiJo deleted the check-ollama-model-picker branch November 26, 2026 19:49

This branch was previously deployed

1 inactive deployment
Preview — 99a1ba9c Deployed Nov 15, 2026 by vercel[bot]
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