Repository navigation
feat: add TrustedRouter as a built-in OpenAI-compatible provider - #5130
Open
philchacko wants to merge 1 commit into
Open
philchacko wants to merge 1 commit into
philchacko wants to merge 1 commit into
Conversation
Add TrustedRouter to the provider catalog (https://api.trustedrouter.com/v1, TRUSTEDROUTER_API_KEY, default model trustedrouter/auto), with docs, an example and tests, following the CloudGPU and OrcaRouter pattern. Supersedes docker#4824. Co-authored-by: Joseph Perla <jperla@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T5JC3xkrEs7BaWPaRCamWX Signed-off-by: Phil Chacko <phil@nytex.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the TrustedRouter provider addition.
No open issues 🎉
What changed in this PR
Adds TrustedRouter as a built-in OpenAI-compatible provider using Docker Agent’s existing provider catalog and alias infrastructure.
Changes:
- Registers the endpoint, API-key variable, default model, and message-merging behavior.
- Adds credential, automatic-selection, and request tests.
- Documents configuration and provides a runnable example.
| File | Description |
|---|---|
pkg/model/provider/openai/system_message_merge_test.go |
Tests TrustedRouter message-merging selection. |
pkg/model/provider/openai_alias_providers_test.go |
Adds request and opt-in live test cases. |
pkg/model/provider/catalog/providers.json |
Registers TrustedRouter provider defaults. |
pkg/config/trustedrouter_test.go |
Tests required credentials. |
pkg/config/auto_test.go |
Tests automatic selection and default model. |
examples/trustedrouter.yaml |
Adds a named-model example. |
examples/README.md |
Lists the new example. |
docs/providers/trustedrouter/index.md |
Documents setup, usage, pricing, and gateway behavior. |
docs/providers/overview/index.md |
Lists TrustedRouter authentication. |
docs/data/nav.yml |
Adds provider navigation. |
docs/configuration/models/index.md |
Updates documented provider lists. |
agent-schema.json |
Adds TrustedRouter to the provider description. |
Review effort: Balanced
This branch has not been deployed
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.
Requested by Phil · project thread
Summary
Adds TrustedRouter as a built-in OpenAI-compatible catalog provider, following the CloudGPU / OrcaRouter pattern:
trustedrouterentry inpkg/model/provider/catalog/providers.json:https://api.trustedrouter.com/v1,TRUSTEDROUTER_API_KEY, default modeltrustedrouter/auto, consecutive-message merging like the other gateways.trustedrouter/auto,/cheap,/fast, …), so it needs nomodelsDevAbsentProviders/ catalog exemptions and gets pricing/context metadata from the catalog.examples/trustedrouter.yaml.Usage
The first
trustedrouter/selects the provider; TrustedRouter model IDs are always vendor-prefixed (e.g.trustedrouter/anthropic/claude-sonnet-4.5).Verification
go test -count=1 ./pkg/config/ ./pkg/model/provider/ ./pkg/model/provider/openai/ ./pkg/model/provider/catalog/ ./cmd/root/— pass (TestProviderIDsMatchEmbeddedCatalog/trustedrouter,TestOpenAIAliasProvider_EndToEndRequest/trustedrouterincluded; the live subtest skips without opt-in).go test ./pkg/model/provider/... ./pkg/modelsdev/...— pass.go veton touched packages — clean. markdownlint on the new page — 0 issues.task lint/ golangci-lint not run locally (not installed).DOCKER_AGENT_RUN_TRUSTEDROUTER_LIVE_TEST=1 go test -run TestOpenAIAliasProvider_LiveAPI/trustedrouter ./pkg/model/providerpasses (replypong).Message-merging probe
Recorded per the message-merging guide, as asked on #4824. Every case was accepted with markers intact (HTTP 200,
markers_ok=true), so TrustedRouter accepts both preserved boundaries and the existing merge:Two acceptances don't prove semantic equivalence, so the catalog keeps
merge_consecutive_messages: truelike the other gateways; there is no evidence the merge is required.Disclosure: I'm on the founding team at TrustedRouter.
This supersedes #4824, reopened from my account as one signed, DCO-signed-off commit on current
mainso I can keep it moving. Joe Perla is credited as co-author.🤖 Generated with Claude Code
https://claude.ai/code/session_01T5JC3xkrEs7BaWPaRCamWX