Skip to content
dsh.fish
Bundle

dsh-llm-lmstudio

LM Studio (OpenAI-compatible local server) chat-completions adapter plugin for DeepSeek Harness

Source
Viktirr
Updated
Updated 3 days ago

Readme

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:

```sh
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), and has its own repository at
https://github.com/Viktirr/dsh-llm-lmstudio — discoverable via the
`dsh-plugin` GitHub topic.

## 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`:

```sh
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

```yaml
- 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):

```sh
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.

Install

dsh plugin --profile web add github:Viktirr/dsh-llm-lmstudio

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source