dsh-input-limit: Directly set the current model's input limit on the Web chat page

Introduction

In DeepSeek Harness (dsh), every model has a context window (input limit). This value influences the context pressure indicator in the UI and determines when auto-compaction is triggered. If an adapter’s default window is larger than the model’s actual capability—for example, pi-ai defaults to 262144 (displayed as 256K), but a specific route only supports 128K—running with default configuration will cause the pressure bar and compaction strategy to be inconsistent with the actual available space.

Typically, you can modify the contextWindow for each model under a provider in the Settings. However, if you need to verify or change the limit for the current model during an active conversation, you must leave the composer and navigate to the settings page, which involves too many steps. The community plugin dsh-input-limit introduced below places the “effective input limit of the current model” directly into the Web chat input bar, on the same row as the model selector, allowing for in-place viewing and modification.

What is this

dsh-input-limit is a community plugin for DeepSeek Harness, maintained by viyu-tech. It adds a small chip to the composer tool row (next to the model selector) that displays the current model’s input limit. It supports clicking to enter a precise token count to save, or restoring the provider’s default value.

The plugin runs browser-only: it adds no custom host logic. Simply install, load the plugin, and restart dsh web. Settings writes utilize the same typed RPC as the Settings page, taking effect on the next request.

Core Features

Status Display

  • Displayed as a pill on the right side of the message input bar, e.g., Input limit 128K.
  • If the value is inherited from the provider default, it includes a · default marker.
  • Hovering the mouse reveals the precise token count.

Capacity numbers use the binary scale common in model specifications: 1K = 1024, 1M = 1024². For example, 131072 is displayed as 128K, and the pi-ai default 262144 is displayed as 256K.

In-place Modification

  1. Click the pill to pop up a popover.
  2. Enter the precise token count (e.g., 131072 or 131,072). A live display will show the approximate equivalent, such as ≈ 128K, as you type.
  3. Select Save to save, or Reset to default to restore defaults.

Upon saving, the plugin writes the contextWindow override per model into the corresponding provider settings namespace (e.g., llm-pi-ai, llm-deepseek), preserving the remaining fields in the models array within settings. Changes drive the context pressure display and auto-compaction. If the settings document has been updated by another editor during the write, the plugin will first re-read the settings and automatically retry once upon settings/conflict to avoid silent overwrites.

Scope

  • Applicable to all configurable providers (pi-ai routes, direct DeepSeek adapters, etc.).
  • The chip automatically hides if the current model or provider is not configurable.

Installation & Activation

Environment Requirements (from the project README):

  • dsh CLI (tested on 0.1.5-rc.2; requires a build with the Web UI plugin system).
  • pnpm (used by the plugin installation process).
  • A provider with writable settings configured (pi-ai or deepseek-official).
  • Web interface using the web profile; restart dsh web after installation.

Once the package is published to npm: Sidebar Plugins → Add plugin, enter dsh-input-limit, select the registry (default npm, with built-in npmmirror fallback), then Install → Enable now.

Install from npm

dsh plugin --profile web add dsh-input-limit
dsh web

Install from GitHub

Replace <you> with your actual GitHub username or organization name (this repository is viyu-tech):

dsh plugin --profile web add github:<you>/dsh-input-limit
dsh web

When installing from Git, pnpm blocks dependency build scripts by default; this repository includes pre-built lib/ files, so the blocked prepare script generally does not affect usage. If you wish to rebuild locally during installation, configure allowBuilds in the profile’s pnpm-workspace.yaml as prompted by pnpm and re-run the installation.

Install from Local Directory or Tarball

# Run in the parent directory of the directory containing the plugin package
dsh plugin --profile web add ./dsh-input-limit
dsh web          # Restart (or reopen http://127.0.0.1:3080)

Uninstall

dsh plugin --profile web remove dsh-input-limit

The current npm package version is 0.1.1, License MIT.

Typical Usage

After installation and activation, open the chat page in dsh web to view the current “Input limit” pill next to the model selector.

Verify Default Value: If it shows Input limit 256K · default, it indicates the current model inherits the default contextWindow from the provider configuration. Hover to check if the specific token count matches your route documentation.

Correct According to Real Window: If a model actually only has 128K but the interface default is larger, click the pill, enter 131072 (or 131,072 with a thousands separator), confirm the live hint shows approximately 128K, and click Save. Thereafter, the settings will retain this override for the same model; context pressure and compaction behavior will be calculated based on the new limit.

Restore Default: Select Reset to default in the popover to remove the override for that model and re-inherit the provider default.

When switching the current model during a session, the chip will refresh based on modelSelection and settings updates.

Scenarios & Notes

Who it is for

  • Developers who frequently use pi-ai multi-routing or DeepSeek official adapters where context windows vary significantly across models.
  • Users who need to quickly align “displayed limit / compaction threshold” with the model’s real capabilities during a conversation without repeatedly opening Settings.

Compatibility

  • README indicates testing on dsh 0.1.5-rc.2. The client plugin declares dependent dotted services (e.g., remote.settings, remote.session) in its inject. If your dsh build renames or removes these interfaces, the plugin will fail explicitly rather than throwing silent exceptions.

Security & Trust

  • The plugin runs with the permissions of the current dsh process and its Web session. It modifies local provider settings, which is equivalent to manually changing contextWindow in the Settings page.
  • It is recommended to review the source code and MIT license on the GitHub repository before installation. The community plugin directory site is not officially affiliated with DeepSeek or High-Flyer; users make their own judgments regarding selection and activation.

Conclusion

dsh-input-limit moves the “input limit of the current model” from the settings page to the composer row: visible, editable, and resettable to default, sharing the same settings write path as DSH’s context pressure and auto-compaction. If you are already using a configurable pi-ai or DeepSeek provider, you can install it into the web profile using the commands above to try it out.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye