DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-math-input

x

dsh-math-input

Manifest valid

`dsh-math-input` is a DeepSeek Harness plugin that provides offline math input with zero token consumption. Its core features include handwriting recognition (based on an ONNX model + beam search), LaTeX auto-fixing and rendering (KaTeX), and a handwriting canvas UI. All inference is performed client-side in the browser, with no dependency on any remote API.

UI (client)hasBundlePatch

dsh-math-input

English | 中文

A zero-token, fully offline math input plugin for DeepSeek Harness (DSH). Handwrite formulas, OCR them from screenshots, or edit LaTeX directly — all recognized in your browser, no API key, no token cost.

Why you need it

DSH's composer is plain text. If you want the model to reason about a formula, you type LaTeX by hand — slow and error-prone. This plugin adds three input methods plus inline rendering:

Input methodBest forEngine
HandwritingHave a stylus / mouse, want to write a formula fastCoMER neural network (ONNX Runtime Web)
Screenshot OCRAlready have a formula image (PDF screenshot, etc.)Same engine, image-to-tensor recognition
LaTeX editorKnow LaTeX syntax, want a symbol paletteNo recognition needed, direct input
Inline renderingType \[ ... \] in the composer, auto-rendersKaTeX

All recognition runs via ONNX Runtime Web (WASM / WebGPU). The model is 7.2 MB, downloaded once and cached in IndexedDB. The plugin never calls ctx.llm — your token bill stays at zero.

Install

Prerequisites

  • DeepSeek Harness >= 0.1.1-rc.2
  • Node.js >= 20.0.0
  • Chrome or Edge (for WebGPU support and SharedArrayBuffer)

Install the plugin

# from GitHub
dsh plugin --profile web add github:<owner>/dsh-math-input

# without global dsh CLI
npx @deepseek-ai/dsh plugin --profile web add dsh-math-input

Restart the DSH profile after install (stop and re-run dsh web). A "+" button appears to the left of the input row — that means the install succeeded.

Uninstall

# remove from DSH profile
dsh plugin --profile web remove dsh-math-input

# or without global CLI
npx @deepseek-ai/dsh plugin --profile web remove dsh-math-input

Restart the DSH profile. The "+" button and all input windows will be removed.

The model cache (IndexedDB database math-handwrite-models) is not automatically cleared. To clean it up manually, go to browser DevTools → Application → IndexedDB and delete the database.

Usage

Click the "+" button to the left of the input row to open the menu:

1. Handwriting input

  1. Click "Handwriting input" in the menu — a canvas modal pops up
  2. Draw a formula with mouse, touch, or stylus
  3. Stop for ~1.5 seconds (configurable in Settings) — the engine recognizes automatically
  4. The result renders as a KaTeX preview; the LaTeX source is editable below
  5. Click "Confirm and insert" — the formula enters the composer as \[ ... \] and renders inline
  6. Click "Clear" to start over, "Undo" to remove the last stroke

2. Screenshot OCR

  1. Click "Screenshot and recognize" in the menu
  2. Ctrl+V to paste an image, or click "Upload file" to select a local image
  3. The engine extracts LaTeX from the image automatically
  4. Review the preview and click "Confirm and insert"

3. LaTeX syntax editor

  1. Click "LaTeX syntax editor" in the menu — a dock panel expands below the input row
  2. The palette offers Greek letter buttons (\alpha, \beta, \pi, etc.) and template buttons (\frac{}{}, \sqrt{}, \sum_{}^{}, etc.)
  3. Click any button to insert the corresponding LaTeX code into the editor
  4. A live KaTeX preview renders on the right
  5. Click "Insert" — the formula enters the composer as \[ ... \]

Inline rendering

Any \[ ... \] you type (or paste) in the composer renders inline as a formula. For example, typing \[x^2 + y^2 = r^2\] renders the equation directly.

Settings

Open Settings → Math Input to configure:

SettingDescriptionOptions
Recognition modeLimits the recognition vocabularyauto (all), number (digits & operators), expression (math expressions)
Beam widthQuality vs speed trade-off1 (fastest), 2, 3 (best quality)
Execution providerONNX inference backendwasm (universal), webgpu (needs Chrome 113+, typically 2–5x faster)
Stroke debounceIdle time before auto-recognition0.3 – 10 seconds
Interface languageOverride UI languagezh / en, empty follows DSH language

Settings persist on the Host side and survive page reloads.

