Continuing from Part 1 which was to deploy the Qwen 3.8 27B paramater model into AKS via the KAITO add-on, I will show the setup and demo of the OpenCode coding agent harness.
OpenCode is a terminal-based agent harness. I chose OpenCode as it is light weight and easily configurable to custom LLM endpoints. At the time I had challenges getting VS Code Github Copilot Chat Agent to call with LLM endpoint and so I resorted other options such as OpenCode which I was able to get working with more ease. Another day, I will try further to get Github Copilot Chat Agent to work.
To recap from Part 1, the architecture is as follows:

Configure opencode.jsonc
Create opencode.jsonc in the root of the project where OpenCode will run. In my case, it is in /.config/opencode/
{ "$schema": "https://opencode.ai/config.json", "provider": { "kaito-qwen38": { "name": "KAITO Qwen3.8-27B Direct Endpoint (AKS)", "options": { "baseURL": "http://4.172.39.200/v1", "apiKey": "dummy" }, "models": { "qwen3.8-27b": { "name": "Qwen3.8-27B", "limit": { "context": 32768, "output": 4096 } } } } }, "model": "kaito/qwen3.8-27b"}
What each important field does
modelselects the fully qualifiedprovider/modelentry. Here,kaitois the provider ID andqwen3-14bis the model key.provider.kaitoidentifies the KAITO-backed custom provider and gives it a display name.options.baseURLpoints to the API root, including/v1; it is not the full/chat/completionspath.options.apiKeyis sent as a bearer token.dummyis only a placeholder for this vLLM service because it does not validate the key.models.qwen3-14bregisters the model exposed by the endpoint. The model key should match the ID returned byGET /v1/models.limit.contextandlimit.outputtell OpenCode how much context and output the endpoint can support. The 32K value includes system instructions, conversation history, tool schemas, and file content.permissioncontrols whether OpenCode can edit files or run shell commands without approval. Asking for these actions is a useful default for a first demo.
Start OpenCode
From the project directory containing opencode.jsonc:
opencode

An opencode session loads. You can see the Qwen3.8-27B is selected by default as per the opencode.jsonc

Enter /models to confirm that Qwen3.8-27B is available under the kaito provider

Other models are available for purchase or free via your OpenCode account.
Demo: build and validate a small ToDo List App
Run OpenCode in the project and give it a staged request:
Inspect the current project first. Build a minimal browser todo app using plain HTML, CSS, and JavaScript.Create index.html, styles.css, and app.js. The app must add todos, mark them complete, delete them,and persist them in localStorage. Keep the implementation dependency-free.Before editing, explain the files you plan to create. After editing, run the available validation commandor a syntax check, then summarize the changed files and any remaining limitations.
A typical agent loop is:
- OpenCode reads the project and sends the task, workspace context, and available tool definitions to Qwen3.8-27B.
- Qwen3.8-27B returns a plan or a tool call using the format parsed by vLLM’s Hermes parser.
For example, a tool call asking OpenCode to create the app entry point may look like this after the OpenAI-compatible response has been decoded:
{ "tool_calls": [ { "id": "call_01", "type": "function", "function": { "name": "write", "arguments": { "filePath": "index.html", "content": "<!doctype html>\n<html lang=\"en\">\n <body>\n <main id=\"app\"></main>\n http://app.js\n </body>\n</html>" } } } ]}
This is an example of the decoded tool-call payload, not a response that a user should paste into a terminal. OpenCode interprets it, requests permission according to the configured policy, and performs the write locally.
- OpenCode asks for permission before using
write,edit, orbashaccording topermission. - OpenCode executes the approved file operation or command on the local workstation.
- The tool result is sent back to the model, which continues until the task is complete.
For a lightweight validation, ask OpenCode to run:
Review the todo app you just created. Check that app.js parses, verify localStorage is used,and run a repository-appropriate test or syntax check. Do not change the implementation unless afailure is found.
For a plain JavaScript demo, a useful shell check is:
node --check app.jsgit diff --checkgit status --short
Open index.html in a browser and verify the user-visible behavior: adding an item, completing it, deleting it, and refreshing the page without losing the remaining items.
Troubleshooting the handoff
/v1/models works but OpenCode cannot connect
Check that baseURL ends at /v1, not /v1/chat/completions, that the LoadBalancer IP is reachable, and that the project config is being loaded with opencode debug config.
The server returns an unknown model error
Use the exact model ID returned by /v1/models. The Kubernetes workspace name, Hugging Face preset name, and vLLM served model ID are related but are not interchangeable strings.
Text generation works but tools do not
Confirm that the KAITO ConfigMap is active and that vLLM includes:
enable-auto-tool-choice: truetool-call-parser: hermes
Then make sure the OpenCode request is using the configured provider, rather than another provider selected from the model picker. Tool calling also depends on the model’s ability to produce the expected schema; a capability flag alone cannot create an execution layer.
Requests fail with context-length errors
The 32768 context window is shared by the system prompt, tool definitions, conversation history, file contents, and generated output. Reduce the task scope, start a new session, exclude large generated directories, or lower the configured output budget. Raising limit.context in JSONC cannot enlarge the vLLM model context.
The first response is slow or times out
A single A100 must prefill the complete prompt before generation. Keep the first test small, allow a longer header or chunk timeout, and inspect the vLLM logs and GPU utilization. A longer client timeout helps with latency; it does not fix a failed model load or unavailable GPU.
What this setup demonstrates
This setup creates a complete local coding-agent loop around a private inference backend:
- AKS and KAITO provide the GPU-hosted model workload.
- vLLM provides an OpenAI-compatible API and parses Qwen tool calls.
- OpenCode supplies workspace context, tool permissions, file editing, and shell execution.
- The developer remains in control of approvals and can inspect every resulting diff.
That separation is the practical value of the architecture. The AKS endpoint does not need to know how to write a local file or run a local test. It only needs to return reliable model responses and tool calls. OpenCode turns those responses into an agent workflow at the developer’s workstation.
Cleanup
When the experiment is complete, remove the workspace if the A100 should be released:
kubectl delete -f qwen3-14b-workspace.yaml
The endpoint, model, and agent harness are separate layers, so each can be validated independently before combining them.
Pingback: Qwen3-14B on AKS with KAITO and OpenCode: Build a Tetris Game with AI