Introduction¶
DeepSeek Harness (DSH) supports feature extensions through a plugin mechanism, but when connecting to local large model servers, developers typically need to handle details such as model discovery, auto-loading, concurrency control, and fault tolerance themselves. Existing adapter solutions are often not robust enough when handling high-concurrency requests or scenarios where models are not loaded. dsh-localforge, as a high-performance adapter plugin, aims to solve these pain points and provide DSH with a stable and fully-featured local model integration solution.
What Is This¶
dsh-localforge is a high-performance adapter plugin maintained by orfeomorello. It connects DeepSeek Harness (dsh) with local large language model servers, primarily supporting LM Studio while also being compatible with any OpenAI or Anthropic-compatible endpoints. Its core value lies in enabling DSH to directly leverage local compute resources through the plugin mechanism, while solving the saturation problem that local models may encounter under concurrent requests.
Core Features¶
The plugin provides the following key capabilities:
* Model Discovery & Caching: Supports /v1/models and local API (/api/v0/models) probing, with TTL caching and explicit invalidation mechanisms, avoiding repeated probing when parsing models each time.
* Auto-Loading: When the requested model is not loaded on the server, automatically triggers loading requests and polls model readiness status.
* Concurrency Limiting: Serializes requests per model ID, preventing quantized models from saturating under high concurrency.
* Fault Tolerance & Fallback: Supports configuring model fallback chains, automatically switching to backup models when the primary model returns recoverable errors.
* Reasoning Budget: Limits the internal thinking length of models before generating final answers.
* Sampling Presets: Provides preset configurations such as code, chat, creative, and precise.
* Performance Monitoring: Exposes Prometheus metrics endpoints, including TTFT, TPS, queue depth, and cache hit rates.
* Protocol Compatibility: Built-in Anthropic-compatible /v1/messages adapter, supporting Claude-style system prompts and tool calls.
* Secure Logging: Structured log output with automatic masking of sensitive information (such as credentials).
* Type Safety: Developed with strict TypeScript configuration, including complete test coverage.
Installation and Activation¶
Before installation, ensure the environment meets the following requirements:
* DeepSeek Harness (dsh) has web profile enabled.
* Local LLM server (LM Studio 0.4.8+ recommended, default port 1234).
* Node.js >= 22.19 and pnpm >= 9.
Use the official plugin installation command to add this repository:
dsh plugin --profile web add github:orfeomorello/dsh-localforge#main
After installation, in the DSH web interface:
1. Open Settings → Plugins.
2. Enable the LocalForge plugin. If prompted to restart, restart dsh web.
3. In the model selector at the top, select LocalForge as the provider.
Note: The installer for this repository mounts the community plugin immediately. Since the plugin manager directly imports the compiled lib/ entry, GitHub’s installer does not compile TypeScript source code. If the UI still shows import failures, check the browser console or dsh web terminal for complete error messages.
Typical Usage¶
Add a minimal configuration example in ~/.dsh/settings.yaml:
llm-localforge:
defaultConnection:
baseURL: http://localhost:1234/v1
models:
- id: qwen/qwen3-8b
preset: code
fallback:
- qwen/qwen3-4b
- llama-3.1-8b
After configuration, select the LocalForge provider to start conversations. Traffic will flow directly to the local server without affecting DeepSeek API credits.
Use Cases and Notes¶
This plugin is suitable for developers who need to run models locally, pursue higher concurrency control capabilities, or require Prometheus monitoring. It is released under the MIT license.
Note: Since the plugin runs with the permissions of the current DSH process, it is recommended to review the source code before use to ensure it meets your security requirements.
Conclusion¶
Through LocalForge, developers can leverage local compute resources for model inference without consuming API quotas. For more details, please refer to the GitHub repository or community catalog.