Conversation
TrustedRouter is OpenAI-compatible, so it needs the registry entry plus a ChatOpenAI factory with its base URL, mirroring openrouter. Its catalog is large and namespaced, so model selection reuses the free-text input path rather than a fixed list. The hint on that screen was hardcoded to openrouter.ai, so it is now provider-aware.
The lockfile was touched by a local bun install; it is not part of this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds TrustedRouter as a provider. It's an OpenAI-compatible router — one key reaches models from OpenAI, Anthropic, Google, DeepSeek and others, with per-request routing and failover.
providers.tssays one entry is all that's needed, butllm.tskeys its client factories separately, so this adds both: the registry entry and aChatOpenAIfactory pointed athttps://api.trustedrouter.com/v1, mirroringopenrouter.Model ids are namespaced (
anthropic/claude-opus-4-7) and the catalog is ~560 models, so model selection reuses the free-text input path rather than a fixed list — same treatment as OpenRouter. The ids undertrustedrouter/are routing policies rather than single models:auto,fast,cheap, pluszdrande2e, which constrain routing to providers that retain no data or run confidential compute.fastModelistrustedrouter:trustedrouter/fast.One knock-on fix: the model-input screen's hint was hardcoded to
openrouter.ai/models. Routing TrustedRouter through the same screen would have pointed those users at the wrong catalog, so the hint and examples are now provider-aware.Also added the normalization prefix in
getModelDisplayName, which strips provider prefixes and would otherwise showtrustedrouter:in display names.Verified:
tsc --noEmitclean,bun test→ 317 pass / 0 fail.