nnbw-liu/deepseek-ai-dsh-llm-local ↗★ 1
@deepseek-ai/dsh-llm-local
OpenAI-compatible local model adapter (Ollama, llama.cpp, Foundry Local, LM Studio, vLLM, gateways) for the DeepSeek Harness LLM seam
AI Analysis
核心用途是接入本地运行的大语言模型。适合希望在本地运行模型以保护隐私或离线工作的用户。必要条件是需在 settings.yaml 中配置本地模型的 provider 配置文件。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗Configuration
The plugin registers the llm-local settings namespace. The providers dict keys ARE the provider routes: ollama, llamacpp, and foundry-local are shipped presets (endpoint and display name inherited), any other key is a hand-declared endpoint and must name a baseURL.
Minimal working example (Ollama)
llm-local:
providers:
ollama:
models:
- id: qwen3:8b
contextWindow: 32768
That is everything: the preset endpoint http://127.0.0.1:11434/v1 is inherited, no API key is needed, and the route registers the moment the file is saved. Request with provider: ollama, model: qwen3:8b.
Full example with every field
llm-local:
providers:
# Shipped preset: endpoint defaults to http://127.0.0.1:11434/v1.
ollama:
models: # optional; discovery can fill these
- id: qwen3:8b
contextWindow: 32768
# defaultContextWindow: 128000 # fallback capacity for unlisted models
# maxTokens: 32768 # default per-request output cap
# usageInStream: true # stream_options.include_usage
# vision: false # image input for vision models
# streamIdleTimeoutMs: 300000 # per-read idle budget
# Shipped preset for the llama.cpp server.
llamacpp:
baseURL: http://127.0.0.1:8080/v1
models:
- id: qwen2.5-coder-14b-instruct-q4_K_M
contextWindow: 32768
# Shipped preset for Microsoft Foundry Local.
foundry-local:
baseURL: http://127.0.0.1:53415/v1 # confirm the port in `foundry local` output
models: []
# Hand-declared route: any OpenAI-compatible endpoint.
my-gateway:
displayName: My Gateway
baseURL: http://127.0.0.1:1234/v1
apiKeyEnv: MY_GATEWAY_KEY # optional; local servers usually need none
vision: true # optional; image input for vision models
usageInStream: true # optional; stream_options.include_usage
maxTokens: 32768 # optional default per-request output cap
defaultContextWindow: 128000 # optional fallback context capacity
streamIdleTimeoutMs: 300000 # optional per-read idle budget
retryPolicy: # optional; normal defaults when omitted
mode: normal
maxRetries: 2
models:
- id: gpt-oss-120b
contextWindow: 131072
maxTokens: 32768
Per-provider fields:
baseURL— the OpenAI-compatible root (/chat/completionsand/modelsare appended). Presets default tohttp://127.0.0.1:11434/v1(Ollama),http://127.0.0.1:8080/v1(llama.cpp),http://127.0.0.1:53415/v1(Foundry Local — confirm the exact port infoundry localoutput). Required for hand-declared routes.apiKeyEnv— credential reference resolved per request throughctx.credentials, then the environment. Omitted means unauthenticated — the local default; Ollama, llama.cpp, and Foundry Local need no key. Once named, a miss fails loud withMISSING_CREDENTIAL.models— advisory catalog exposed to selectors and discovery; requests accept unlisted ids too. Each entry:id, optionalname/description/contextWindow/maxTokens/vision.models: []advertises none.vision(profile or per-model) — declares image input. Image blocks serialize asimage_urldata-URL parts through the durable attachment service; a text-only model rejects them withUNSUPPORTED_CONTENT.usageInStream— defaulttrue(stream_options.include_usage). Disable for an older llama.cpp build that rejects the field.maxTokens,defaultContextWindow,streamIdleTimeoutMs,retryPolicy— same semantics as the DeepSeek adapter.
Dynamic configuration (settings + credentials)
Connection facts are not frozen at load. resolveAdapterOptions is the one explicit resolve step, and the adapter re-reads facts through a thunk once per operation: base URL, catalog, usage reporting, vision, output cap, and idle budget all take effect on the next request, while an in-flight stream keeps the facts it started with.
ctx.settings— the plugin registers thellm-localnamespace with this sameConfigschema and its composition entry as thebase, so allm-local:section in the user settings document overrides any field without a restart.ctx.credentials— the key resolves per stream call from the same snapshot that supplies the endpoint. Configuration carries onlyapiKeyEnv, never a literal key; a route without one is asked unauthenticated.
The one registration-captured fact is the retry policy: when a route's resolved value changes, the plugin re-registers the route set in place (same adapter instance, one synchronous section). Route-set changes (adding/removing a route) re-register the same way. Every route change logs a line (llm-local: serving ollama (http://127.0.0.1:11434/v1), ...), and a dormant mount logs llm-local: dormant; ... — the first thing to check when a section appears to do nothing.