Skip to content

feat: add MiniMax AI as alternative LLM provider#39

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

feat: add MiniMax AI as alternative LLM provider#39
octo-patch wants to merge 1 commit intoyeahhe365:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax AI (M2.7 and M2.7-highspeed, 204K context) as an alternative LLM provider alongside Google Gemini. This is the first step toward making All Model Chat truly multi-provider.

Key changes:

  • OpenAI-compatible API client (services/api/openaiCompatApi.ts): Lightweight stream + non-stream chat via native fetch() - no new npm dependencies
  • Provider routing in useApiInteraction.ts: Detects MiniMax models and routes through the OpenAI-compat path
  • MiniMax models added to default model picker (pinned): MiniMax-M2.7, MiniMax-M2.7-highspeed
  • Settings UI: Separate MiniMax API key input in Settings > API Configuration
  • Temperature clamping: MiniMax requires (0.0, 1.0] - auto-clamped
  • Thinking tag stripping: M2.7 <thinking> blocks extracted and displayed properly
  • Bilingual i18n: English + Chinese translations for all new UI strings
  • 32 unit + integration tests with vitest (provider constants + API client)

Files changed (15 files, ~1116 additions):

File Change
constants/providerConstants.ts NEW - MiniMax models, detection helpers
services/api/openaiCompatApi.ts NEW - OpenAI-compat chat API
tests/providerConstants.test.ts NEW - 12 unit tests
tests/openaiCompatApi.test.ts NEW - 20 unit + integration tests
types/settings.ts Add minimaxApiKey to AppSettings
constants/appConstants.ts Default minimaxApiKey: null
utils/modelHelpers.ts Include MiniMax models in defaults
hooks/.../useApiInteraction.ts MiniMax routing logic
hooks/.../useStandardChat.ts Bypass Gemini key check for MiniMax
components/.../ApiConfigSection.tsx MiniMax API key UI
components/.../SettingsContent.tsx Pass MiniMax props
utils/translations/settings/api.ts i18n strings
vite.config.ts Add vitest config
package.json Test scripts
README.md Multi-provider docs

How to use

  1. Enter your MiniMax API key in Settings > API Configuration > MiniMax AI Configuration
  2. Select MiniMax M2.7 or MiniMax M2.7 Highspeed from the model picker
  3. Chat as usual - streaming and non-streaming both work

Get your API key at platform.minimax.chat

Test plan

  • All 32 tests pass (npm test)
  • Build succeeds (npm run build)
  • Manual test: Configure MiniMax API key in settings
  • Manual test: Select MiniMax model and send a message (streaming)
  • Manual test: Verify temperature clamping and thinking tag display
  • Manual test: Verify existing Gemini functionality is unaffected

Add MiniMax M2.7 and M2.7-highspeed (204K context) as first-class LLM
providers alongside Google Gemini. MiniMax uses the OpenAI-compatible
API format, so no new npm dependencies are required - just native fetch().

Changes:
- New OpenAI-compatible chat API client (stream + non-stream via SSE)
- Provider detection and routing in message sender pipeline
- MiniMax models in default model picker (pinned)
- Separate MiniMax API key field in Settings > API Configuration
- Temperature clamping for MiniMax (0, 1.0] range
- Thinking tag stripping for M2.7 responses
- Bilingual (en/zh) i18n strings
- 32 unit + integration tests with vitest
- README updated with multi-provider support table
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