feat: add MiniMax as a model provider (default M3)#2717
Conversation
|
|
|
||
| async with httpx.AsyncClient(verify=False) as client: | ||
| response = await client.get(url, headers=headers) | ||
| response.raise_for_status() |
There was a problem hiding this comment.
安全风险:verify=False 禁用了 SSL 证书验证,生产环境下容易遭受中间人攻击。建议从配置读取或默认为 True。
There was a problem hiding this comment.
Good catch — fixed in c38ef2c. verify now comes from provider_config.get("ssl_verify", True), so it defaults to True and can only be disabled by explicit operator opt-in (matching the existing ssl_verify config flow elsewhere in the codebase).
|
|
||
| async with httpx.AsyncClient(verify=False) as client: | ||
| response = await client.get(url, headers=headers) | ||
| response.raise_for_status() |
There was a problem hiding this comment.
缺少 timeout 配置:httpx.AsyncClient(verify=False) 没有设置 timeout。如果 MiniMax API 响应缓慢或挂起,请求会无限等待。建议添加 timeout=15.0。
There was a problem hiding this comment.
Fixed in c38ef2c — added timeout=15.0 to httpx.AsyncClient. Also added a regression test (test_get_models_timeout already covered ConnectTimeout, the new test_get_models_ssl_verify_defaults_to_true asserts the timeout kwarg is set).
|
LGTM. MiniMax provider integration follows the existing pattern. No issues found. |
Add MiniMax (https://www.minimaxi.com/) as a first-class model provider alongside SiliconFlow, DashScope, and TokenPony. MiniMax offers LLM models (M2.7 with 1M context, M2.5/M2.5-highspeed with 204K context) and the embo-01 embedding model. Backend: - Add MiniMaxModelProvider with model type classification (LLM, embedding, TTS, STT, reranker, VLM) and known context window sizes - Register provider in factory, enum, and base URL constants - Wire into model_management_service for batch create flow Frontend: - Add useMinimaxModelList hook for batch import - Add MiniMax option in ModelAddDialog provider dropdown - Add provider constants (icon, hint, link) and i18n translations (en/zh) Tests: - Add 16 unit tests covering all model types, error handling, context windows, and auth header verification
- Add MiniMax-M3 to model context map and set as default - Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed (correct 192K context) - Remove older M2.5/M2.5-highspeed models - Update related unit tests to match the new model list
- Make SSL verification configurable via provider_config['ssl_verify'], defaulting to True (no more unconditional verify=False) - Add a 15s request timeout to httpx.AsyncClient to prevent indefinite hangs if the MiniMax API is slow/stalled - Add unit tests covering both behaviors Co-Authored-By: Octopus <liyuan851277048@icloud.com>
c38ef2c to
edf4330
Compare
|
Rebased onto the latest main and resolved the merge conflicts — they were all additive (the new |




Summary
Add MiniMax as a first-class model provider in nexent, with MiniMax-M3 as the default LLM.
What is MiniMax?
MiniMax is a leading AI company offering powerful LLM and embedding models:
All models are accessible via an OpenAI-compatible API at
https://api.minimax.io/v1.Changes
Backend (5 files):
backend/services/providers/minimax_provider.py— NewMiniMaxModelProviderwith model type classification (LLM, embedding, TTS, STT, reranker, VLM) and known context window sizes for M3 / M2.7 / M2.7-highspeedbackend/consts/provider.py— AddMINIMAXenum, base URL, and models endpointbackend/services/providers/__init__.py— ExportMiniMaxModelProviderbackend/services/model_provider_service.py— Wire MiniMax into factorybackend/services/model_management_service.py— Add MiniMax base URL for batch createFrontend (5 files):
frontend/hooks/model/useMinimaxModelList.ts— Batch import hook (follows DashScope pattern)frontend/app/[locale]/models/components/model/ModelAddDialog.tsx— Add MiniMax to provider dropdownfrontend/const/modelConfig.ts— Provider constants (icon, hint, link)frontend/public/locales/{en,zh}/common.json— i18n translationsfrontend/public/minimax.png— Provider iconTests (1 file):
test/backend/services/providers/test_minimax_provider.py— Unit tests covering all model types, known context windows (M3 / M2.7 / M2.7-highspeed), error handling, authorization header, and mixed type classificationWhy
MiniMax-M3 is the latest model, with a 512K context window, up to 128K output, and image input support. M2.7 is retained as a back-compatibility alternative; older M2.5 entries have been removed.
Test Plan