pllm
Learn

OpenCode

Configure OpenCode to use PLLM through its Chat Completions API gateway.

PLLM documentationView Markdown ↗

Add opencode.json to the project:

This configuration is verified with OpenCode 1.18.31.

{
  "$schema": "https://opencode.ai/config.json",
  "enabled_providers": ["pllm"],
  "model": "pllm/Qwen/Qwen2.5-0.5B-Instruct",
  "provider": {
    "pllm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "PLLM",
      "options": {
        "baseURL": "http://127.0.0.1:8080/v1",
        "apiKey": "local"
      },
      "models": {
        "Qwen/Qwen2.5-0.5B-Instruct": {
          "name": "Qwen 2.5 0.5B Instruct via PLLM"
        }
      }
    }
  }
}

@ai-sdk/openai-compatible uses the gateway's Chat Completions API route. enabled_providers prevents fallback to another configured provider. Start the local gateway before opening OpenCode.

OpenCode custom-tool declarations map to local function tools through the gateway adapter. Text and function-tool traffic is supported. This integration has not established acceptance of every external tool binary or every OpenCode agent feature; test the exact tools and model before relying on them.

Loading documentation index…

Search runs locally in this browser.