Coding agent (OpenCode)
OpenCode is an open-source coding agent for the terminal: it reads and edits files, runs commands and works through tasks in a repository. It is provider-neutral, and maKI can be registered as an OpenAI-compatible provider. Your code then stays inside the university network.
Verified with OpenCode 1.18 and opencode-plugin-litellm 1.0 on macOS, Fedora 41 and Windows 11.
Set up in one step
Section titled “Set up in one step”You need a maKI API key with the self-hosted group (see
API keys); a personal key is served first under
load. Then, in a terminal:
# macOS, Linux, Git Bashcurl -fsSL https://maki.uni-mannheim.de/docs/opencode/install.sh | sh# Windows (PowerShell or Command Prompt)powershell -ExecutionPolicy ByPass -c "irm https://maki.uni-mannheim.de/docs/opencode/install.ps1 | iex"The script asks for the key and checks it against the API. Only once maKI
accepts it does it install OpenCode (if missing), write the configuration
and store the key in OpenCode’s credential store. Existing files are backed
up first. For scripts and CI, pass the key via MAKI_API_KEY instead of the
prompt.
At the end the script asks whether to add OpenCode Desktop (the
graphical app). Yes: it is installed and opened. No: the terminal OpenCode
starts right away. The default model is qwen3.8-27b-thinking. For
unattended runs set MAKI_API_KEY, MAKI_OPENCODE_DESKTOP=yes|no and
MAKI_OPENCODE_START=no (skip the final launch).
Then, in a new terminal inside your project:
opencodeWhat the script sets up
Section titled “What the script sets up”OpenCode does not query a model list for custom providers. The plugin
opencode-plugin-litellm does:
at startup it fetches /v1/models and /v1/model/info from maKI and
registers every chat model with its context window. New models appear on the
next start by themselves; embedding, audio and image models stay hidden.
~/.config/opencode/opencode.json:
{ "$schema": "https://opencode.ai/config.json", "plugin": ["opencode-plugin-litellm@latest"], "provider": { "litellm": { "npm": "@ai-sdk/openai-compatible", "name": "maKI (Uni Mannheim)", "options": { "baseURL": "https://maki.uni-mannheim.de/v1" } } }, "model": "litellm/qwen3.8-27b-thinking"}The script also sets OPENCODE_ENABLE_EXA=1 in your shell configuration.
With it OpenCode offers, next to webfetch (fetch a known URL), the
websearch tool the model can use to search the web itself.
The key lives in ~/.local/share/opencode/auth.json under the provider ID
litellm; by hand that is opencode auth login, Other, ID litellm.
Models are named litellm/<model> in OpenCode, e.g. litellm/qwen3.8-27b-thinking.
Choose a model
Section titled “Choose a model”Loading model list …
The installer’s default is qwen3.8-27b-thinking: reasons before answering,
reliable tool calling, 262k context. qwen3.8-27b without reasoning is faster
for short tasks, qwen3.5-122b the strongest local model, gemma4-26b the
fastest.
The plugin fills in the context window from /v1/model/info; OpenCode uses
it to decide when to compact the conversation.
Use it
Section titled “Use it”In the project directory:
opencode # interactive UISwitch models during a session with /models. For single tasks without the
UI:
opencode run "Write tests for parse_config() in config.py"opencode run --model litellm/qwen3.5-122b "Explain the architecture of this repo"-
Data flow. OpenCode sends file contents, command output and the conversation to the model. Through maKI this stays inside the university network; for repositories containing personal data the privacy review from the key request still applies.
-
Web search does not go through maKI. OpenCode has no search engine of its own; the
websearchtool sends the query to the external service exa.ai. That query leaves the university network, unlike everything that goes to the model. To avoid it, removeOPENCODE_ENABLE_EXAfrom your shell configuration again;webfetchand all model calls keep working. -
No account needed, but limits apply. Search works without signing up, though Exa throttles that path. If
websearchcomes back empty, get a free Exa account — $10 of credits per month without a payment method, roughly 1400 searches — and set the key in your shell configuration:Terminal window export EXA_API_KEY="..." -
Context. An agent conversation quickly grows to a hundred thousand tokens. The 262k-context models last longest.
-
Parallel requests. An agent issues many requests in a row. Under GPU load, personal keys are served before service and batch keys, see API keys.
-
Model missing from the picker? The plugin caches the list for seven days and refreshes it in the background; restarting OpenCode shows the current state.