Skip to content

OpenCode

OpenCode is an OpenAI-compatible coding CLI. Point it at alcf-proxy's /v1/chat/completions endpoint with a custom provider.

1. Start the proxy

alcf-proxy serve        # http://localhost:11445

2. Configure an OpenAI-compatible provider

OpenCode is configured via opencode.json (project root) or ~/.config/opencode/opencode.json. Add a custom provider that points at the proxy:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "alcf": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "ALCF (via alcf-proxy)",
      "options": {
        "baseURL": "http://localhost:11445/v1",
        "apiKey": "dummy"
      },
      "models": {
        "openai/gpt-oss-120b": { "name": "gpt-oss-120b (ALCF)" }
      }
    }
  }
}

Then select the model in OpenCode (e.g. alcf/openai/gpt-oss-120b).

Cross-platform config location

~/.config/opencode/opencode.json — or opencode.json in your project root.

~/.config/opencode/opencode.json — or opencode.json in your project root.

%USERPROFILE%\.config\opencode\opencode.json — or opencode.json in your project root.

Environment variable alternative

Many OpenAI-compatible tools also accept OPENAI_BASE_URL / OPENAI_API_KEY:

export OPENAI_BASE_URL="http://localhost:11445/v1"
export OPENAI_API_KEY="dummy"
$env:OPENAI_BASE_URL = "http://localhost:11445/v1"
$env:OPENAI_API_KEY = "dummy"

Model ids

Use the id for the active cluster: openai/gpt-oss-120b (sophia) or gpt-oss-120b (metis). Run alcf-proxy models to list them.