RedPlanetHQ/core

Add OpenRouter support as LLM provider

开放

#130 创建于 2025年10月28日

 (1 条评论) (0 个反应) (1 位负责人)TypeScript (184 个派生)auto 404
enhancementgood first issue

仓库指标

星标
 (1,930 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南