dsh-llm-lmstudio
其他 活跃维护

dsh-llm-lmstudio

Viktirr/dsh-llm-lmstudio

可适配LM Studio的OpenAI兼容本地服务,无需改代码即可快速对接本地大模型,兼容标准OpenAI接口规范,部署简便、调用稳定,轻松集成本地大模型推理能力。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
None
开源协议
33 KB
仓库大小
28 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Viktirr/dsh-llm-lmstudio
git clone https://github.com/Viktirr/dsh-llm-lmstudio.git
git clone git@github.com:Viktirr/dsh-llm-lmstudio.git
README.md master

This plugin is AI generated.

dsh-llm-lmstudio

A standalone LM Studio plugin for DeepSeek Harness. It registers the
lm-studio provider route against a local LM Studio server
(OpenAI-compatible endpoint, default http://localhost:1234/v1), fetches the
server's loaded-model catalog live, and exposes a llm-lmstudio settings
section that the web Models page writes.

Extracted from the in-tree packages/llm/llm-lmstudio adapter (branch
feat/llm-lmstudio). The harness's own files stay identical to upstream —
the adapter lives in this plugins/ folder, untouched by the harness build.
Verified against harness master 0.1.2-alpha.1.

This fork ships the plugin under plugins/dsh-llm-lmstudio/, so a fresh
clone already has it. Enable it once per profile:

pnpm dsh plugin --profile web add link:./plugins/dsh-llm-lmstudio

The same plugin also lives alone on the branch feat/llm-lmstudio-plugin
(upstream master plus only this folder), ready to PR or move into its own
repository — if it gets one, add the dsh-plugin GitHub topic for
discoverability.

Requirements

  • The harness checkout one level up (../..), with pnpm install and
    pnpm run build completed there (the harness's tsx source launcher runs
    this plugin's TypeScript directly — no build step here).
  • LM Studio running locally (or set baseURL to wherever it listens).

Install

From the harness root, link the plugin into a profile. For the web UI, the
profile is literally named web:

pnpm dsh plugin --profile web add link:./plugins/dsh-llm-lmstudio

Omit --profile web only if you boot a different named profile. This
installs the plugin's dependency links (they point back into the harness
checkout so the plugin shares the harness's exact runtime copies — never a
second copy of @deepseek-ai/dsh-*) and appends this bundle to the profile's
bundle list. cordis.patch.yml here supplies the llm-lmstudio row; the
loader resolves the row against the profile like any installed plugin.

Alternative without installing: run the web UI with an overlay that points
the row at this checkout directly. On Windows the row value must be a
file:// URL, e.g. a patch file containing

- insert:
    - id: llm-lmstudio
      name: 'file:///C:/<path>/DS-Harness/plugins/dsh-llm-lmstudio/src/index.ts'

passed as pnpm dsh web --patch <that-file>.

Configure

Open the web UI's Models page and fill in the llm-lmstudio section:

  • baseURL — endpoint base; defaults to http://localhost:1234/v1.
  • apiKeyEnv — name of an environment variable holding an API key, if your
    server requires one; leave empty for a keyless local server (the adapter
    sends the dummy bearer LM Studio accepts).
  • models — optional per-id overrides for context window, max tokens,
    labels, and vision capability; the live server listing fills the rest.
  • retryPolicy, streamIdleTimeoutMs, discoveryTimeoutMs — as documented
    in src/index.ts.

The lm-studio provider then appears in the model picker alongside the
in-box providers.

Develop

From this directory (Node ≥22.19):

pnpm install --ignore-workspace   # once: link deps + eventsource-parser
npm run typecheck                 # tsc -b against the harness projects
npm run test                      # vitest suites with a mock LM Studio server

Both scripts borrow tsc/vitest from the harness checkout's
node_modules. The tsconfig.json project references resolve every
@deepseek-ai/* import through the harness's own compiled declarations, so
types always match the code the harness actually runs.