Repository navigation
Conversation
Add TrustedRouter as a built-in OpenAI-compatible provider. Models are fetched from https://api.trustedrouter.com/v1/models and authentication uses TRUSTEDROUTER_API_KEY.
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.
Summary
Add TrustedRouter as a built-in provider. TrustedRouter is an OpenAI-compatible gateway, so this uses the existing
OpenAIresponse type with no new transport code, declared the same way asopen_router,requestyandorca_router.crates/forge_repo/src/provider/provider.jsontrusted_routerentry, response typeOpenAIhttps://api.trustedrouter.com/v1/chat/completionshttps://api.trustedrouter.com/v1/models(public, OpenRouter-shaped, fetched live)TRUSTEDROUTER_API_KEY)crates/forge_domain/src/provider.rsProviderId::TRUSTED_ROUTER, registered inbuilt_in_providers()"TrustedRouter"display name and"trusted_router"FromStrarmtest_trusted_router_from_str,test_trusted_router_display_name,test_trusted_router_in_built_in_providers; extended the aggregate display-name and built-in testscrates/forge_repo/src/provider/provider_repo.rstest_trusted_router_configcovering id, env var, response type, chat URL and models URLUsage
forge provider login trusted_routerand enter the key (or setTRUSTEDROUTER_API_KEY)/model; ids are vendor-prefixed (e.g.anthropic/claude-sonnet-4.5), andtrustedrouter/autoroutes automaticallyVerification
forge_reponeedsprotocto build, which I don't have locally, sotest_trusted_router_configwill be exercised by CI; it mirrorstest_orca_router_configwith only the literals changed.provider.jsonparses and has no duplicate ids.Disclosure: I work on TrustedRouter.