Skip to main content

dsh-llm-codebuddy

20Stars1Forks1Issues0Watchers

Adds CodeBuddy China region model support to DeepSeek Harness, with WorkBuddy API Key and web token dual authentication.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
dshdsh-plugindsh-plugins

Install

cmdweb profile
$ dsh plugin --profile web add dsh-llm-codebuddy

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Axiaohungry/dsh-llm-codebuddy for me: review the repository at https://github.com/Axiaohungry/dsh-llm-codebuddy first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Pitch

Add the CodeBuddy China model provider to DeepSeek Harness, enabling DSH users to access models either via WorkBuddy-distributed API Keys or by logging in directly with CodeBuddy China account tokens.

Core Features

  • Add CodeBuddy China to the WebUI "Add Provider" dropdown and register it according to DSH's Provider protocol
  • Provide two authentication methods: WorkBuddy API Key mode and CodeBuddy China account token login mode
  • Inject a toggle button for "API Key" and "Token Login" next to the API Key input field, enabling one-click browser login from the web interface
  • Automatically fetch the list of models available with the current Key from CodeBuddy's API, and allow custom editing, adding, and deletion of models
  • Automatically set thinking capability tiers (off / minimal / low / medium / high / xhigh / max) and default tier based on model declarations
  • Automatically refresh tokens using the official refresh API before expiration, eliminating manual re-login

Technical Implementation

  • Language: JavaScript (ESM, type: module)
  • Key Dependencies: @deepseek-ai/dsh-llm-pi-ai, @earendil-works/pi-ai, @deepseek-ai/dsh-settings, @deepseek-ai/dsh-credentials
  • Architecture Pattern: Server-side uses cordis.patch.yml to disable the host's built-in llm-pi-ai, insert a new Plugin named llm-codebuddy, and rely on DSH's installSettingsSection / registerAdapter / registerModelDiscovery hooks; Front-end injects client.js into the API Key input field via Web Profile to implement the authentication toggle button
  • Entry Points: index.js (server plugin), client.js (WebUI injection script), cli.js (standalone install/login/uninstall CLI)

Use Cases

Users who already have WorkBuddy-distributed API Keys or CodeBuddy China accounts and want to use CodeBuddy model inference capabilities in DSH; especially developers who want to avoid manually copying API Keys and want automatic token renewal.

Prerequisites & Compatibility

DependencyMin VersionDescription
DSH0.1.0-rc.6Verified with this version; DSH is still in pre-release, future interface changes require synchronized updates
Node.js>= 22.19.0Required for installation
PlatformmacOS / Windows / LinuxCross-platform; browser login calls open / rundll32.exe / xdg-open based on OS
Native ModulesNoneOnly depends on pure JS packages (yaml, pi-ai, etc.), no modules requiring local compilation

Installation

dsh plugin --profile web add dsh-llm-codebuddy

Configuration Options

ConfigTypeDescriptionDefault
llm-pi-ai.providers.codebuddy-cnObjectWhether to declare this Provider node; if present, considered enabledNot present
llm-pi-ai.providers.codebuddy-cn.apiKeyEnvStringCredential reference for API Key mode; deleting this field switches to token modeCODEBUDDY_API_KEY
llm-pi-ai.providers.codebuddy-cn.modelsArrayCustom model directory; if not configured, uses online directory, falls back to built-in directory on failureNot configured
models[].idStringModel ID, requiredNone
models[].nameStringDisplay name in WebUI; empty inherits from online/built-in directoryInherits
models[].contextWindowIntegerContext window size262144
models[].maxTokensIntegerSingle output limit32768
models[].inputString ArrayInput types (text, image)Inherits
models[].reasoningEffortsObjectPer-tier mapping to CodeBuddy actual values; empty tier means that tier is unavailableModel declaration
models[].compat.thinkingFormatStringReasoning content formatModel declaration

FAQ

Q: After installation, I don't see the CodeBuddy China option in WebUI?

A: You must restart DSH after installation or update; running processes won't automatically load new plugins. After restarting, open "Settings → Models" and the option should appear.

Q: What if I fail to get the model list?

A: First confirm the API Key is from WorkBuddy and still valid, then re-enter the Key and click "Get Available Models". If CodeBuddy's API is temporarily unavailable, the plugin will fall back to the built-in model directory, still allowing normal use.

Q: Why can others see a certain model but I can't?

A: Model permissions are tied to the current API Key. The plugin only imports models authorized for the current Key on CodeBuddy; after changing Keys, you need to click "Get Available Models" again to sync the new account's permissions.

Q: Getting 500 status code (no body) when calling?

A: Upgrade to the latest version and restart DSH. Early versions may have had DSH overwrite CodeBuddy's request User-Agent identifier causing the server to reject requests; the latest version has restored the official identifier at the request layer.

Q: After uninstall, WebUI still shows old pages?

A: Close the running DSH process and restart. Running processes won't automatically unload loaded plugin code.

Q: WebUI can't automatically open browser for login?

A: Run npx dsh-llm-codebuddy@latest login in the terminal; the plugin will invoke the CodeBuddy official authentication flow and automatically switch the Provider to token mode upon completion.

Q: Will uninstalling the plugin lose credentials?

A: No. Uninstall only deletes the Provider configuration in settings.yaml; API Keys and login tokens in DSH's credential service will be preserved for easy reinstallation.

Getting Started Difficulty

Beginner — Both authentication modes have clear documentation, configuration file semantics are intuitive, and CLI install/login/uninstall commands are all encapsulated. Regular users can complete setup by following the README steps.

Known Issues & Limitations

  • DSH is still in pre-release phase; when DSH adjusts plugin interfaces in the future, this plugin will need synchronized upgrades (README.md:35)
  • When user-filled model parameters exceed the server's actual limits, CodeBuddy may still directly reject requests (README.md:111)
  • Model list only fetches models authorized by CodeBuddy's /v3/config for the cli agent; other agents' models won't be displayed (index.js:133)
  • Streaming request idle timeout is 300 seconds; requests exceeding this will be interrupted (index.js:31)
  • Browser login waits up to 10 minutes maximum; timeout requires re-initiating (codebuddy-auth.js:121)
  • Tokens are considered for refresh 2 minutes before expiration to avoid expiring during requests (codebuddy-auth.js:172)
  • Old versions may have DSH overwritten CodeBuddy's request identifier; upgrading the plugin restores the official User-Agent (README.md:188)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Axiaohungry/dsh-llm-codebuddy)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory