Skip to content

Add MiniMax as an LLM provider#11

Open
octo-patch wants to merge 1 commit into
MNeMoNiCuZ:mainfrom
octo-patch:feature/add-minimax-provider
Open

Add MiniMax as an LLM provider#11
octo-patch wants to merge 1 commit into
MNeMoNiCuZ:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Mar 14, 2026

Summary

Adds MiniMax as a new LLM provider option, bringing the total from 7 to 8 supported providers.

MiniMax offers an OpenAI-compatible API with models like MiniMax-M2.5 and MiniMax-M2.5-highspeed, featuring a 204K context window — well-suited for the multi-turn node logic generation this app does.

Changes

  • Type definitions (llm.types.ts): Added 'minimax' to the LLMProvider union, DEFAULT_MODELS, PROVIDER_LABELS, and DEFAULT_LLM_SETTINGS
  • Provider adapter (llmHandlers.ts): Added 'minimax' case to the getAdapter() factory, reusing getOpenAICompatibleAdapter with MiniMax's base URL (https://api.minimax.io/v1)
  • Settings UI (SettingsTab.tsx, SettingsModal.tsx): Added MiniMax to the PROVIDERS array and base URL input condition
  • README: Added MiniMax to the provider list and API key table

How it works

Since MiniMax exposes an OpenAI-compatible chat completions endpoint, no new SDK dependency is needed — the existing getOpenAICompatibleAdapter() handles everything with just the base URL override.

Test plan

  • All 33 existing vitest tests pass
  • Production build (npm run build) succeeds
  • Manual: enter a MiniMax API key in Settings → MiniMax, select a model, test connection
  • Manual: use the AI assistant tab with MiniMax to generate node logic

Summary by CodeRabbit

