RedPlanetHQ/core

Add OpenRouter support as LLM provider

オープン

#130 opened on 2025/10/28

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (184 件のフォーク)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1,930 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Description

Add support for OpenRouter as an LLM provider to enable access to multiple models through a single API.

Files to Look At

Provider Implementation

  • apps/webapp/app/lib/batch/providers/anthropic.ts - Reference for provider structure
  • apps/webapp/app/lib/batch/providers/openai.ts - Another provider example

Configuration

  • docs/providers/ - Provider documentation directory
  • docs/self-hosting/environment-variables.mdx - Where to add new env vars

Implementation Tasks

  • Create apps/webapp/app/lib/batch/providers/openrouter.ts
  • Add OpenRouter API integration
  • Add environment variable configuration (OPENROUTER_API_KEY)
  • Create documentation in docs/providers/openrouter.mdx
  • Update environment variables documentation
  • Add model selection UI if needed

Technical Notes

  1. OpenRouter uses an OpenAI-compatible API, so you can likely extend/adapt the OpenAI provider
  2. API endpoint: https://openrouter.ai/api/v1
  3. Requires HTTP-Referer and X-Title headers for attribution
  4. Supports streaming responses

Resources

Labels

good first issue, enhancement

コントリビューターガイド