One-Click Deployment of an AI Coding Workbench: Building an Agent Team with Domestic Models

    This article explains how to build a local AI coding workbench powered by domestic (Chinese) models, where the real bottleneck is not reasoning quality but connectivity and workflow. It covers a three-layer approach (model access, tool capabilities, process knowledge), why an AI gateway is needed for unified keys, routing, rate limiting and cost tracking, a four-stage cross-platform one-click deployment script for Windows, Linux and macOS, a minimal four-role agent team, browser and desktop automation with explicit safety boundaries, reusable skill files, and a three-layer validation, troubleshooting and cost governance checklist. Readers get concrete configuration, code and table examples they can adapt to their own environment.

    1. Background: The Capability Gap Is Not About the Model

    Over the past two years, AI coding tools have evolved from editor plugins that merely autocomplete code into agents that can autonomously read files, modify files, and execute commands. They can iterate and debug inside a terminal, and they can be orchestrated into pipelines. However, when developers want to use domestic (Chinese) models, they often run into a structural gap: the models’ reasoning ability is already good enough, but the surrounding connectivity is missing a large piece.

    The reason lies in differences in business models. Some overseas solutions tightly bind capabilities such as “parallel multi-agent scheduling,” “taking over an already logged-in browser session,” and “one-click access to email and calendar” to their subscription accounts. Once you switch to a third-party model using an API key, following the official documentation, those managed connections are disabled and only the generic plugin protocol remains. As a result, developers using domestic models have to fill in these capabilities themselves.

    The approach to filling the gap can be abstracted into three layers:

    • Model access layer: unify keys and routing so that each tool does not store its own copy of credentials;
    • Tool capability layer: use a standard plugin protocol to equip agents with file, browser, and desktop operation abilities;
    • Process knowledge layer: use structured skill files to spell out “how a certain type of task should be done.”

    Below, using Baidu AI Cloud as the model provider, is a cross-platform implementation method.

    2. Concept Alignment: What Five Terms Actually Mean

    Agent: a program with a perceive–decide–act loop. It does not just answer questions; it can read files, write files, run commands, and self-correct based on execution results.

    Workbench: the layer that puts multiple agents into the same web interface for unified orchestration. Compared with opening a dozen terminal windows at once, a web workbench provides task visualization, shared context, and centralized permission management.

    Plugin protocol (commonly known as MCP): a standardized specification for connecting tools. With a browser plugin installed, an agent can open pages and click buttons; with a desktop plugin, it can operate local software; with a filesystem plugin, it can safely read and write specified directories.

    Skill file: an operating manual written for agents, describing “how to format a document” or “how to run a regression test” in natural language with step constraints. It addresses process knowledge, not model capability.

    AI gateway: a reverse-proxy-style model access service. All agents’ model requests point to it; keys are stored in only one place, and switching models requires changing only one configuration.

    3. Architecture: Why a Gateway Is Necessary

    Writing keys directly into every tool’s configuration file creates three problems: keys are scattered and hard to rotate; different tools support inconsistent model protocols; and it is impossible to enforce unified rate limiting and cost accounting.

    Introducing a gateway converges these three points:

    1. [Multiple Agents] --> [AI Gateway: auth/routing/rate limiting/logging] --> [Domestic Model API]
    2. |
    3. +--> [Unified key management]
    4. +--> [Usage metering and auditing]

    Gateways usually support mainstream open API styles, so most agents that support a custom endpoint can connect without code changes. An example configuration (address and fields depend on the actual deployment):

    1. {
    2. "provider": "custom-openai-compatible",
    3. "base_url": "http://127.0.0.1:8080/v1",
    4. "api_key": "read from environment variable",
    5. "model": "your-domestic-model-name"
    6. }

    Two hard security recommendations: the gateway should listen only on the loopback address or an internal network and must not be exposed directly to the public internet; keys should be injected via environment variables or a key management service and never committed to a repository.

    4. One-Click Deployment: Four Stages of a Cross-Platform Script

    Differences among Windows, Linux, and macOS concentrate in three areas: package managers, paths, and permissions. The script should therefore detect the platform and then follow the same logic.

    1. Environment detection: identify the operating system and architecture, check runtime versions, and fill in missing pieces with the system package manager.
    2. Dependency installation: install the runtime, basic command-line tools, and certificate chains, all from verifiable sources.
    3. Component setup: pull the workbench and gateway executables or images into a unified directory structure.
    4. Service registration: on Linux use service units, on macOS use launch agents, and on Windows use services or scheduled tasks, to achieve auto-start on boot and restart after crashes.

    Example on Linux:

    1. # Verify the runtime
    2. python3 --version || sudo apt-get install -y python3
    3. # Start the gateway (listening on localhost only)
    4. export GATEWAY_KEY="$(openssl rand -hex 16)"
    5. nohup gateway --host 127.0.0.1 --port 8080 > gateway.log 2>&1 &

    For script engineering, also note: roll back on failure, make repeated runs idempotent, persist logs to disk, and give a clear message when a port is already in use.

    5. Assembling an Agent Team: Division of Labor Matters More Than Headcount

    The value of multiple agents comes from context isolation and role specialization, not from the number running in parallel. A practical minimal lineup:

    • Research agent: read-only access, responsible for searching the codebase and materials and producing a summary of conclusions;
    • Implementation agent: can write to specified directories, responsible for changing code and running builds;
    • Verification agent: responsible for running tests and static checks, and can reject the implementation result;
    • Documentation agent: responsible for turning changes into documentation and commit messages.

    Two points on orchestration. First, context passing must be explicit: write upstream conclusions as structured artifacts (such as JSON or Markdown) to avoid full conversation histories polluting each other. Second, apply least privilege: grant read/write directories, executable commands, and network access separately; the verification agent should not have write access.

    6. Filling the Gaps: Browser and Desktop Automation

    On the browser side, a separate process is usually needed to host the session and accept instructions through a debugging protocol. The key design is to reuse an existing login state rather than logging in again: have the automation process connect to an already-running browser instance with the debugging port enabled; the agent only sends instructions and never touches account credentials.

    On the desktop side, system-level automation interfaces are required, and capability boundaries must be declared explicitly: limit the allowlist of operable applications, enforce a second confirmation for irreversible actions (delete, send, pay), and keep an operation log throughout.

    High-risk actions should go through a unified confirmation layer:

    1. DANGEROUS = {"delete", "send", "pay", "deploy"}
    2. def run_tool(name, args, confirmed=False):
    3. if name in DANGEROUS and not confirmed:
    4. return {"status": "need_confirm", "preview": args}
    5. return executor.call(name, args)

    7. Skill Files: Turning Experience into Reusable Assets

    The value of a skill file is turning “how a veteran does it” into a shared team asset. A qualified manual should include: applicable scenarios, prerequisites, input format, step-by-step operations, validation criteria, and failure rollback. Taking document formatting as an example:

    1. # Skill: Generate a properly formatted document
    2. ## Prerequisites
    3. - Document-processing plugins are loaded
    4. - The output directory exists and is writable
    5. ## Steps
    6. 1. Read the template and extract style definitions
    7. 2. Write the body by section, keeping heading levels no deeper than three
    8. 3. Unify figure numbering and caption placement
    9. 4. Generate the table of contents and verify page numbers
    10. ## Validation
    11. - No empty headings; numbering is continuous; fonts match the template
    12. ## Rollback
    13. - If validation fails, keep the previous version and output a diff list

    8. Validation, Troubleshooting, and Cost Governance

    Before going live, run three layers of validation: connectivity (whether the gateway returns results), tool-level (whether each plugin can be invoked successfully on its own), and end-to-end (whether a real task can complete the full loop).

    Common failures and the order in which to investigate:

    Symptom First thing to check
    All agents report authentication failures Gateway key does not match the environment variable
    A single tool is unavailable Plugin process not started or path authorization missing
    Long task interrupted Gateway timeout threshold and context length limit
    Responses slow down Concurrency rate limiting, log level, model tier selection

    Cost recommendations: bind different model tiers to different roles—use a lightweight model for research and a more capable model for implementation; cache results for repeated requests; bill by call volume rather than by persona.

    9. Conclusion

    The bottleneck for building an agent team with domestic models has never been reasoning quality, but connectivity and workflow. Converging model access with a unified gateway, filling tool capabilities with a standard plugin protocol, and accumulating process knowledge with skill files—combined with a one-click script for cross-platform deployment—yields a self-controlled, model-swappable, capability-extensible local AI productivity environment. This approach does not depend on any single vendor’s subscription system, and migration costs are kept to a minimum.