GeezerVison is showing github.com — [FEATURE]: Support decision models from local OpenAI-compatible providers (LM Studio /v1/systemone) · Issue #64306 · anomalyco/opencode
[FEATURE]: Support decision models from local OpenAI-compatible providers (LM Studio /v1/systemone) #64306DescriptionDescription
LM Studio 0.4.28 ships native decision models and a Jev / System One compatible endpoint: POST /v1/systemone accepting { model, state, questions } and answering noul (predicate), choice and score questions. That is the same protocol OpenCode already speaks through @opencode/ai/providers/typesafe-ai, so a fully local decision backend is now technically available — for example rizzo-flow, a 4B Spark X2.5 LoRA with 1M context, ~2.6 GB at Q4_K_M.
OpenCode already exposes decisions (/api/experimental/generate/decisions) and supports them for 8 built-in cloud providers (baseten, cloudflare-ai-gateway, cloudflare-workers-ai, digitalocean, opencode, openrouter, typesafe-ai, vercel-ai-gateway). There is no way to point them at a local endpoint:
@opencode/ai/providers/openai-compatible has no decisions module.
- Declaring
"type": "decision" on a custom provider's model makes the model disappear from the catalog. A/B is unambiguous: without type the model appears in /api/model, with type: "decision" it is silently dropped (same result with a per-model package: "@opencode/ai/providers/typesafe-ai").
- Overriding the native
lmstudio provider is ignored: the log reports retained native value over legacy value.
Result: POST /api/experimental/generate/decisions for lmstudio/rizzo-flow returns
422 UnsupportedModelError
lmstudio/rizzo-flow is a chat model, not a decision model
Why it matters: local decisions would enable privacy-preserving, zero-cost, rate-limit-free classifiers for permission auto-approval, context pruning plugins (fast-jev-compaction style), routing and retry logic. No API key, no data leaving the machine.
Proposed change (any of these unblocks it)
- Add a decisions transport to
openai-compatible that posts to {baseURL}/systemone (or {baseURL}/decisions) when a model is declared type: "decision". This also covers llama.cpp's System One API and any Jev-compatible server, not just LM Studio.
- Let a provider or a single model declare its decision endpoint explicitly (e.g.
decision: { baseURL, model }), decoupling the capability from the 8 hardcoded provider packages.
- At minimum, stop discarding
type: "decision" models from custom providers, and route them through the System One protocol.
Steps to reproduce
- LM Studio 0.4.28: download a decision model (
rizzo-flow) and start the server on 127.0.0.1:1234.
- Declare a custom provider:
"providers": {
"local-rizz": {
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "http://127.0.0.1:1234/v1" },
"models": {
"rizzo-flow": { "name": "rizzo-flow 4B", "type": "decision" }
}
}
}
opencode api get /api/model -> no local-rizz models.
- Remove
"type": "decision" -> the model appears, but the decisions endpoint rejects it.
POST /api/experimental/generate/decisions with {"model":{"providerID":"lmstudio","id":"rizzo-flow"},"input":[...],"questions":[...]} -> 422 UnsupportedModelError.
Environment
- opencode
2.2.5
- Windows 11 build 26300.9974, Windows PowerShell 5.1
- LM Studio 0.4.28,
POST http://127.0.0.1:1234/v1/systemone reachable and working
Related
Activityopencodejr commented on Nov 16, 2026 Thanks for the detailed request and the clear A/B test.
You're asking for decisions (/api/experimental/generate/decisions) to work with local decision models served over LM Studio's System One endpoint (/v1/systemone), from the native lmstudio provider or from a custom OpenAI-compatible provider.
Most of this has already been worked on: #63200 ("feat(core): run LM Studio decision models") was merged on the main branch after 2.2.5. It adds:
- a new
@opencode/ai/providers/openai-compatible/decisions entrypoint that sends System One requests to the provider's base URL;
- LM Studio discovery that now lists decision models as decision models with that package, instead of filtering them out;
- support for running a local decision model without an API key (before, this failed with
Missing auth credential: apiKey).
From what I can tell, this change is not in a published release yet, so 2.2.5 behaves as you describe. Once a release includes it, lmstudio/rizzo-flow should be listed as a decision model.
On a model disappearing when it has "type": "decision": the providers docs say type "Defaults to chat; only chat models are offered for sessions". That is probably why it drops out of the list you checked. On a release that includes #63200, setting the model's package to @opencode/ai/providers/openai-compatible/decisions (instead of the TypeSafe one) together with type: "decision" is the closest match to what the PR adds. I have not verified that this config works end to end.
Your second proposal, an explicit per-provider or per-model decision endpoint setting, is not covered by that PR. Maintainers will consider it along with the rest of this request.
Related:
neriousy commented on Nov 23, 2026 Since v2.3.0 (#63200), LM Studio decision models are listed as decision models and run without an API key. On a custom provider, set the model's package to @opencode/ai/providers/openai-compatible/decisions with type: "decision". A per-provider or per-model decision endpoint would be a separate request.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|