Repository navigation
Conversation
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub's guide on signing commits for setup instructions. I've added |
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub’s guide on signing commits for setup instructions. I’ve added |
aheritier
left a comment
There was a problem hiding this comment.
Open and non-draft; head unchanged from the previous review. No blocking implementation findings. See inline comment.
CI: gate passed for this head; no failing or running checks. Separately, the commit is unsigned and status/needs-signed-commits remains set.
Prior threads: none; no published reviews or inline threads.
|
|
||
| Requests use OpenAI-compatible Chat Completions at | ||
| `https://api.trustedrouter.com/v1` with `TRUSTEDROUTER_API_KEY`. Model metadata | ||
| (context limits, pricing, capabilities) comes from the embedded models.dev |
There was a problem hiding this comment.
[should-fix] High confidence: the embedded catalog does not provide TrustedRouter pricing. At this head, all seven TrustedRouter entries in pkg/modelsdev/embedded/snapshot.json, including trustedrouter/auto, omit cost. Context limits and capabilities are available, but this setup cannot obtain pricing from that snapshot. Remove pricing from this claim and explain that explicit cost configuration is needed when catalog rates are unavailable.
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub's guide on signing commits for setup instructions. I've added |
|
👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added ; it'll be picked back up automatically once the conflicts are cleared. |
|
👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added status/needs-rebase; it'll be picked back up automatically once the conflicts are cleared. |
69eacdd to
183360f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The TrustedRouter live-test entry lacks an explicit opt-in gate, allowing ordinary package tests to send potentially billable inference requests whenever TRUSTEDROUTER_API_KEY is set.
1 open issue
What changed in this PR
Adds TrustedRouter as a built-in OpenAI-compatible provider using the existing catalog-driven provider infrastructure.
Changes:
- Registers the endpoint, API-key environment variable, default model, and consecutive-message merging.
- Adds credential, automatic-selection, message-merging, and request tests.
- Documents configuration and adds a runnable example.
| File | Description |
|---|---|
pkg/model/provider/openai/system_message_merge_test.go |
Tests TrustedRouter message-merge gating. |
pkg/model/provider/openai_alias_providers_test.go |
Adds TrustedRouter to shared alias-provider tests. |
pkg/model/provider/catalog/providers.json |
Registers TrustedRouter settings and credentials. |
pkg/config/trustedrouter_test.go |
Tests required credential validation. |
pkg/config/auto_test.go |
Tests automatic selection and default model. |
examples/trustedrouter.yaml |
Adds a named-model agent example. |
examples/README.md |
Lists the TrustedRouter example. |
docs/providers/trustedrouter/index.md |
Documents setup, model syntax, pricing, and gateway behavior. |
docs/providers/overview/index.md |
Lists TrustedRouter and its authentication variable. |
docs/data/nav.yml |
Adds provider navigation. |
docs/configuration/models/index.md |
Adds TrustedRouter to documented provider lists. |
agent-schema.json |
Adds TrustedRouter to the provider description. |
Review effort: Balanced
aheritier
left a comment
There was a problem hiding this comment.
Please address the blocking live-test safety feedback and mark the PR ready for review after addressing it.
Prior threads:
- 4515128707: addressed; the provider docs explain that catalog pricing is unavailable and recommend explicit
costconfiguration. - 4543681848: still open — [blocking] High confidence: the TrustedRouter entry omits
liveOptInEnvVar, so exportingTRUSTEDROUTER_API_KEYenables real, potentially billable inference during ordinary package tests. AddliveOptInEnvVar: "DOCKER_AGENT_RUN_TRUSTEDROUTER_LIVE_TEST"; this also includes TrustedRouter in the explicit-opt-in regression test.
Register trustedrouter in the embedded provider catalog at https://api.trustedrouter.com/v1, discover TRUSTEDROUTER_API_KEY, and default to trustedrouter/auto. TrustedRouter is already in the embedded models.dev snapshot, so no catalog exemptions are needed. Signed-off-by: Joseph Perla <claude@jperla.com>
183360f to
1d587dd
Compare
aheritier
left a comment
There was a problem hiding this comment.
Thanks for adding TrustedRouter and covering the alias with request and credential tests. Please fix the upstream model ID example before merging.
Reviewed head: 1d587dd552fc1b0309e9a9d0194e7b1b995fe52f. Exact-head CI: the required ci / gate passed. Of 23 check runs, 19 passed and 4 were skipped; none failed or were still running.
Prior threads: #4515128707 is addressed: the docs now say the embedded catalog has no TrustedRouter pricing and explain how to set cost. #4543681848 is addressed: the live test requires DOCKER_AGENT_RUN_TRUSTEDROUTER_LIVE_TEST=1 in addition to credentials, and the shared regression test covers that guard.
Open questions: The catalog enables consecutive-message merging for TrustedRouter, but there’s no scoped live comparison showing how the endpoint handles preserved versus merged message boundaries. The mock tests verify the outgoing payload; the opt-in live smoke test sends only one user message. Please record the scoped probe result described in the contributor guide.
| ``` | ||
|
|
||
| Upstream models keep their prefixed IDs, for example | ||
| `trustedrouter/anthropic/claude-sonnet-4.5`. |
There was a problem hiding this comment.
[blocking] The linked /v1/models list advertises anthropic/claude-sonnet-4.5, not trustedrouter/anthropic/claude-sonnet-4.5, as the upstream model ID. The latter is the Docker Agent inline reference: pkg/config/latest/model_ref.go:17 strips only the first trustedrouter/, and pkg/model/provider/openai/client.go:391 sends the remainder verbatim. If a reader copies the documented ID into a named model or adds the provider prefix again for inline use, the request sends an unlisted ID. Please show both forms explicitly: inline trustedrouter/anthropic/claude-sonnet-4.5, or named provider: trustedrouter with model: anthropic/claude-sonnet-4.5. The trustedrouter/trustedrouter/auto example is correct because that route's raw ID is trustedrouter/auto.
There was a problem hiding this comment.
Fixed in 98038cb: the Inline section now says the model list ID is anthropic/claude-sonnet-4.5 and the inline reference is trustedrouter/anthropic/claude-sonnet-4.5; the Named Model section says model takes the model list ID as is (provider: trustedrouter, model: anthropic/claude-sonnet-4.5).
|
Please mark this PR ready for review once you’ve addressed the feedback. |
The model list ID (anthropic/claude-sonnet-4.5) is what a named model uses; the inline reference adds the provider prefix (trustedrouter/anthropic/claude-sonnet-4.5). Signed-off-by: Joseph Perla <claude@jperla.com>
aheritier
left a comment
There was a problem hiding this comment.
Thanks for clarifying the TrustedRouter examples. I checked the public model list and the request path: the inline reference trustedrouter/anthropic/claude-sonnet-4.5 and the named model ID anthropic/claude-sonnet-4.5 both send the same upstream ID. The default route correctly sends trustedrouter/auto. I found no remaining blocking code or documentation defect.
Prior threads: #4515128707 is addressed: the docs explain that the embedded catalog has no TrustedRouter pricing and how to set cost. #4543681848 is addressed: the live test requires DOCKER_AGENT_RUN_TRUSTEDROUTER_LIVE_TEST=1 as well as a key, and the regression test covers that guard. #4657286499 is addressed by the corrected inline and named model examples.
Open questions: The catalog enables merging consecutive system and user messages, but there’s no recorded comparison against the TrustedRouter endpoint. The mock test verifies that Docker Agent merges two system messages before sending them; the live smoke test sends only one user message, so it can’t validate the merge policy. Please record the scoped preserve-versus-merge results for trustedrouter/trustedrouter/auto using the contributor guide’s compatibility probe.
|
Please mark this PR ready for review once you’ve addressed the feedback. |
|
👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added |
|
👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added |
|
Hi! I'm Phil, I'm on the founding team at TrustedRouter. Thanks for the careful reviews here, @aheritier! I've reopened this as #5130 from my account: one signed, DCO-signed-off commit on current main, with Joe as co-author. It also records the message-merging probe you asked for. All four scenarios were accepted, both preserved and merged, on trustedrouter/auto and a pinned model. |

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). Not live-tested against the API.Disclosure: I work on TrustedRouter.