Repository navigation
Conversation
…timate - Local models: Ollama, LM Studio or any OpenAI-compatible server, declared in the global config from the provider panel (lib/local.ts, /flow/api/local). local- ids, tools on, a context limit, and a zero price row, so spend reads $0 and gauntlet caps still hold. - Spend cap in every mode: Pipeline.maxSpend, $5 by default, read through spendCapOf. The engine hard-stops non-gauntlet runs on the repriced step and records RunLog.capped; a gauntlet keeps its own graceful cap. - Pre-run estimate in the runbar (graph/estimate.ts): card turns from the graph, priced as a range between a short and a heavy turn. - Preflight: weak-seat warns when a dispatching, judging or deciding card runs on a cheaper model than a card it works over; unpriced-cap warns when a model makes the cap partial. - Spend panel shows the share of input served from the prompt cache. - Docs: README "Using Claude", "Local models", "Spend cap and estimate"; provider panel notes on the Anthropic and OpenRouter rows (API key or BYOK, not a subscription). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured against a running LM Studio: its OpenAI /v1/models listing put text-embedding-nomic-embed-text-v1.5 beside the chat models, so the panel offered it to cards, where it fails on the first turn. LM Studio's own /api/v0/models says each model's type and the context it is loaded with; discovery now reads it when present, drops non-chat models, and writes the measured context instead of the 32k floor. Other servers fall back to dropping ids that name an embedding model. Verified end to end: omnicoder-9b, declared from the panel into a v1 global config, read a file with its read tool on a real card session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Issue for this PR
None. This follows a design discussion about how users can run Claude, and free models, in OpenFlow.
Type of change
What does this PR do?
A Claude subscription can't drive OpenFlow. Anthropic doesn't allow it, and OpenRouter's BYOK takes API keys only. So this PR makes the paid API path cheaper and more predictable, and adds a free local path.
lib/local.ts,/flow/api/local, provider panel group). The panel finds Ollama and LM Studio, or a custom OpenAI-compatible URL, lists their models, and declares them in the global config. The declaration needs four fields because the engine's defaults are wrong for a local server:local-id, because the catalog hides a models.dev id likelmstudiountil a key is stored;tools: true, because tools default to off;{0,0};$0while the unpriced-never-$0 rule still holds.Pipeline.maxSpendis read throughspendCapOfand defaults to $5. Non-gauntlet runs hard-stop inenforceCapand recordRunLog.capped. A gauntlet keeps its existing graceful cap. There's acap:selector in the runbar.graph/estimate.ts). Card turns are counted from the graph and each is priced between a short turn and a heavy one. It shows as a range, with an open end for a gauntlet.weak-seatfires only when an orchestrator, critic or synthesizer is cheaper than a card it works over. It suggests a change and never sets a model.unpriced-capfires when a model with no price makes the cap partial.Fork-clean: only
packages/flowandFLOW.mdchange.How did you verify your code works?
bun testpasses (1123 tests) andbun run typecheckis clean. New tests coverlocal.ts, the/flow/api/localroutes (against a tempXDG_CONFIG_HOME), the engine cap (pipeline stopped at the cap, default cap on, a run under it records nothing), the estimate,weak-seat/unpriced-cap, andcacheShare.opencode servewhose global config came fromdeclare(), with a stand-in OpenAI-compatible server in place of Ollama:local-custom/fake-qwenwith no key, priced at 0, with tools on;Screenshots / recordings
The provider panel shows a new Local models · free, on this machine group with Ollama, LM Studio and a custom-server row.
Checklist
🤖 Generated with Claude Code