Preface

If you’re using DeepSeek Harness (dsh) with the web profile and want to connect OpenAI-compatible gateways like NewAPI without modifying dsh itself, this plugin is worth a look.

DSH follows the philosophy of “everything is a plugin”; the community directory is an independent site with no official affiliation to DeepSeek / High-Flyer. dsh-llm-newapi is an LLM Provider plugin that adds a NewAPI provider to dsh, with provider route id newapi and display name NewAPI. The README describes it as “zero modifications to dsh itself”.

What This Is

  • Repository path: wenzetan/dsh-llm-newapi
  • License: MIT
  • Plugin category: LLM Provider
  • Purpose: Adds a NewAPI provider to dsh without modifying dsh itself
  • Interface: Implements the LlmAdapter seam from @deepseek-ai/dsh-llm for OpenAI-compatible gateways
  • Endpoints:
  • POST {baseURL}/chat/completions
  • GET {baseURL}/models
  • baseURL must include /v1
  • Structure: host-side adapter, chat-only model discovery, and a NewAPI settings page in dsh web
  • Installation channels: npm registry, versioned GitHub tags, release tarball, local link development
  • API key: Configured via the web settings page, fixed credentials reference name is newapi, not read from environment variables

Core Features

  1. Adds a NewAPI provider
    The plugin registers provider route id newapi in dsh with display name NewAPI.

  2. Connects OpenAI-compatible gateways
    It implements the LlmAdapter seam, using POST {baseURL}/chat/completions and GET {baseURL}/models. The baseURL must include /v1.

  3. Two-sided architecture
    The host side provides the LLM adapter and chat-only model discovery; the browser side provides a NewAPI page in the dsh web settings panel.

  4. Model discovery
    Fetches the model list via GET {baseURL}/models and only adopts models that can serve chat-completions. Models with types like embedding, rerank, and ranker are filtered out based on naming conventions, unless adjusted via configuration.

  5. Web settings page configuration
    After installation, open the NewAPI settings page in dsh web, enter the API key and gateway address, use Fetch model info to pull the model list, select chat models, and save.

  6. Configurable options
    The configuration can define:
    - baseURL
    - models
    - modelExcludePatterns
    - defaultContextWindow
    - maxTokens
    - providerHints

  7. Write validation
    When writing settings, configuration validation rejects non-http(s) baseURL values and empty filter entries.

  8. API key behavior
    The API key is not read from environment variables. Without a key, the first request will fail with the error MISSING_CREDENTIAL, which points to the settings page.

Installation and Activation

The README requires dsh version to be at least:

dsh ≥ 0.1.0-rc

The dsh web profile is used as an example below.

Installing the Stable Version

Use the npm registry:

dsh plugin --profile web add dsh-llm-newapi

Then edit:

$DSH_HOME/profiles/web/package.json

Add the following to the dsh.profile.bundles array:

"dsh-llm-newapi"

Finally, restart dsh web.

Installing from a Stable GitHub Tag

Use a moving GitHub tag:

dsh plugin --profile web add "github:wenzetan/dsh-llm-newapi#latest"

After installation, you still need to add dsh-llm-newapi to dsh.profile.bundles and restart dsh web.

Installing a Prerelease Version

Use the npm next channel:

dsh plugin --profile web add dsh-llm-newapi@next

After installation, register the bundle and restart dsh web as well.

The README also supports release tarball or local link development, but the bundle registration and restart steps after installation are the same.

Possible Missing-Peer Warnings During Installation

Seeing missing-peer warnings during installation is expected. Runtime peers such as react, cordis, dsh-llm, dsh-settings, and schemastery are provided at runtime by the dsh host app.

Do not manually install these peers, and do not enable autoInstallPeers. Doing so may lead to duplicate cordis services and cause plugin failures.

Do Not Use Untagged GitHub Shorthand

The untagged form github:wenzetan/dsh-llm-newapi installs the main HEAD. The README marks it as not recommended for release use.

Typical Usage

After installation and bundle registration, open the NewAPI settings page in dsh web:

  1. Enter the API key.
  2. Enter the gateway address, which must include /v1.
  3. Click Fetch model info to pull the model list from GET {baseURL}/models.
  4. Select the chat models you want to use.
  5. Save.

After saving, the models under the newapi provider can be used in dsh web as models for that provider.

Below is a configuration example; adjust it based on your gateway address and model catalog:

- id: llm-newapi
  name: dsh-llm-newapi
  config:
    baseURL: http://gateway.local:3000/v1
    # models: []
    # modelExcludePatterns:
    #   - embed
    #   - rerank
    #   - ranker
    # defaultContextWindow: 128000
    # maxTokens: 8192
    # providerHints: {}

Where:

  • baseURL must include /v1.
  • models is the suggested catalog.
  • modelExcludePatterns is used for filtering during chat-only model discovery.
  • defaultContextWindow is used for the context window when there is no corresponding model entry in the catalog.
  • maxTokens is used for model invocation parameters.
  • providerHints is used for provider hints configuration.

The API key is not entered in the configuration. It lives under the fixed credentials reference newapi, and the only configuration entry point is the web settings page.

Applicable Scenarios and Notes

Suitable for the following cases:

  • Using the dsh web profile.
  • Needing to connect to NewAPI or compatible OpenAI-compatible gateway model services.
  • Wanting to add a provider route through the dsh plugin mechanism rather than modifying dsh itself.
  • Preferring to manage the API key through the web settings page instead of environment variables.

Notes before use:

  • The dsh version must meet the README requirement: dsh ≥ 0.1.0-rc.
  • After installation, you need to add the plugin to dsh.profile.bundles in $DSH_HOME/profiles/web/package.json and restart dsh web.
  • Missing-peer warnings are expected; do not manually install peers or enable autoInstallPeers.
  • The untagged github:wenzetan/dsh-llm-newapi installs the main HEAD and is not recommended for release use.
  • The API key is not read from environment variables; without a key, the first request returns MISSING_CREDENTIAL.
  • Model discovery only adopts models that can serve chat-completions; models of types like embedding, rerank, and ranker are filtered by naming conventions by default.
  • It will be loaded and run as a bundle of the dsh web profile; review the source code and MIT license before installation.

Links

  • Community directory page: https://www.skillhub.cn/plugins/wenzetan/dsh-llm-newapi
  • GitHub: https://github.com/wenzetan/dsh-llm-newapi