trae-cn-provider: Natively integrate Trae CN models in DeepSeek Harness

Preface

When developing agents or chat applications in DeepSeek Harness (DSH), model sources typically come from official or self-hosted OpenAI-compatible gateways. If you already have a Trae CN account and want the models in Trae’s catalog to appear directly in the DSH model selector—without launching a separate HTTP proxy or manually filling in a base URL—you need a provider registered via DSH’s native LlmAdapter. Below is an introduction to the community plugin trae-cn-provider (maintainer JsonLing, npm package name trae-cn-provider, current version 0.1.6, MIT license): it connects Trae CN into DSH, uses browser OAuth login by default with credentials stored locally; it can also optionally read the login state of the local Trae client, and can mount an OpenAI-compatible path on the host web server for clients such as Cline and Claude Code.

What Is This

trae-cn-provider is a “model inference” plugin for DSH: it registers the provider route trae-cn and pulls the model list from the Trae upstream in real time; it supports streaming output, chain-of-thought (reasoning), native function calling, context window and reasoning levels, as well as multimodal image input. It does not proxy credentials to third parties; the README states that outbound domains are limited to Trae’s official related hosts; it does not modify the Trae client or hook its processes.

The plugin has no official relationship with Trae or ByteDance. The README explicitly states: the project uses Trae client internal interfaces as a general-purpose LLM API, which may violate Trae’s Terms of Service, carrying a risk of account bans, and it consumes quota from your own account; do not install it if you do not accept the above risks.

Core Features

  1. Native use within DSH: After installation and restarting the corresponding profile, a Trae CN group appears in the model selector.
  2. Three credential source tiers (credentialSource): default oauth (one browser login within DSH; the package contains no code path that decrypts local client credentials); optional local (reads the storage.json of the locally logged-in Trae, including the tc decryption path, requiring explicit enabling); auto (prefers saved OAuth, otherwise reads the local client).
  3. OpenAI-compatible surface (enabled by default): mounted under the openAIPath (default /trae-cn) of the host’s existing web server, providing /trae-cn/v1/models, /trae-cn/v1/chat/completions, and /trae-cn/health, without occupying a separate port.
  4. Standalone CLI: can perform local login, list models, start a server, or run a single chat conversation without DSH.
  5. Differences from similar tools (README table): Compared to some dsh-trae-api forks, this project emphasizes the DSH native adapter, macOS paths and credential storage methods, and security defaults such as default 403 for browser Origins.

Installation and Enablement

Web and desktop profiles are installed using npm packages (installation writes to dsh.profile.bundles):

# Web profile
dsh plugin --profile web add trae-cn-provider

# Desktop: must fully quit the DeepSeek Harness desktop app before executing
dsh plugin --profile desktop add trae-cn-provider

If the desktop profile has not fully exited the application, it may report the error: Open DeepSeek Harness Desktop once to initialize its profile, then fully quit it. Uninstall example:

dsh plugin --profile <p> remove trae-cn-provider

Restart the corresponding profile after installation. Node engine requirements are listed in package.json: ^22.19.0 || >=24.0.0. DSH compatibility is declared in the package as compatible with 0.1.2-rc.1, 0.2.0-rc.2, and 0.2.1-alpha.2.

Login and Typical Usage

OAuth within DSH (Default)

Execute the login command in DSH (default /trae-login); the browser opens the Trae official authorization page; the callback listens temporarily on 127.0.0.1, and credentials are written to ~/.trae-proxy/credentials.json by default (permissions 0600). The directory can be changed with the environment variable TRAE_PROXY_CRED_DIR; if the DSH credentials service is available, it will preferentially write to that service.

Configuration Overrides

Adjust behavior through the profile’s cordis.patch.yml, for example:

- id: trae-cn
  config:
    credentialSource: oauth      # oauth | local | auto
    edition: cn                  # local/auto 时读哪个 edition
    requestStyle: chat_v3        # chat_v3(实测可用)| inline_chat(实验)
    appVersionCode: 20260901     # 须为纯整数,默认已满足完整模型目录
    mountOpenAIEndpoint: true
    openAIPath: /trae-cn
    allowBrowserOrigins: []      # 带 Origin 的浏览器请求默认 403

A too-small appVersionCode causes the upstream to return fewer available chat models; the default 20260901 does not need manual modification. When allowBrowserOrigins is empty, browser pages cannot directly hit the local OpenAI surface; clients such as Hermes, openai-python, and curl that do not send Origin are not affected.

OpenAI-Compatible Clients

After the host web is enabled, the external path looks like /trae-cn/v1/chat/completions. Standalone CLI examples (paths have no prefix, directly /v1/...):

node src/cli.js login
node src/cli.js models
node src/cli.js serve --port 8317 [--api-key <key>]
node src/cli.js chat "你好"

npm scripts also provide the trae-cn binary: login, models, serve, chat.

Model Catalog

Models are not hardcoded by the plugin; after filtering, the README lists 20 user-selectable chat models as tested locally in October 2026 (such as the Doubao-Seed series, DeepSeek-V4, Kimi, GLM, Qwen, etc.). The complete table can be found in the GitHub README. Catalog size is affected by factors such as appVersionCode and the logged-in device’s DeviceName; the default device name takes the local short hostname, which can be overridden with TRAE_PROXY_DEVICE_NAME.

Use Cases and Cautions

Suitable for: Developers who are already developing in DSH web or desktop profiles, want to connect the Trae CN account quota directly to the upstream locally, and optionally want to reuse the same login state for OpenAI-compatible tools.

Must pay attention to:

  1. The plugin runs with the permissions of the current DSH process; before installation, please read the GitHub repository source code and MIT license, and read the risk statement in the README.
  2. Selecting local / auto enables the path that reads the local Trae storage.json; local may become invalid as the client rewrites storage, so the more stable long-term option is the default oauth or auto with OAuth priority.
  3. Do not distribute credentials and plugin configuration to others together.
  4. The community catalog SkillHub plugin page and GitHub are independent information sources, with no official affiliation with DeepSeek / High-Flyer; star counts etc. are based on each site’s display at the time.

Conclusion

trae-cn-provider integrates Trae CN as a native DSH LLM provider: default browser OAuth, credentials not leaving the local machine, optional OpenAI-compatible mounting, and a standalone CLI. Please evaluate Trae’s terms and account risks yourself before use.

  • Catalog page: https://www.skillhub.cn/plugins/JsonLing/trae-cn-provider
  • Source code and documentation: https://github.com/JsonLing/trae-cn-provider
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye