Skip to content

Add TrustedRouter as a provider - #295

Open
jperla wants to merge 2 commits into
virattt:mainfrom
jperla:add-trustedrouter-provider
Open

jperla wants to merge 2 commits into
virattt:mainfrom
jperla:add-trustedrouter-provider

Conversation

@jperla

@jperla jperla commented Aug 15, 2026

Copy link
Copy Markdown

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.ts says one entry is all that's needed, but llm.ts keys its client factories separately, so this adds both: the registry entry and a ChatOpenAI factory pointed at https://api.trustedrouter.com/v1, mirroring openrouter.

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 under trustedrouter/ are routing policies rather than single models: auto, fast, cheap, plus zdr and e2e, which constrain routing to providers that retain no data or run confidential compute. fastModel is trustedrouter: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 show trustedrouter: in display names.

Verified: tsc --noEmit clean, bun test → 317 pass / 0 fail.

jperla added 2 commits August 15, 2026 17:00
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant