Skip to content

feat: add OpenRouter as LLM provider#26

Merged
MinimaxLanbo merged 1 commit intomainfrom
feat/openrouter-provider
Mar 24, 2026
Merged

feat: add OpenRouter as LLM provider#26
MinimaxLanbo merged 1 commit intomainfrom
feat/openrouter-provider

Conversation

@MinimaxLanbo
Copy link
Collaborator

Summary

  • Add OpenRouter as a new LLM provider, using OpenAI-compatible protocol
  • Users can now access MiniMax and other models via OpenRouter's unified API endpoint
  • Preset models include MiniMax, Claude, GPT, DeepSeek, Gemini series

Closes #22

Test plan

  • Unit tests pass (pnpm test — 107 passed)
  • Lint pass (pnpm run lint)
  • Build pass (pnpm build)
  • Manual: select OpenRouter provider, enter API key, send message

🤖 Generated with Claude Code

Add OpenRouter support so users can access MiniMax and other models
via OpenRouter's OpenAI-compatible API endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Mar 24, 2026

Code Review: PR #26 - Add OpenRouter as LLM Provider

Summary

Adds OpenRouter as a new LLM provider option with MiniMax M2.5 as the default model.

Changes Made

  • Added openrouter to LLMProvider type union
  • Added OpenRouter provider config with 9 models (MiniMax, Claude, GPT, DeepSeek, Gemini)
  • Added test case for getDefaultProviderConfig('openrouter')
  • Added dropdown option in ChatPanel settings

Issues Found

1. Model ID Format Inconsistency (Low)
The OpenRouter models use a different ID format (provider/model-id) compared to direct providers:

  • minimax/MiniMax-M2.5 vs MiniMax-M2.5
  • anthropic/claude-sonnet-4-6 vs claude-sonnet-4-6

This is intentional for OpenRouter's API but worth noting. The test passes correctly.

2. Test Coverage (Good)
The test verifies:

  • Provider name
  • Base URL
  • Default model

All assertions match the config values correctly.

Verdict: ✅ Approve

The implementation is correct and follows existing patterns:

  • Type is properly extended
  • Config follows the same structure as other providers
  • Test validates defaults match
  • UI dropdown option added

No bugs, type safety issues, or security concerns found.

@MinimaxLanbo MinimaxLanbo merged commit add231b into main Mar 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] support for openroute base url

1 participant