Skip to content

feat: add MiniMax as alternative LLM provider (M2.7 default)#517

Open
octo-patch wants to merge 2 commits into
steven-tey:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as alternative LLM provider (M2.7 default)#517
octo-patch wants to merge 2 commits into
steven-tey:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

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

Summary

  • Add MiniMax as an alternative LLM provider via @ai-sdk/openai OpenAI-compatible adapter
  • Default model: MiniMax-M2.7 (latest flagship with enhanced reasoning and coding)
  • Also supports: MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed

Changes

  • apps/web/lib/ai-provider.ts: Provider factory with MiniMax priority, temperature clamping
  • apps/web/app/api/generate/route.ts: Updated API key check
  • apps/web/.env.example: MiniMax configuration docs
  • README.md: Updated setup instructions and tech stack
  • apps/web/__tests__/ai-provider.test.ts: 11 unit tests
  • apps/web/__tests__/ai-provider.integration.test.ts: 4 integration tests (M2.7, M2.7-highspeed, M2.5 legacy, streaming)

Why

MiniMax-M2.7 is the latest flagship model with enhanced reasoning and coding capabilities. The OpenAI-compatible API allows reuse of existing @ai-sdk/openai without new dependencies.

Testing

  • All 11 unit tests passing
  • All 4 integration tests passing with live MiniMax API

Add MiniMax (MiniMax-M2.5, MiniMax-M2.5-highspeed) as an alternative
AI provider for text completions. MiniMax uses an OpenAI-compatible API
and is configured via the MINIMAX_API_KEY environment variable. When set,
MiniMax takes priority over OpenAI.

- Add lib/ai-provider.ts with provider factory, temperature clamping,
  and API key detection
- Update generate route to use provider-agnostic model selection
- Add unit tests (11 tests) and integration tests (3 tests)
- Update .env.example and README.md with MiniMax configuration

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 17, 2026

Someone is attempting to deploy a commit to the Elegance Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 17, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm vite is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: pnpm-lock.yamlnpm/vite@8.0.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@8.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model
- Keep all previous models as alternatives
- Update related tests
@octo-patch octo-patch changed the title feat: add MiniMax as alternative LLM provider feat: add MiniMax as alternative LLM provider (M2.7 default) Mar 18, 2026
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