Local testing

No need to push to GitHub or publish to npm — follow these five steps to verify locally.

Step 1: Build the project

In the dsh-math-input/ directory:

cd dsh-math-input
npm install
npm run build      # generates lib/ directory

To check types without building, run npm run typecheck (tsc only, no output).

Step 2: Link the local package

This plugin has both a Host entry and a Client bundle (dsh.client in package.json). The Client is discovered through node_modules, so the package must be linked first — an overlay alone won't load the UI.

Windows (Git Bash / MINGW):

PROJECT="$(cygpath -m ~/Downloads/dsh-math-input)"   # ← your path
npx @deepseek-ai/dsh plugin --profile web add "file:$PROJECT"

macOS / Linux:

PROJECT="$(pwd)"          # ← run from the repo root
npx @deepseek-ai/dsh plugin --profile web add "file:$PROJECT"

This creates a persistent link in the profile's node_modules. After code changes, just npm run build and restart — no reinstall needed.

Step 3: Launch DSH

npx @deepseek-ai/dsh web --no-open

Open http://127.0.0.1:3080.

Host-only testing without linking: if you only need to test Host-side code (settings, typert manifest) without the Client UI, use an overlay patch instead. See Local testing guide for details.

Step 4: Verify functionality

In the DSH web UI, check each item:

  1. A "+" button appears to the left of the input row
  2. Clicking "+" opens a menu with three items: Handwriting, Screenshot, LaTeX editor
  3. Handwriting pad: modal renders, canvas accepts pointer drawing
  4. Settings: Settings → Math Input shows five controls
  5. Changing a setting persists across page reload
  6. Type \[x^2\] in the composer — a KaTeX chip renders below
  7. LaTeX editor dock: toggles from the menu, palette inserts snippets, Insert writes \[...\]

Step 5: Re-test after code changes

After modifying code:

# rebuild
npm run build

# stop DSH (Ctrl+C), restart
npx @deepseek-ai/dsh web --no-open

Notes & limitations

  • Model download: first recognition triggers a ~7.2 MB download (encoder 3.4 MB + decoder 4.0 MB + vocab 4 KB); subsequent loads use IndexedDB cache.
  • WebGPU auto-fallback: when webgpu is selected but the browser doesn't support it (requires Chrome 113+), the engine automatically falls back to wasm.
  • SharedArrayBuffer: ONNX Runtime Web uses multi-threaded WASM when Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp headers are present. Without them, it falls back to single-threaded — recognition still works but is slower.
  • Handwritten vs printed: the CoMER model is trained on the CROHME handwritten math expression dataset and optimized for handwriting. Screenshot OCR of printed formulas may underperform.
  • Browser compatibility: requires a modern browser with WebAssembly SIMD support. Chrome / Edge recommended; Firefox mostly works; Safari has limited support.
  • Zero-token guarantee: the plugin never calls ctx.llm — all recognition runs locally in the browser, with zero API costs.

Development

npm run typecheck   # tsc --noEmit (strict)
npm run lint        # ESLint 9
npm test            # node:test + tsx
npm run build       # tsdown + tsc → lib/

CI runs across Node 20 / 22 / 24: typecheck, lint, unit tests, build, and a check that committed lib/ matches a fresh build.

Documentation

License

MIT

Comments

Loading…

From the same category

awesome-dsh-plugin

by awesome-dsh-plugin

A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表

Development & Infrastructure

★ 18.3k

CC0-1.0

Python

Oct 10, 2026

Index only — not installable

by 0xsline

DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.

Development & Infrastructure

★ 1.2k

CC0-1.0

Python

Oct 10, 2026

Index only — not installable

by pax-beehive

Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub

Development & Infrastructure

★ 450

MIT

TypeScript

Oct 6, 2026

Index only — not installable

by xiajiajun516

DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.

Development & InfrastructureManifest valid

★ 176

MIT

TypeScript

Oct 8, 2026

dsh plugin --profile web add dsh-config-manager

by yjh051108

推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。

Development & InfrastructureManifest valid

★ 164

TypeScript

Sep 18, 2026

dsh plugin --profile web add @dsh-external/dsh-super-injector

by jigjoy-ai

A CLI that turns a goal into a pull request - and a sandbox for testing concurrent AI coding agents on the Mozaik runtime.

Development & Infrastructure

★ 124

MIT

TypeScript

Oct 2, 2026

Index only — not installable