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

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.