Agentic coding

Agentic coding goes beyond chat and inline suggestions. These tools leverage the model’s ability to autonomously complete multi-step tasks. It’s able to read your codebase, edit files, and run terminal commands.

Info

Comparison with commercial models: The Commercial Models - Agentic coding page covers agentic coding workflows using external providers such as Codex and Claude Code. OpenCode supports both commercial-provider API keys and SAIA API key. The tools described below provide comparable agentic coding capabilities using your SAIA API key and models hosted on GWDG’s HPC infrastructure. This allows users to benefit from modern coding assistants while keeping data processing within the institute’s infrastructure, helping to meet data protection, compliance, and confidentiality requirements. For many research and administrative use cases, this provides a practical alternative to external AI services without sacrificing core agentic coding functionality.

To use the internal models hosted on our platform with the below mentioned tools, you need a SAIA API key. If you don’t have one yet, refer to SAIA API keys to request one. The external models are not available via the API.

Contents


Model Selection

For agentic coding workloads, we recommend starting with models that have agentic capabilities. You can select from the full list of available models.

Look for models that are optimized for:

  • Agentic coding: Multi-file editing, codebase exploration
  • Tool use: Terminal commands, web browsing, API interactions
  • Reasoning: Complex problem-solving and planning

When selecting a model, check that it mentions agentic tasks or overall performance in its advantages section or in description. For complex agentic workflows, consider models with larger context windows (200K+ tokens) to handle extensive codebases and longer prompts effectively.

Tip

For agentic coding workloads, we suggest starting with devstral-2-123b-instruct-2512 or qwen3-coder-30b-a3b-instruct. Both are specialized coding-agent models. glm-4.7 is a general-purpose agentic model with strong coding, tool-use, terminal, and web-browsing capabilities.


Continue (Agent Mode)

Continue is primarily a code completion and chat tool, see the Code Completion section for full setup and installation. In addition to code completion, Continue also supports agentic workflows via its built-in Agent mode, where the model can autonomously read files, apply edits, and complete multi-step tasks.

To use Continue for agentic tasks:

  1. Open the Continue panel in VS Code
  2. Switch the mode dropdown in the continue panel from Chat to Agent
  3. Send a task, for example, ask it to refactor a function or add error handling. Continue will propose the changes and ask you to accept or reject them.
Note

For fully autonomous agentic workflows with more advanced tool use, OpenCode works particularly well with SAIA API keys.


OpenCode

OpenCode is an open-source, terminal-first AI coding agent that enables developers to generate code, modify files, execute commands, and automate development tasks directly from the terminal. OpenCode supports both self-hosted and commercial AI models through provider API keys, making it suitable for teams and developers who want to leverage state-of-the-art models while maintaining a terminal-centric workflow. Its design is particularly well suited for SSH sessions, remote HPC environments, CI/CD pipelines, and keyboard-driven development workflows. This section explains how to configure OpenCode with your SAIA API key. For commercial models, see the commercial models guide.

Tip

For local development we recommend running OpenCode in a sandboxed container, so the agent can only affect your current project and nothing else on your system. The steps below install OpenCode directly on your machine; for the sandboxed setup, see OpenCode in a sandboxed container at the end of this section.

Install

# npm
npm install -g opencode-ai

# or with curl
curl -fsSL https://opencode.ai/install | bash

After installation, add OpenCode to your PATH:

echo 'export PATH="$HOME/.opencode/bin:$PATH"' >> ~/.bashrc

Open a new terminal and verify the installation:

opencode --version

Set your API key

Set your SAIA API key as an environment variable:

echo 'export SAIA_API_KEY="your-saia-api-key"' >> ~/.bashrc

Run source ~/.bashrc or open a new terminal for the changes to take effect.

Create the project config

Create opencode.json in your project directory:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "saia": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "SAIA",
      "options": {
        "baseURL": "https://chat-ai.academiccloud.de/v1",
        "apiKey": "{env:SAIA_API_KEY}"
      },
      "models": {
        "qwen3-coder-30b-a3b-instruct": {
          "name": "Qwen3 Coder 30B (SAIA)"
        },
        "devstral-2-123b-instruct-2512": {
          "name": "Devstral 2 123B (SAIA)"
        }
      }
    }
  }
}

