
A developer on the Chinese tech forum LINUX DO recently did what thousands of developers there do every week: he got his hands on a subscription pack, installed every coding agent he could find, and stress-tested them against real work. After the dust settled, two tools survived — Claude Code's CLI and Tencent's CodeBuddy CLI. Then came the practical question that turns a toy into a daily driver: the built-in model menu didn't include the model he actually wanted to use. The thread's answer, which drew a fresh round of replies this week, was a single JSON file.
That file — models.json — is the whole story of how China's developers treat AI coding tools: not as closed products with a fixed model list, but as agent runtimes you point at whatever model API you happen to hold. This is a guide to how that works, what the file actually contains, and why the feature matters far more in China than it does in the West.
CodeBuddy is Tencent Cloud's AI coding assistant, and it ships in several shapes: IDE plugins for VS Code and JetBrains editors, a full AI code editor, and a terminal-first CLI called CodeBuddy Code. The CLI is the agentic one — it reads files, runs shell commands, edits code, and works through multi-step tasks while you watch, rather than just completing the line you're typing.
The interface follows the pattern that Claude Code established: you run codebuddy to open an interactive session, or codebuddy "fix this bug" to fire off a single task and get a result. Slash commands handle the housekeeping — /model to switch models, /config for settings, /cost to see what the current session burned, /doctor to diagnose a broken setup. A --print (or -p) flag runs the whole thing headless, which makes it scriptable: you can pipe git log into it and ask for analysis, or call it from CI. It also speaks MCP, so databases, search tools, and other services can be attached as tools the agent can call.
All of that is documented on CodeBuddy's official site and in Tencent Cloud's docs, and the headline capabilities — modes for asking, planning, and crafting code, memory of your preferences, custom rules and skills — are positioned squarely against the Western agentic CLIs. The forum's draw is simpler, though. As one commenter put it, he prefers CLI tools because his machine is old and can't comfortably run a full IDE. The CLI's footprint is tiny compared to an Electron editor, and on modest hardware that decides the contest before features do.
Custom model integration through an API is an official, documented CodeBuddy feature — Tencent's own docs list it alongside MCP and custom agents. The mechanism is a configuration file that lives outside any single project:
~/.codebuddy/models.jsonC:\Users\<your-name>\.codebuddy\models.jsonTencent's documentation confirms the shape: a models array holding full model definitions, plus an availableModels array listing which of those definitions actually show up as selectable. The documented fields for each entry are an id, a display name, a vendor label, an apiKey, and a url pointing at the model endpoint.
The LINUX DO tutorial that revived this week goes further, documenting the community-tested extensions that power users actually fill in. Here is the full field map, marked by where each piece comes from:
| Field | What it does | Source |
|---|---|---|
id / name | Internal id and the display name in the model picker | Tencent docs |
vendor | Provider label; forum users set it to an arbitrary "Custom" value | Community-reported |
url | The model endpoint (OpenAI-compatible chat-completions style) | Tencent docs |
apiKey | Your key for that endpoint | Tencent docs |
maxInputTokens / maxOutputTokens | Context and output limits, matched to the real model | Community-reported |
temperature | Sampling temperature | Community-reported |
supportsToolCall | Declares the endpoint can handle tool/function calls | Community-reported |
supportsImages | Declares image input works | Community-reported |
supportsReasoning | Declares the model exposes reasoning output | Community-reported |
A minimal community-style entry looks like this:
{
"models": [
{
"id": "my-coding-model",
"name": "My Coding Model",
"vendor": "Custom",
"apiKey": "sk-your-key-here",
"url": "https://your-provider.example/v1/chat/completions",
"maxInputTokens": 200000,
"maxOutputTokens": 32000,
"temperature": 0.7,
"supportsToolCall": true,
"supportsImages": false,
"supportsReasoning": true
}
],
"availableModels": ["my-coding-model"]
}
The tutorial's original example used a domestic model id with a 1M-token context window and 64K output cap — the exact numbers you fill in depend on the model behind your endpoint, and getting them wrong is the most common source of truncated or refused responses. Forum users also report that a per-project .codebuddy/models.json works for project-scoped overrides, though that placement is community-tested rather than documented.
One caveat straight from Tencent's own docs: the configuration parameters differ between CodeBuddy versions, so a field that works today may be renamed tomorrow. Treat any tutorial — including this one — as a map to the current release, and check /doctor and the official docs when something stops parsing.
Here is the part that explains why a thread about a JSON file stays alive for a month. China's developer community runs on API relay stations — resellers that pool access to major models and sell it at a fraction of official prices through OpenAI-compatible endpoints. Many of the cheapest relays expose only plain chat-completion endpoints, with no Anthropic-style tool-calling API attached.
That is normally a dealbreaker for agentic coding tools. Claude Code expects an Anthropic-format API; a chat-only relay endpoint simply cannot drive it. But forum users report that CodeBuddy CLI handles this differently: it converts chat-completion endpoints into agent-capable sessions internally, so a relay key that can only "chat" can still power a coding agent that calls tools. As one commenter summarized, the other domestic agents they tried — naming a few newer Chinese CLIs in the same breath — have added similar chat-protocol support, which is why this crowd keeps a shortlist of homegrown tools alongside Claude Code.
Treat that conversion claim as community-reported rather than documented — it comes from the forum discussion, not Tencent's docs — but it explains the economics clearly. If you hold API credit at a relay station, the value of a coding CLI is decided by which endpoint formats it tolerates, not by whose logo is on the box. A permissive model file turns "cheap chat key" into "cheap coding agent," and in a community where relay-station arbitrage is a lifestyle, that is the feature that matters.
A few things the tutorial thread glosses over that are worth stating plainly:
The file holds a raw API key in plaintext. That is how the mechanism works, and it means the file must never be committed to a repository, pasted into a screenshot, or synced to a shared dotfiles repo without redaction. Treat models.json the way you treat an SSH private key.
Billing moves with the key. Once the CLI routes requests through your endpoint, usage is billed by whoever issued that key — not by any bundled quota or subscription attached to the tool. That is the entire point of the setup for relay-station users, but it also means a runaway agent loop spends your money, not the vendor's. The /cost command is worth checking until you trust your limits.
Expect rough edges. The same forum voices praising CodeBuddy CLI call it buggy without hesitation — the consensus is "best experience among the domestic options, with bugs you'd expect from a fast-moving tool." Pin your expectations accordingly, and keep the official docs open; the community config and the shipped behavior drift apart regularly.
Compare before you commit. This site previously compared CLI and desktop AI coding agents head to head. The short version still holds: CLIs win on composability and low resource use, desktops win on discoverability. The models.json pattern is the CLI camp's strongest argument — no desktop agent lets you reroute its brain this freely.
This configuration is worth the ten minutes it takes if any of these describe you: your hardware wheezes under a full IDE but runs a terminal fine; you already hold API credit at a provider or relay and want every coding session billed there; or you have a specific model — a long-context domestic model, a cheap high-volume one, a reasoning model — that no tool's default menu includes.
Skip it if the bundled models already cover your work, or if you want zero configuration: the defaults exist precisely for that user, and the file is there for everyone else. Either way, the file is the honest interface between the tool and the model market. Most coding agents hide that boundary; CodeBuddy CLI — at least as China's developers use it — leaves it as a JSON file you can read.