9 November 2026

Trying open-weight models as coding agents

I’ve been running a coding agent without Claude behind it. The agent is opencode, and the models are open-weight ones served through Hugging Face’s inference router, on my own Hugging Face token rather than a coding subscription.

From what I’ve given them so far, models like DeepSeek V4.1 Flash 1017 and GLM-5.3-Flash are almost good enough for professional work in a setup like this one.

What they produced

On everyday TypeScript work, each run cost a few cents. What came back:

  • Strictly typed code with thorough tests that all passed, and in one case a clear README. DeepSeek turned on stricter compiler settings than I’d have asked for.
  • Sensible handling of edge cases nobody had mentioned, and validation that rejected bad input properly.
  • Gaps a reviewer would catch. The serious one was a logic bug that let invalid data through, and the model’s own tests all passed because none of them tried the input that triggered it. I only found it by checking the work from outside.
  • GLM reached for older library versions, probably whatever was current when it was trained. DeepSeek used current ones.

That’s the “almost”. The code was good enough to start reviewing, at a cost of cents, but passing its own tests didn’t make it right.

How the models are served

None of this runs on my Mac. Hugging Face’s router sits in front of several inference providers, and a model ID can name the provider after a colon. The worker model in my config is pinned that way:

huggingface/zai-org/GLM-5.3-Flash:novita

Checking for tool support

opencode can only act on a model’s output if it comes back as structured tool calls, and support for those is per provider, not per model. The router’s /v1/models endpoint reports supports_tools for each provider of each model. It’s the first thing to check before a model goes anywhere near an agent config.

Models served only by Featherless are where this bites. They write their tool calls as plain text, like call:read{...}, which opencode can’t execute, so the agent never actually reads a file. My config still lists four of them, community fine-tunes of Qwen3.8, Qwen3.6 and Gemma 4, each capped at a 32k context. They’re there as chat-only models, for questions rather than tasks.

GLM-5.3-Flash as the worker

The config defines a helper subagent on GLM-5.3-Flash, pinned to the Novita provider:

"helper": {
  "description": "Worker on GLM-5.3-Flash. Give it one self-contained task with the exact files and the expected result.",
  "mode": "subagent",
  "model": "huggingface/zai-org/GLM-5.3-Flash:novita"
}

A short delegate skill tells the main agent how to use it. It treats the worker’s output as unchecked until the main agent has looked at it:

- Each task: exact files, the change wanted, what done looks like. It has none of your context.
- Keep tasks small. Never ask it to read the whole repo.
- Check its result (read the diff, run tests). Send a focused fix task if wrong.
- If it errors twice, do that step yourself and say so.

The same skill covers the case where I name a specific model. Subagents have a fixed model, so the main agent shells out to opencode run -m with the model and provider instead, and only to providers that support tool calls.

Making it safe to try untrusted models

Trying a new model means handing a shell to a model I know little about, served by a provider I know little about. I wasn’t willing to do that on my own machine, so the agent runs inside a Docker Sandboxes microVM, set up so that a model behaving badly has nothing personal to reach:

  • The agent works on a throwaway repo with a fake git identity, cloned into the VM with --clone so the host copy stays read-only.
  • Everything lives under /Users/Shared, since the sandbox mounts the workspace at its host path and a home-folder path would put my username in the model’s prompt.
  • The Hugging Face token never enters the VM: it’s a custom secret scoped to router.huggingface.co, and the sandbox proxy swaps a placeholder for the real token on the way out.
  • SSH agent forwarding and browser passthrough are off, so the agent can’t push as me or open URLs in my signed-in browser.

The network is open on purpose. The agent needs web search and arbitrary sites, and with nothing worth taking inside the VM, open egress is a trade-off I’m comfortable with. The agent can’t read the token, but it can still make requests with it. That’s the exposure I accepted.

What made it fiddly

The sandbox runs Ubuntu 26.04 on aarch64, and Chrome for Testing has no Linux ARM64 build, so the agent’s headless browser needed Playwright’s Chromium instead, pointed to with AGENT_BROWSER_EXECUTABLE_PATH. A 401 from Hugging Face turned out to mean a bad token value, not a proxy failure. And sbx login is required even for local sandboxes.

Open-weight models aren’t a drop-in replacement for a coding subscription yet. But in the work I’ve given them, DeepSeek V4.1 Flash 1017 and GLM-5.3-Flash came close enough that I expect agentic coding without a subscription to be practical within a couple of years, as long as the provider returns real tool calls and something other than the model checks the work.