You can modify the opencode.json to choose any model of your choice and ensure the model id matches exactly with the SAIA available models.

Launch

# Interactive TUI
opencode

# One-off task example
opencode run "Write unit tests for all functions in src/utils.py"

Models

CommandAction
/modelsOpen model selector to switch between SAIA models
Tip

If models don’t show up, open a new terminal so SAIA_API_KEY is loaded, and check that it’s set (echo $SAIA_API_KEY). If you’re running OpenCode inside VS Code terminal, reload the window (or restart VS Code) so it picks up the variable.

Modes

  • Plan mode: Create structured plans for complex multi-step tasks, review and adjust steps before execution
  • Build mode: Execute approved plans, run automation, and build workflows

Basic Commands

CommandAction
/helpShow available commands
Shift + TabToggle between Plan and Build modes

Adding Context

InputAction
@File picker to add a specific file as context
@filenameDirectly reference a file by name

During a Task

KeyAction
Y or EnterApprove a proposed file change
NReject a proposed file change
AApprove all proposed changes at once

For more information, see the official documentation.

OpenCode inside VS Code

If you prefer to stay in your editor, the OpenCode VS Code extension runs the same OpenCode agent. It uses the same opencode.json and SAIA configuration from the steps above, so there’s nothing extra to set up.

  1. Open the Extensions view ( Ctrl + Shift + X on Linux, Command + Shift + X on macOS).
  2. Search for OpenCode and install it.
  3. Reload VS Code. OpenCode opens in a panel alongside your editor, where you can run tasks the same way as in the terminal.

Optional: SAIA model plugin

Instead of listing models by hand in opencode.json, you can install a plugin that keeps your SAIA model list up to date automatically. On every OpenCode launch, it fetches the current model list from the SAIA API in the background and merges it into your global config, so new models appear without you editing anything.

It is available here: opencode-saia-plugin.

Make sure SAIA_API_KEY is set (see Set your API key), then follow the setup steps in the repository. It will fetch the live model list from the SAIA API and generate an opencode.json with all available models, categorized (reasoning, coder, vision, agentic, etc.)

Note

This plugin is developed by a GWDG team member as a side project, not an officially supported service. We can’t guarantee its behaviour in the future or provide support for it.

For local development we recommend running OpenCode inside a container. The container mounts only your current project directory, so the agent can read and edit your project but cannot run commands that affect files anywhere else on your system. This is the recommended, secure way to use OpenCode locally.

You build an image once, then reuse it from any project. The image is generic. It is not tied to a specific project, and it won’t interfere with a Dockerfile your project may already have.

Prerequisites: Docker or Podman installed on your system.

One-time setup

You only do these four steps once.

1. Create a file named Dockerfile (capital D, no extension) in a dedicated folder of your choice (create one with mkdir opencode-sandbox). This is the standard name that docker build uses by default. Using a different name like dockerfile (lowercase) or Dockerfile.txt can cause the build to not find it, so stick with Dockerfile. Paste the following code to your Dockerfile.

FROM node:20-slim
 
# Install OpenCode
RUN npm install -g opencode-ai
 
WORKDIR /workspace
CMD ["opencode"]

If your projects need a particular language runtime (for example Python, or Python with uv), add it to this Dockerfile before building. The container only has what you install here.

2. Build the image. From inside the folder that contains the Dockerfile, run:

cd opencode-sandbox      # the folder where you saved the Dockerfile
docker build -t opencode-sandbox .

The . means “build using the Dockerfile in the current folder”, so you don’t have to type the path. (Replace docker with podman if you use Podman.) You only repeat this step if you change the Dockerfile.

Confirm the image was created:

docker images | grep opencode-sandbox

3. Add the run-opencode alias. The alias must be written into your shell config file (typing it once at the prompt only lasts for that terminal). Here’s the one-step version that removes any old copies of aliases and adds the clean alias to ~/.bashrc in a single command:

sed -i '/alias run-opencode=/d' ~/.bashrc && cat >> ~/.bashrc << 'EOF'
alias run-opencode='docker run -it --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -e SAIA_API_KEY="$SAIA_API_KEY" -v "$PWD":/workspace -w /workspace opencode-sandbox'
EOF
Note

