feat: add MiniMax as first-class AI provider#108
Conversation
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 { |
There was a problem hiding this comment.
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.
| else { | |
| } else { |
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (12 files)
Fix these issues in Kilo Cloud Reviewed by kimi-k2.5-0127 · 178,735 tokens |
|
Hi! Very interesting. |
|
@octo-patch Looks ok to me, I will merge it. |
|
I added my greetings also here: https://tabularis.dev/blog/v0912-tokio-postgres-minimax-json-editor |
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- Addgenerate_minimax()function using OpenAI-compatible endpoint atapi.minimax.io/v1, with temperature 0.1 for deterministic SQL output; add routing ingenerate_query()andexplain_query()src-tauri/src/config.rs- AddMINIMAX_API_KEYenvironment variable mappingsrc-tauri/src/ai_models.yaml- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to static model listFrontend (React/TypeScript - 5 files):
src/contexts/SettingsContext.ts- Addminimaxto AiProvider union typesrc/pages/Settings.tsx- Add MiniMax to provider selection listsrc/utils/settingsUI.ts- Add MiniMax label mappingsrc/utils/settings.ts- Add MiniMax to auto-detection prioritysrc/contexts/SettingsProvider.tsx- Add MiniMax to API key auto-detection chainTests (3 files, 12 new tests):
tests/utils/settings.test.ts- MiniMax auto-detection teststests/utils/settingsUI.test.ts- MiniMax label testtests/utils/minimax.test.ts- 9 integration testsDocs:
README.md- Add MiniMax to AI providers list and aiCustomModels exampleConfiguration
Users can configure MiniMax in two ways:
MINIMAX_API_KEYfor auto-detectionTest plan