Skip to content

feat: add MiniMax as first-class AI provider#108

Merged
debba merged 1 commit intodebba:mainfrom
octo-patch:feature/add-minimax-provider
Mar 29, 2026
Merged

feat: add MiniMax as first-class AI provider#108
debba merged 1 commit intodebba:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax as a first-class AI provider for SQL generation and query explanation in Tabularis, alongside OpenAI, Anthropic, OpenRouter, Ollama, and OpenAI-Compatible.

MiniMax offers the MiniMax-M2.7 and MiniMax-M2.7-highspeed models with 204K context windows via an OpenAI-compatible API, making it a great fit for database schema analysis and SQL generation.

Changes

Backend (Rust - 3 files):

  • src-tauri/src/ai.rs - Add generate_minimax() function using OpenAI-compatible endpoint at api.minimax.io/v1, with temperature 0.1 for deterministic SQL output; add routing in generate_query() and explain_query()
  • src-tauri/src/config.rs - Add MINIMAX_API_KEY environment variable mapping
  • src-tauri/src/ai_models.yaml - Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to static model list

Frontend (React/TypeScript - 5 files):

  • src/contexts/SettingsContext.ts - Add minimax to AiProvider union type
  • src/pages/Settings.tsx - Add MiniMax to provider selection list
  • src/utils/settingsUI.ts - Add MiniMax label mapping
  • src/utils/settings.ts - Add MiniMax to auto-detection priority
  • src/contexts/SettingsProvider.tsx - Add MiniMax to API key auto-detection chain

Tests (3 files, 12 new tests):

  • Updated tests/utils/settings.test.ts - MiniMax auto-detection tests
  • Updated tests/utils/settingsUI.test.ts - MiniMax label test
  • New tests/utils/minimax.test.ts - 9 integration tests

Docs:

  • README.md - Add MiniMax to AI providers list and aiCustomModels example

Configuration

Users can configure MiniMax in two ways:

  1. Settings UI: Select MiniMax as the AI provider and enter the API key
  2. Environment variable: Set MINIMAX_API_KEY for auto-detection

Test plan

  • All 71 TypeScript unit tests pass
  • All 9 MiniMax integration tests pass
  • TypeScript type-check passes (tsc --noEmit)
  • Rust test updated to verify MiniMax models load from YAML
  • Manual: select MiniMax in Settings > AI, enter API key, generate SQL query
  • Manual: verify auto-detection with MINIMAX_API_KEY env var

Add MiniMax (MiniMax-M2.7 and MiniMax-M2.7-highspeed) as a built-in AI
provider for SQL generation and query explanation, alongside OpenAI,
Anthropic, OpenRouter, Ollama, and OpenAI-Compatible.

Backend (Rust):
- Add generate_minimax() using OpenAI-compatible API at api.minimax.io/v1
- Add minimax routing in generate_query() and explain_query()
- Add MINIMAX_API_KEY env var support in config.rs
- Add MiniMax models to ai_models.yaml

Frontend (React/TypeScript):
- Add minimax to AiProvider union type
- Add MiniMax to Settings page provider list
- Add MiniMax label in settingsUI utility
- Add MiniMax to auto-detection priority chain

Tests:
- Update Rust test to verify MiniMax models loaded from YAML
- Add MiniMax label test in settingsUI.test.ts
- Add MiniMax detection test in settings.test.ts
- Add dedicated minimax.test.ts with 9 integration tests
provider: "openrouter",
});
if (hasOpenRouter) detectedProvider = "openrouter";
else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Indentation error - else should align with if on line 80

The else keyword is indented at 12 spaces while its matching if is at 14 spaces. This creates confusing control flow.

Suggested change
else {
} else {

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Mar 28, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/contexts/SettingsProvider.tsx 81 Indentation error - else misaligned with matching if
Files Reviewed (12 files)
  • README.md - Documentation update
  • src-tauri/src/ai.rs - New MiniMax provider implementation ✓
  • src-tauri/src/ai_models.yaml - Model list update
  • src-tauri/src/config.rs - API key mapping
  • src/contexts/SettingsContext.ts - Type update
  • src/contexts/SettingsProvider.tsx - 1 indentation issue
  • src/pages/Settings.tsx - Provider list update
  • src/utils/settings.ts - Auto-detection update
  • src/utils/settingsUI.ts - Label mapping
  • tests/utils/minimax.test.ts - New test file ✓
  • tests/utils/settings.test.ts - Updated tests
  • tests/utils/settingsUI.test.ts - Updated tests

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.5-0127 · 178,735 tokens

@debba
Copy link
Copy Markdown
Owner

debba commented Mar 28, 2026

Hi! Very interesting.
I don’t use MiniMax but looks very interesting feature!
I will merge it soon, when you finish tests!
Thanks!

@debba
Copy link
Copy Markdown
Owner

debba commented Mar 29, 2026

@octo-patch Looks ok to me, I will merge it.
Thanks for your contribution, if you want give a star to the project and share on social media to help spread the word about the project, and join our Discord channel to stay up to date! 🚀
We also have some sponsors that our contributors can access, if that interests you.

@debba debba merged commit 4a2a5bd into debba:main Mar 29, 2026
1 check passed
@debba
Copy link
Copy Markdown
Owner

debba commented Mar 29, 2026

I added my greetings also here:

https://tabularis.dev/blog/v0912-tokio-postgres-minimax-json-editor

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.

2 participants