Skip to content
DOCS / OpenCode

OpenCode

Add Fast Inference as an OpenCode provider and restore the previous provider state.

The fast opencode adapter registers Fast Inference as an OpenAI-compatible provider in ~/.config/opencode/opencode.json. It selects one callable model and snapshots the original file before making changes.

Connect OpenCode

  1. Install and sign in

    bash
    npm install -g @inference/fast
    fast login
  2. Register the provider

    bash
    fast opencode on

    The adapter preserves unrelated providers and settings while adding the Inference.net endpoint, machine key, and selected model.

  3. Restart and verify

    bash
    fast opencode status

    Restart OpenCode, select the Inference.net model, and send a prompt. Check the request in Usage.

Model selection

The initial model defaults to glm-5.2. Copy another callable ID from the model catalog when you want to change it:

bash
fast opencode on --model <catalog-id>

The adapter registers the selected model under the inference-net provider and makes it the default and small model.

Existing configuration

The adapter merges the provider into the JSON document and keeps unrelated top-level settings. It also stores the complete original file in ~/.inference-fast/backups.

Restore your configuration

bash
fast opencode off
fast opencode status

The original JSON snapshot is restored byte-for-byte. Restart OpenCode after restoration.

Troubleshooting

  • Confirm the file is at ~/.config/opencode/opencode.json for the current user.
  • Choose a callable model ID from the model catalog.
  • Run fast status to confirm the CLI and dashboard use the same first project.
  • Restart OpenCode after every configuration change.