Release Notes

  • New Features
    • Added MiniMax as a new supported LLM provider.
    • Two MiniMax models now available: MiniMax-M2.5 and MiniMax-M2.5-highspeed.
    • MiniMax provider configuration accessible in Settings with customizable Base URL support (default: https://api.minimax.io/v1).

MiniMax offers OpenAI-compatible API endpoints with models like
MiniMax-M2.5 and MiniMax-M2.5-highspeed (204K context window).
This adds MiniMax alongside the existing providers by reusing
the OpenAI-compatible adapter with the MiniMax base URL.

Changes:
- Add 'minimax' to the LLMProvider union type and default configs
- Add MiniMax case to the provider adapter factory
- Include MiniMax in the settings UI provider lists with base URL input
- Update README with MiniMax in the provider table
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 14, 2026

Walkthrough

The pull request adds support for MiniMax as a new LLM provider throughout the application by extending type definitions, configuration objects, UI components, IPC handlers, and documentation. The implementation follows existing patterns established for other providers.

Changes

Cohort / File(s) Summary
Type Definitions & Configuration
src/renderer/src/types/llm.types.ts
Added 'minimax' to LLMProvider union type. Extended DEFAULT_MODELS, PROVIDER_LABELS, and DEFAULT_LLM_SETTINGS to include minimax provider configuration with two available models (MiniMax-M2.5, MiniMax-M2.5-highspeed) and default base URL.
UI Components
src/renderer/src/components/modals/SettingsModal.tsx, src/renderer/src/components/tabs/SettingsTab.tsx
Added minimax to the provider list. Updated base URL placeholder logic to route minimax provider to https://api.minimax.io/v1. Extended conditional rendering and provider-based UI logic to accommodate the new provider in consistent patterns.
IPC Handler
src/main/ipc/llmHandlers.ts
Added minimax case to the adapter selector switch statement, routing to OpenAI-compatible adapter with minimax API base URL as default.
Documentation
README.md
Updated provider list count from "7 LLM provider adapters" to "8 LLM provider adapters" and added minimax to supported providers table.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A minimax arrives to join the fray, 🤖
Eight providers now light the way,
With configs aligned and UI in tune,
The LLM adapters croon a happy tune! 🎶

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add MiniMax as an LLM provider' directly and clearly summarizes the main change in the changeset—adding a new LLM provider with supporting type definitions, adapter configuration, and UI updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/renderer/src/components/tabs/SettingsTab.tsx (1)

412-427: Base URL logic duplicated across components.

The PROVIDERS array and placeholder URL logic are duplicated between SettingsTab.tsx and SettingsModal.tsx. Consider centralizing to avoid drift.

♻️ Centralize PROVIDERS in llm.types.ts

Since PROVIDER_LABELS already exists in llm.types.ts, you could derive or export PROVIDERS from there:

// In llm.types.ts
export const PROVIDERS: LLMProvider[] = Object.keys(PROVIDER_LABELS) as LLMProvider[]

// Or if order matters, define explicitly:
export const PROVIDERS: LLMProvider[] = [
  'openai', 'anthropic', 'google', 'groq', 'xai', 'minimax', 'openrouter', 'ollama'
]

Then import from both UI components to ensure consistency when adding new providers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/src/components/tabs/SettingsTab.tsx` around lines 412 - 427,
SettingsTab.tsx duplicates provider lists and placeholder URL logic already
present in SettingsModal.tsx; centralize the provider definitions and any
provider-specific placeholders by exporting a single PROVIDERS (and if needed
PROVIDER_PLACEHOLDERS) from llm.types.ts (or the module where PROVIDER_LABELS
lives) and import them into SettingsTab.tsx and SettingsModal.tsx; update the
Input placeholder usage in SettingsTab's provider conditional (the component
rendering using config.baseUrl and setProviderBaseUrl) to read the placeholder
from the shared constant instead of duplicated ternary logic so both components
stay in sync.
src/renderer/src/components/modals/SettingsModal.tsx (1)

163-171: Consider extracting placeholder URLs to a constant.

The nested ternary for placeholder URLs is becoming unwieldy with 4 providers. A lookup object would improve readability and reduce duplication with SettingsTab.tsx.

♻️ Optional: Extract to a constant
// Could be added to llm.types.ts alongside other provider constants
const BASE_URL_PLACEHOLDERS: Partial<Record<LLMProvider, string>> = {
  ollama: 'http://localhost:11434',
  openrouter: 'https://openrouter.ai/api/v1',
  minimax: 'https://api.minimax.io/v1',
  xai: 'https://api.x.ai/v1'
}

// Usage:
placeholder={BASE_URL_PLACEHOLDERS[provider] ?? ''}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/src/components/modals/SettingsModal.tsx` around lines 163 - 171,
Extract the nested ternary used for placeholder in SettingsModal.tsx into a
shared constant (e.g., BASE_URL_PLACEHOLDERS) keyed by LLMProvider to improve
readability and reuse with SettingsTab.tsx; add the constant to a common
location (suggest llm.types.ts alongside other provider constants) with entries
for 'ollama', 'openrouter', 'minimax', and 'xai' and then replace the inline
ternary expression (the placeholder prop that switches on provider) with a
lookup like BASE_URL_PLACEHOLDERS[provider] ?? '' so both SettingsModal and
SettingsTab can import and use the same mapping.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/renderer/src/components/modals/SettingsModal.tsx`:
- Around line 163-171: Extract the nested ternary used for placeholder in
SettingsModal.tsx into a shared constant (e.g., BASE_URL_PLACEHOLDERS) keyed by
LLMProvider to improve readability and reuse with SettingsTab.tsx; add the
constant to a common location (suggest llm.types.ts alongside other provider
constants) with entries for 'ollama', 'openrouter', 'minimax', and 'xai' and
then replace the inline ternary expression (the placeholder prop that switches
on provider) with a lookup like BASE_URL_PLACEHOLDERS[provider] ?? '' so both
SettingsModal and SettingsTab can import and use the same mapping.

In `@src/renderer/src/components/tabs/SettingsTab.tsx`:
- Around line 412-427: SettingsTab.tsx duplicates provider lists and placeholder
URL logic already present in SettingsModal.tsx; centralize the provider
definitions and any provider-specific placeholders by exporting a single
PROVIDERS (and if needed PROVIDER_PLACEHOLDERS) from llm.types.ts (or the module
where PROVIDER_LABELS lives) and import them into SettingsTab.tsx and
SettingsModal.tsx; update the Input placeholder usage in SettingsTab's provider
conditional (the component rendering using config.baseUrl and
setProviderBaseUrl) to read the placeholder from the shared constant instead of
duplicated ternary logic so both components stay in sync.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c56c3d95-159a-426c-bc2f-3600f7750924

📥 Commits

Reviewing files that changed from the base of the PR and between 72439d8 and 3ee5fa6.

📒 Files selected for processing (5)
  • README.md
  • src/main/ipc/llmHandlers.ts
  • src/renderer/src/components/modals/SettingsModal.tsx
  • src/renderer/src/components/tabs/SettingsTab.tsx
  • src/renderer/src/types/llm.types.ts

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.

1 participant