Repository navigation
[llm-pi-ai] renamed custom provider routes silently lose installed-catalog metadata (contextWindow/maxTokens) — catalog matched by provider name only #4409
edisonzerolam
started this conversation in
General
Replies: 0 comments
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.
Title:
[llm-pi-ai] renamed custom provider routes silently lose installed-catalog metadata (contextWindow/maxTokens) — catalog matched by provider name onlyLabels: bug, enhancement
Summary
resolveRouteModels()resolves installed-catalog defaults viacatalogModels(provider)— strictly by route name. A user route aimed at a cataloged gateway under a different name (e.g."opg"withbaseURL: https://opencode.ai/zen/go/v1/, byte-identical to the bundledopencode-gocatalog provider) resolvesdefaults = ∅. Every configured model then falls back todefaultContextWindow(262144) anddefaultMaxTokens, even though the correct metadata ships inside the same installation.Production consequence
A free-tier model on that gateway accepted ≥580k-input requests while the harness believed its window was 262,144 — producing premature client-side
CONTEXT_WINDOW_EXCEEDEDmappings and mis-scaled compaction thresholds. We had to hand-declarecontextWindow/maxTokensfor ~30 models in settings.yaml from pi-ai's own bundled catalogs — data the adapter already had on disk.Suggested direction
When the route name has no catalog entry, fall back to matching catalog providers by
baseUrl(+ api), so renamed routes keep full catalog fidelity; optionally log a warning when neither name nor baseURL matches a catalog and a model lacks an explicitcontextWindow.Happy to work up a patch if the direction sounds right.
Environment
DSH desktop install;
@deepseek-ai/*0.1.1-rc.2 (patches applied to the compiledlib/index.js); Windows. Both patches verified red/green with independent harnesses that mirror the seam/compaction semantics against the real packaged rg binary.All reactions