Cordium documentation · Latest
OpenCode
OpenCode is an open source coding agent that works with many LLM providers. This example sets up a Template in which OpenCode can use both Anthropic's models and a self-hosted open model served by vLLM in a private network, through Octelium LLM Services. Developers use it interactively from their terminals, and the same Template runs one-shot tasks via opencode run.
Since the models are reached through Octelium, the Workspaces need neither API keys nor any network route to the private network that hosts the vLLM server. Octelium also lets you decide, per User, Group, Space or Template, which models can be used, and audits every inference request (read more here).
The Octelium Services
In addition to the anthropic Service (read more here), a Cluster administrator exposes the vLLM server as an LLM Service in the ai-platform Namespace. Since vLLM exposes an OpenAI-compatible API, the Service uses the OPENAI protocol. The vLLM server can run anywhere, including behind a NAT, by serving the Service from a connected Octelium client (read more here):
The Template
The following Template installs OpenCode and configures two providers: the built-in anthropic provider pointed at the anthropic Service, and an internal OpenAI-compatible provider pointed at the qwen.ai-platform Service:
The apiKey value is a placeholder: Octelium injects the real API key and never forwards the one sent by the client. Since the Template uses the github GitProvider of the payments Space, each developer signs in to GitHub from the web portal, and the repository is cloned and pushed with their own GitHub account (read more here).
This Template is not pre-built, since pre-builds do not use the GitProvider credentials of the Users and therefore cannot clone a private repository on their behalf. Each Workspace installs OpenCode once on its first run, and keeps it afterwards since it is persistent.
Interactive Use
Create a persistent Workspace, sign in to GitHub from its page in the web portal, start it, and run opencode from a browser terminal or over SSH:
From the OpenCode TUI, you can switch between anthropic/claude-opus-5-5 and internal/qwen3-coder at any time. Since the Workspace is persistent, your OpenCode sessions, the repository and any installed tool survive across restarts.
One-Shot Tasks
opencode run runs a single task non-interactively, which is useful for scripted maintenance work. Here is an example that uses the self-hosted model to upgrade the Go dependencies of the repository in a running Workspace:
You can also restrict which models a Template's Workspaces are allowed to use via Octelium Policies, for example to keep the Workspaces that work on sensitive code on the self-hosted model only (read more here).