Preface¶
Selecting a model in DeepSeek Harness (DSH) usually requires manually maintaining providers, routes, and model lists in configuration. When models actually run on a unified gateway like Tailscale Aperture, the gateway adds and removes models as deployments change, and each model supports different HTTP endpoints. Manually keeping everything aligned is both slow and error-prone.
The community plugin dsh-aperture (maintainer he0119, npm package name dsh-aperture, current version 0.4.1, MIT license) targets this kind of deployment: it fetches the model list from Aperture, registers it as provider routes inside DSH based on the endpoints each model actually answers, and makes the models appear directly in the selector. After installing the plugin, most scenarios require only filling in a single Aperture instance address.
What Is This¶
dsh-aperture belongs to the “Model Inference” category of plugins in the DSH community directory. Directory page: https://www.skillhub.cn/plugins/he0119/dsh-aperture, source code: https://github.com/he0119/dsh-aperture.
It does not perform inference itself — only discovery and registration: it requests GET {baseUrl}/v1/models, and based on the supported_endpoints returned by each model, it attaches models that can use OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages to three routes. Models that only provide Gemini-native endpoints like generateContent will not appear in the selector; the plugin configuration page explains the reason.
For authentication, Aperture relies on Tailscale network identity. The plugin attaches a placeholder credential by default on requests (such as authorization: Bearer dsh-aperture) so that pi-ai can issue requests; this is not a real API key. When a real key is needed, you can configure apiKeyEnv to point to the credentials seam.
Core Features¶
The following is a summary of capabilities verifiable from the README and implementation notes.
- Auto-discovery: Reads the gateway model list from the configured
baseUrl, and routes models to three protocol routes based onsupported_endpoints. - Three provider routes: The default prefix is
aperture, with route keysaperture-openai-chat-completions,aperture-openai-responses, andaperture-anthropic-messages; they appear in the selector as names such asAperture (OpenAI Chat Completions)(the prefix can be adjusted viaroutePrefix). - Metadata enrichment: By default it supplements capacity, input types, etc. from
https://models.dev/models.json;modelAliasescan map gateway IDs to models.dev IDs, andmodelscan override or supplement models item-by-item for those not listed on the gateway. - Web configuration: In Plugins → dsh-aperture, edit the instance address, registration toggle, and “Refresh now”; in Settings → Models, edit per-model overrides row-by-row per route. Headless profiles have no plugin page, but discovery and registration still work — just modify the configuration file.
- Probe-only mode: When
sync: falseor the registration toggle is off, it only probes without registering; when registration is turned off, it unregisters the three routes previously registered by this plugin.
The plugin runs with the permissions of the current DSH process; before installing, review the source code and license yourself, and only install from trusted sources.
Installation and Enablement¶
Prerequisites: Node ^22.19.0 or ≥24.0.0 (consistent with official DSH), and an accessible Aperture instance.
1. Install the Plugin¶
Using the npm published artifact is recommended (it includes the compiled lib/, no need to authorize build scripts):
npx @deepseek-ai/dsh plugin --profile web add dsh-aperture
You can also lock to a commit from git, or add a local path; git installation under pnpm ≥10 may be rejected on first install due to build scripts — you will need to configure allowBuilds for dsh-aperture in the profile’s pnpm-workspace.yaml as described in the README and then retry.
2. Configure the Aperture Address¶
Fill in baseUrl for the plugin namespace aperture in the profile patch document:
# ~/.dsh/profiles/web/cordis.patch.yml
- id: aperture
config:
baseUrl: https://ai.example.ts.net
Any trailing /v1 will be stripped; an empty baseUrl means dormant (no probing, no registration). You can also fill in the same field as “Instance address” on the Web Plugins page; saving writes to the same file. The patch layer replaces entire lines, and keys not written fall back to schema defaults.
3. Restart DSH¶
Bundle changes are not hot-reloaded. Before restarting, you can use the following command to confirm that a # == dsh-aperture layer appears in the merged configuration:
npx @deepseek-ai/dsh --profile web --dump-config
4. Verify¶
Entries for each model should appear in the model selector under the route name Aperture. If you installed from git and encountered peer dependencies warnings, the README explains this is expected: Cordis-related dependencies are resolved by DSH itself.
Typical Usage¶
Minimal Configuration¶
Just fill in the gateway address to start syncing (sync defaults to true):
- id: aperture
config:
baseUrl: https://ai.example.ts.net
Aliases and Manual Model Additions¶
When gateway IDs do not match models.dev, use modelAliases; for models not listed on the gateway but confirmed usable at an OpenAI-compatible endpoint, you can add them explicitly in models:
- id: aperture
config:
baseUrl: https://ai.example.ts.net
models:
- id: gemini-2.5-pro
api: openai-completions
- id: deepseek-v4-pro
reasoningEfforts: { off: disabled, minimal: minimal, low: low, medium: medium, high: high, max: max }
modelAliases:
deepseek-flash: deepseek/deepseek-v4-flash
k3: moonshotai/kimi-k3
Key Points for UI Operations¶
- Refresh now: Does not write settings; re-runs discovery and registration directly, and displays results on the plugin page.
- Models page: Save overrides row-by-row per route; capacity can be written as
1M,100K(decimal,1M= 1000000); leaving blank means no override, falling back to discovery values and the catalog. - Registration toggle off: Probes only, and unregisters the three routes registered by this plugin, without affecting routes of the same name registered by other adapters.
For more detailed UI and routing behavior, see docs/internals.md in the repository.
Use Cases and Caveats¶
Who it’s for: Developers who have already deployed Aperture on Tailscale, want to select gateway models uniformly in DSH Web or agents, and don’t want to hand-write llm-pi-ai.providers.
Protocol boundaries: Only integrates the three OpenAI/Anthropic-compatible routes mentioned above; models with pure Gemini-native endpoints require switching endpoints or finding another adaptation method. A 404 response from Aperture usually includes a hint stating which endpoint type should be used.
Upgrades and conflicts: When upgrading from version 0.2 and earlier, the old plugin may have written routes under llm-pi-ai.providers with different key names than the current version; you need to clean up stale entries yourself to avoid duplicate models in the selector. If prompted that a route key is already occupied by another adapter, follow the page hints to delete or modify the corresponding configuration, or adjust this plugin’s routePrefix.
Configuration priority: Besides the profile patch, there may be a higher-priority cordis.patch.yml; if your saved configuration doesn’t take effect, check whether it was overridden by a higher layer.
Security: The plugin will access the baseUrl you configured and register routes into DSH; installing from git and authorizing allowBuilds is equivalent to permitting that package to run install scripts outside the agent sandbox, and should only be authorized for trusted source code.
Conclusion¶
dsh-aperture hands off “what models are on the gateway and which API each one uses” to auto-discovery, reducing the workload on the DSH side to a single baseUrl plus optional per-model overrides. If you are using Aperture to aggregate models on your intranet or Tailnet, you can check the entry description in the community directory and read the full README and FAQ on GitHub.
- Directory page: https://www.skillhub.cn/plugins/he0119/dsh-aperture
- Repository: https://github.com/he0119/dsh-aperture