GeezerVison is showing github.com — feat(core): discover Unsloth Studio models (local runtime — like Ollama, LM Studio, vLLM) · Issue #59557 · anomalyco/opencode
feat(core): discover Unsloth Studio models (local runtime — like Ollama, LM Studio, vLLM) #59557DescriptionSummary
Unsloth Studio is a local model runtime that exposes an OpenAI-compatible API on localhost (default port 8888, backed by llama-server). Its model inventory is per-machine and changes at runtime — it's whatever the user has downloaded/loaded in the app. That puts it in the same class as Ollama, LM Studio and vLLM, which opencode serves with in-repo runtime discovery plugins built on createLocalProviderPlugin (packages/core/src/plugin/provider/local.ts).
Request: add packages/core/src/plugin/provider/unsloth.ts following the same pattern, so discovered Unsloth models appear (and stay in sync) without hand-encoding every model in opencode.json.
Why the models.dev routing doesn't cover this
I understand new providers are normally added to models.dev rather than this repo. But a static catalog structurally cannot represent a runtime-local inventory:
The precedent is well established: three separate discovery feature PRs plus a dedicated refactor to share the machinery (#53438).
#46975 asked for a "native provider" (the /connect flow entry) and was closed pointing at models.dev — a fair answer to that ask. This request is different: runtime model discovery, which no catalog entry can provide. Nobody has asked for that part yet, hence this issue.
API surface (verified live against a running Unsloth Studio)
GET /v1/models requires Authorization: Bearer sk-unsloth-… and returns an OpenAI-style list with a few extra fields:
{
"object": "list",
"data": [
{
"id": "unsloth/LFM2.5-24B-A2B-GGUF",
"object": "model",
"created": 1793091398,
"owned_by": "unsloth-studio",
"loaded": false,
"quant": "UD-IQ3_XXS",
"display_name": "LFM2.5-24B-A2B-GGUF",
"status": { "value": "unloaded" }
}
]
}
owned_by is always "unsloth-studio", so filtering like vLLM's plugin does is trivial.
display_name + quant map naturally to the model display name (e.g. LFM2.5-24B-A2B (UD-IQ3_XXS)).
loaded distinguishes in-memory vs. downloaded models (could be surfaced or used for ordering).
GET /v1/models/{id} returns the same shape — no context-length metadata, so discovery can't populate limit.context (same gap tracked in Feature: Dynamic context length detection for OpenAI-compatible providers #40908; tool/vision capabilities are also not reported, so conservative defaults like vLLM's plugin would apply, overridable via config).
- Unlike Ollama/LM Studio, auth is mandatory — but
createLocalProviderPlugin already folds apiKey from config settings ({env:}/{file:} substitution included), which is exactly what unsloth start opencode already writes today. Default origin would be http://127.0.0.1:8888 (Unsloth's own opencode integration docs standardize on 8888; the API docs say "typically 8000 or 8888").
- The default
stripPathSuffix: /\/v1$/ already handles the documented base URL form http://localhost:8888/v1.
Concrete pain today
Custom-provider users must hand-maintain every model in opencode.json. Right now my local Unsloth server lists 9 models while my config encodes 8 — I downloaded ggml-org/Kev-9B-GGUF after writing the config, and it silently doesn't exist for opencode until I edit JSON by hand. With discovery it would just appear, same as it does for Ollama.
Worth noting Unsloth actively maintains an opencode integration (unsloth start opencode, dedicated docs page) — they're an invested partner here, and I'd be glad to loop them in.
Happy to contribute
I have a live server to test against and would send a PR following the vllm.ts template (one ~40-line plugin file + registration in packages/core/src/plugin/provider.ts), reusing the existing factory so no new framework code paths are added. Related open work in this area: #54011. If maintainers would rather see this land via a models.dev entry plus custom-provider config, I'd still argue the discovery plugin is the piece that makes local Unsloth usable without manual JSON — but happy to follow whatever direction you prefer. Activityopencode-agent commented on Oct 27, 2026 Thanks for the detailed write-up and for offering a PR! To restate: you'd like a built-in discovery plugin for Unsloth Studio, like the existing vLLM, LM Studio and Ollama ones. It would read the authenticated GET /v1/models on 127.0.0.1:8888 so downloaded models appear automatically, instead of each one being listed by hand in opencode.json. Maintainers will consider it.
Related work you may want to check:
yannickloth commented on Oct 27, 2026 Thanks for the triage — followed up on all pointers.
On #57161 (generic discovery for configured OpenAI-compatible providers): if that lands, it covers the core need here — a configured unsloth-studio custom provider would get its model list at runtime, no hand-encoded opencode.json models. I'd rather see that generic mechanism land than a per-provider plugin, and I have a live Unsloth Studio server (v0.1.910-beta, port 8888, bearer sk-unsloth- auth) to test it against — happy to verify /v1/models discovery, the modalities fallback (Unsloth's list response carries no input_modalities/supported_parameters, so text-only + config overrides is the right default there), and streaming/tool-calling behavior on a real endpoint. Will report findings on that PR.
For completeness, what a dedicated plugin would still add on top of #57161: zero-config activation when a Studio server is reachable (default origin 127.0.0.1:8888, no opencode.json block needed), owned_by: "unsloth-studio" filtering, and display names with quantization (from display_name/quant fields). But those are conveniences — happy to drop the ask if #57161 is the preferred shape.
The companion catalog entry is in review at anomalyco/models.dev#11692 (validate passing, review actions addressed). neriousy commented on Nov 12, 2026 Thanks! We're not adding more built-in integrations or listings for this. Providers can be added through models.dev or a custom provider in config, and integrations can ship as a plugin.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|