Skip to content

feat: add OpenRouter model provider - #395

Open
vivekascoder wants to merge 2 commits into
truefoundry:mainfrom
vivekascoder:feat/openrouter-provider-sdk
Open

feat: add OpenRouter model provider#395
vivekascoder wants to merge 2 commits into
truefoundry:mainfrom
vivekascoder:feat/openrouter-provider-sdk

Conversation

@vivekascoder

@vivekascoder vivekascoder commented Aug 21, 2026

Copy link
Copy Markdown

Summary

Adds openrouter support in connectors.

  • adds search functionality for openrouter mdoels.

Closes #342

Preview of the changes it does:

Screen.Recording.2026-08-21.at.3.50.12.PM.mov

Changes

  • Add OpenRouter provider using its SDK for model discovery.
  • Add caching, model search, metadata, and tests.

How was this tested?

  • Passed pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, pnpm format:check, pnpm test:store:local, pnpm smoke and pnpm pack:dry.

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PR omits SDK regen
  • Docs / .env.example updated if configuration or behavior changed — not needed

Note

Medium Risk
Introduces a new LLM provider path and an outbound OpenRouter catalog fetch on catalog list, plus request attribution headers. Failures fall back to shipped presets, but catalog listing now depends on a remote API.

Overview
Adds OpenRouter as a well-known model provider (OpenAI-compatible adapter, default https://openrouter.ai/api/v1) so it can be configured like other built-in connectors.

The catalog ships a small OpenRouter preset list, then GET model-provider catalog syncs the live OpenRouter model list (5-minute TTL) via @openrouter/sdk. Empty/failed fetches keep the shipped presets. Runtime requests attach TrueForge app-attribution headers (HTTP-Referer, X-OpenRouter-Title).

Settings and the draft model picker now use fuzzysort so large catalogs (especially OpenRouter) can be searched by name/id/provider, including a per-provider “available to add” search.

Reviewed by Cursor Bugbot for commit 6d1952a. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6d1952a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@truefoundry/trueforge-core Minor
@truefoundry/trueforge Minor
@truefoundry/trueforge-ui Minor
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chiragjn chiragjn self-assigned this Aug 21, 2026
@chiragjn chiragjn added the core label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Openrouter support as first class provider.

2 participants