Skip to content

feat(web): add Crusoe as a provider preset - #93

Open
hqt08 wants to merge 2 commits into
mainfrom
feat/crusoe-provider
Open

hqt08 wants to merge 2 commits into
mainfrom
feat/crusoe-provider

Conversation

@hqt08

@hqt08 hqt08 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Using Crusoe's managed inference (open models such as gpt-oss-120b, Nemotron, Gemma and Kimi over an OpenAI-compatible API) in Lecturn meant creating an OpenCode instance by hand and knowing which environment variables to set.

This adds Crusoe as a choice in the Add provider dialog. OpenCode already knows Crusoe's endpoint, so the choice is a preset rather than a new driver. It creates an OpenCode instance with:

  • CRUSOE_API_KEY, stored as a secret (kept in the secret store, never sent back to clients, deleted when the instance is removed)
  • OPENCODE_CONFIG_CONTENT={"enabled_providers":["crusoe"]}, so the instance lists only Crusoe models

The label defaults to "Crusoe" (opencode_crusoe), and the last step asks only for the API key; the dialog won't save without one. There are no server, contract or mobile changes. Each OpenCode instance already runs its own opencode serve with that instance's environment.

Before / after

Before After
before after
Identity defaults Key step Stored instance
identity key env

A real turn on Crusoe gpt-oss-120b through Lecturn:

picker
turn

Crusoe listed in provider settings

Crusoe also has a standing row in Settings > Providers, below OpenCode, like the built-in drivers. It starts disabled, with an empty secret CRUSOE_API_KEY field. Pasting a key or turning it on saves it as the opencode_crusoe instance. It has no delete button; reset removes the saved instance and the stored key. The + dialog option remains for adding a second Crusoe account. Cherry-picked from #99.

Surfaces

  • Entry points: the only place provider instances are created is the Add provider dialog in Settings > Providers.
  • Clients: web and desktop (desktop wraps web). Mobile has no add-instance flow for any provider, but a Crusoe instance created on web or desktop shows up in mobile's model picker like any other instance.
  • Providers: only OpenCode is involved.
  • Reverse states: the key and config can be edited in the instance's Environment section, and removing the instance also removes the stored secret.
  • Docs: new docs/user/providers-crusoe.md, linked from the OpenCode page and the docs index.

Known limitation

OpenCode's Crusoe model list comes from models.dev and is out of date. DeepSeek V3 0324 and GLM 5.1/5.2 are listed but return model_not_found. DeepSeek V4 and GLM 5.3 are live on Crusoe but not listed. The user doc lists only models verified live. The fix belongs upstream in models.dev and will follow separately.

Testing

  • vp test run apps/web/src/components/settings plus the OpenCode provider and adapter tests: 351 passed
  • New tests for buildCrusoeProviderInstance: it refuses a blank key, the result decodes as a ProviderInstanceConfig, the key is stored as a secret, and the instance is limited to Crusoe
  • Web typecheck and lint pass
  • Manual pass in an isolated dev server with a real Crusoe key: added the instance, opened the picker, and ran a gpt-oss-120b turn that created a file (diff and generated title shown above)

Written by Claude Opus 5.5 in Claude Code.

Crusoe's managed inference serves open models (gpt-oss-120b, Nemotron,
Gemma, Kimi) over an OpenAI-compatible API, and OpenCode already knows
its endpoint. Getting there meant hand-adding an OpenCode instance with
the right environment variables.

Add a Crusoe choice to the Add provider dialog. It creates an OpenCode
instance with CRUSOE_API_KEY stored as a secret and
OPENCODE_CONFIG_CONTENT limiting the instance to the crusoe provider, so
its picker lists only Crusoe models. No server or contract changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crusoe only existed once added through the + dialog, so Settings >
Providers showed the seven drivers but no Crusoe until then.

Settings now keeps a standing Crusoe row (opencode_crusoe) below
OpenCode, disabled, with an empty secret CRUSOE_API_KEY field. Pasting a
key or turning it on saves it as a regular OpenCode instance. Like the
built-in rows it has no delete; its reset removes the saved instance and
the stored key, returning the row to its disabled state. The preset now
lives in crusoePreset.ts, shared by the panel and the + dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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