LM Warden

OpenCode on your own GPUs.

LM Warden as an OpenAI-compatible provider for OpenCode, one served model.

Protocol
OpenAI Chat Completions
Support
Local models only
Verified
Run against a live warden on 2026-10-04 with opencode 1.18.31. A one-word reply and a read-file tool call.

Local models only, over Chat Completions (@ai-sdk/openai-compatible; @ai-sdk/openai would use the Responses API, which this warden translates for Codex CLI only). The model id must be a served name from /v1/models. For a committed file, use {env:LMWARDEN_KEY} instead of the key. Router mode through OpenCode’s Anthropic provider is not covered yet.

Requirements

  • Needs a model with tool calling (agentic edits).
  • Works best with at least 32,768 tokens of context.

Setup

In the console, Connect writes these files with your warden’s address, your key and the model you picked. Here they are with placeholders.

Local models

Add LM Warden as a provider in opencode.json and make it the default.

opencode.json (opencode.json)
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "lmwarden": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Warden",
      "options": { "baseURL": "https://your-warden/v1", "apiKey": "vw_YOUR_KEY" },
      "models": {
        "your-served-model-name": { "name": "your-served-model-name", "limit": { "context": 32768, "output": 8192 } }
      }
    }
  },
  "model": "lmwarden/your-served-model-name"
}
Shell
opencode run "Reply with the single word OK."

Official documentation: https://opencode.ai/docs/providers/ (read 2026-10-04).