If you use zsh instead of bash (check with echo $SHELL if it ends in /zsh), add the alias to ~/.zshrc instead of ~/.bashrc, and source ~/.zshrc in the next step. Adding it to ~/.bashrc will have no effect under zsh.

4. Reload your shell so the alias becomes available:

source ~/.bashrc      # or: source ~/.zshrc

Verify the alias is registered:

alias run-opencode

This should print the alias definition back to you. If it does, the setup is complete.

Using it in a project

This is what you do every time you want to work on a project. Note that you run run-opencode from inside the project you want to work on not from the sandbox folder where you built the image.

1. Make sure your API key is set in the current shell (see Set your API key):

echo $SAIA_API_KEY      # should print your key, not be empty

2. Go to the project you want to work on, and make sure it contains an opencode.json (the SAIA config from Create the project config):

cd ~/path/to/your/project

Place opencode.json in the root of the project (the folder you run run-opencode from). The container mounts this folder as its working directory, so OpenCode picks the config up automatically. A global/home config on your host is not visible inside the sandbox, so each project needs its own.

3. Start the sandbox:

run-opencode

This launches the container with the current folder mounted and starts OpenCode. The agent can read and edit the files in this folder, but nothing outside it.

Note

Because the container mounts only the current project directory, OpenCode cannot modify files outside it. This is what makes the setup a safe sandbox for agentic use. The project directory itself remains editable by the agent, which is intended.

Troubleshooting

run-opencode: command not found : the alias isn’t loaded in your shell. Check whether it made it into your config file:

grep -n run-opencode ~/.bashrc      # or ~/.zshrc
  • If it prints nothing, the alias was never added to the file (it was probably only typed at the prompt). Repeat step 3 of the one-time setup, then source the file again.
  • If it prints the alias but the command still isn’t found, confirm you are editing the file your shell actually reads: run echo $SHELL, and use ~/.zshrc for zsh or ~/.bashrc for bash. If OpenCode starts but can’t reach a model: then the key isn’t reaching the container, or the project has no valid config. Confirm echo $SAIA_API_KEY prints your key, and that the project directory contains a valid opencode.json.
Tip

Keeping it alongside an existing Dockerfile: if you prefer to keep the sandbox Dockerfile inside a project that already has its own, give it a different name (for example Dockerfile.opencode) and build with docker build -f Dockerfile.opencode -t opencode-sandbox ..

Dependencies: the container only has what you put in the Dockerfile. If a project needs additional tools or system packages, add them to the Dockerfile and rebuild the image.


Cline

Cline is an open-source coding agent that combines large-language-model reasoning with practical developer workflows. This section outlines Cline’s main benefits, explains its Plan → Act interface, and walks through an installation that connects Cline to SAIA models.

The Plan → Act Loop

  • Plan mode: You can describe a goal, such as “add OAuth2 login”. Cline replies with a numbered plan outlining file edits and commands.

  • Review: Edit the checklist or ask Cline to refine it. Nothing changes in the workspace until you approve.

  • Act mode: Cline executes each step: editing files, running commands, and showing differences. You confirm or reject actions in real time.

This separation gives the agent autonomy without removing human oversight.

Installation Guide (VS Code)

Please find the installation steps below:

  • Prerequisites

    • Visual Studio Code (v1.93 or newer)
    • SAIA API key
    • Node 18+ for optional CLI use
  • Extension installation

    • Search Cline in VScode marketplace and install it.
  • Connecting to CoCo AI

    • Open Cline (Command Palette → “Cline: Open in New Tab”).

    • Click the Setup with own API Key and choose “OpenAI Compatible”.

    • Fill the fields:

      FieldValue
      Base URLhttps://chat-ai.academiccloud.de/v1
      API Keyyour SAIA API key
      Model IDglm-4.7 (add others as needed)
    • Add additional models (e.g., qwen3-30b-a3b-instruct-2507) with the same URL and key if required.

    • Assign roles (if you want a different model for plan and act): For example, set glm-4.7 for Act; set qwen3-30b-a3b-instruct-2507 for Plan.

Daily Workflow

Here is the daily workflow:

Plan → Approve plan → Act → Review differences → Iterate

Cline bridges the gap between chat-based assistants and full IDE automation. With a short setup that points to CoCo AI, it becomes a flexible co-developer for complex codebases while preserving developer’s control.