Repository navigation
Replies: 1 comment
|
Concrete data point for the "self-hosted gateway" category: What it would need from DSH to be first-class (instead of "works-as-config"):
What the router does today with the current contract:
The full architecture write-up is in the new DSH |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal: make self-hosted gateways first-class providers in deepseek-harness (split
packages/llm)Addressed to the deepseek-harness maintainers. Written from the perspective of
model_proxy_v3 β an open-source,
self-hosted multi-protocol LLM proxy β after a verified end-to-end integration
with dsh.
TL;DR
The
packages/llmlayer wraps
@earendil-works/pi-aito reach LLM providers, the same roleopenclawfilled. It works, but the provider picker is dominated by a longcatalog of third-party SaaS providers, and model choices are limited to what
those external catalogs ship. We propose splitting the provider layer so that
self-hosted gateways (model_proxy_v3, LiteLLM, one-api, OpenRouter-style
routers) can plug in as first-class providers β one picker entry, live model
sync from the gateway's own listing, and no dependence on an external project's
catalog.
I've drive
claude codesimply to validate the integration path with zero dsh code changes:How to set a 3rd party proxy for deepseek-harness.
If
deepseek-harnesssupports one of the popular llm schemas (such asopenai-completions,anthropic-messages,openai-responses,gemini-generatecontent), it works.The current pain
llm-pi-ai.providersworks today, but in the configuration surface it sitsalongside ~20 catalog providers. Users hunting for their gateway scroll past
providers they will never use.
installed pi-ai provider inherits that provider's model list; a hand-declared
route must be hand-maintained model-by-model in
settings.yaml.discoverModelsinterrogatesGET {baseURL}/modelsonly foropenai-completions/openai-responsesroutes. Gateways that speak Anthropic's protocol (and serve Anthropic-shaped
/v1/modelslistings β model_proxy_v3 does) cannot be interrogated at all,even though their listings carry exactly the fields the parser reads
(
data[].id,display_name).contextWindow/maxTokensunless the user types them; the defaults(262k / 32k) silently mis-size real models.
What self-hosted gateways bring to dsh users
It even works for all other agents
β model_proxy_v3 gives any OpenAI/Anthropic/Gemini-speaking client the routing
features commercial platforms (e.g. OpenRouter) sell, entirely server-side and
transparent to the client:
share weights and fallbacks (e.g.
code-small= glm + claude pool).conversation stage.
plus key management: the gateway holds upstream credentials; clients use a
dummy key.
None of this requires anything from dsh today β the proxy absorbs provider
heterogeneity, protocol conversion, and credential storage, and dsh just talks
to one endpoint. That is precisely the argument for treating gateways as a
tier, not as "one more provider among twenty".
Plugin system over bundled provider modules
It is already easy to drive existing LLM agents β Claude Code, Codex, opencode β
to a custom LLM provider: they accept a base URL and a key, and are running
against a gateway in minutes (see
docs/agents/for workedexamples against this proxy). New agents such as deepseek-harness should not
have to re-solve this problem by bundling ever-larger modules that chase
evolving third-party LLM providers.
As a plugin system, dsh needs only a small, stable LLM contract:
renamed models, protocol extensions, and auth schemes appear weekly. When
each is a plugin, the churn is absorbed by whoever owns the integration β
not by the harness core, and not by one shared dependency (the pi-ai catalog)
that every route inherits.
self-hosted gateway and every upstream it fronts β including future ones β
is reachable through a single registration with live model sync. The harness
ships none of the provider-specific code.
with the market; surface complexity scales with what the user actually
configured, not with the number of providers that exist.
This is the same bet dsh already made architecturally (everything is a Cordis
plugin); the proposal is to finish it at the
packages/llmseam.The proposal
Split
packages/llmalong the seam that already exists:@deepseek-ai/dsh-llmas the contract. Adapter registration,discovery types (
LlmDiscoveredModel), credential seams β this is already aclean interface.
llm-pi-aione implementation of that contract, not the only one.External projects should be able to ship a provider plugin that registers
routes, answers model discovery, and reports capabilities without going
through pi-ai's catalog.
picker entry with N models β chosen from a live listing, not a global
catalog. Collapsing gateway routes under their gateway shrinks the provider
picker and matches how users think ("my proxy", then "which model").
listings (
data[].id+display_name+first_id/has_more) foranthropic-messagesroutes, and read common capacity extensions(
context_window/context_length,max_output_tokens) when present.model_proxy_v3's
/v1/modelsalready returns a compatible shape, verifiedagainst
discoverModelsas-is.candidates for manual adoption. A gateway route could optionally reconcile
its model list on demand (still user-confirmed), since the gateway β not an
external catalog β is the authority for what it serves.
Evidence the integration already works
Against
model_proxy_v3running as a plain local process, on stock dsh:api: openai-completions,baseURL: http://<proxy>/v1, dummy key β headless dsh runs end-to-end.discoverModelsagainst the proxyreturned all 23 configured models β concrete entries, composite/fusion/
coordinator aliases, and schedule aliases β with no dsh modifications.
api: anthropic-messagesalso works for chat; onlydiscovery is blocked (point 3 above).
Full config examples (both protocols) and caveats are in
docs/agents/proxy-as-provider-for-deepseek-harness.md.
What we offer
gateway descriptor) once the contract is split out.
discovery.tsβthe parser already reads the right fields; the change is small and localized.
way
docs/agents/covers other agent harnesses (opencode, copilot-cli,crewai, langgraph).
Summary
dsh's plugin architecture made this integration possible without touching dsh
source β that is a strength worth building on. Splitting the provider layer so
gateways are a first-class tier turns "a hand-declared route that happens to
work" into a supported path, gives users OpenRouter-class routing from
self-hosted software, and keeps the provider picker short and honest about
where models actually come from.
IF YOU WANT BE OPEN, OPEN YOUR DOORS.DO NOT JUST FOLLOW WHAT OPENCLAW DID, GO AHEAD, EVOLVE.4 votes ·
All reactions