feat(llm): add MiniMax provider support#619
feat(llm): add MiniMax provider support#619winsonwq wants to merge 1 commit intobrowseros-ai:mainfrom
Conversation
|
All contributors have signed the CLA. Thank you! |
Greptile SummaryThis PR adds MiniMax as a new LLM provider by following the existing OpenAI-compatible pattern used for Moonshot, wiring up all six required touch points: the shared schema, the server-side factory, the agent-side type union, the model catalogue, the provider template, and the dialog enum. The integration is clean and consistent with the rest of the codebase. Key findings:
Confidence Score: 4/5Not safe to merge as-is — the missing One P1 defect (missing
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as NewProviderDialog
participant Templates as providerTemplates.ts
participant Schema as llm.ts (shared)
participant Factory as provider.ts (server)
participant API as MiniMax API
UI->>Templates: getDefaultBaseUrlForProviders('minimax')
Templates-->>UI: DEFAULT_BASE_URLS.minimax → https://api.minimaxi.com[/v1]
UI->>UI: User fills form & submits
UI->>Schema: Validate provider type via LLMProviderSchema
Schema-->>UI: 'minimax' accepted
UI->>Factory: createLLMProvider({ provider: 'minimax', baseUrl, apiKey, model })
Factory->>Factory: PROVIDER_FACTORIES['minimax'] → createMinimaxModel()
Factory->>Factory: createOpenAICompatible({ name: 'minimax', baseURL, apiKey })
Factory->>API: POST {baseURL}/chat/completions
API-->>Factory: Response
Factory-->>UI: LanguageModel
Prompt To Fix All With AIThis is a comment left during a code review.
Path: packages/browseros-agent/apps/agent/lib/llm-providers/providerTemplates.ts
Line: 202
Comment:
**Missing `/v1` suffix in default base URL**
The `DEFAULT_BASE_URLS` entry for `minimax` is `'https://api.minimaxi.com'`, which is missing the `/v1` path segment required by the OpenAI-compatible endpoint. Every other OpenAI-compatible provider in this map includes the full path (e.g. `moonshot: 'https://api.moonshot.ai/v1'`, `openai: 'https://api.openai.com/v1'`). As a result, when a user selects MiniMax, the auto-populated base URL will cause all API calls to fail with a 404 or similar HTTP error.
The same issue exists in `models-dev-data.json` (line 5406), where the `api` field is `"https://api.minimaxi.com"` — this is used by `enrichTemplate` to derive `defaultBaseUrl` when no explicit override is given.
```suggestion
minimax: 'https://api.minimaxi.com/v1',
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: packages/browseros-agent/apps/agent/lib/llm-providers/models-dev-data.json
Line: 5406
Comment:
**Missing `/v1` suffix in `api` field**
The `api` value `"https://api.minimaxi.com"` is used by `enrichTemplate` as the `defaultBaseUrl` (since no `defaultBaseUrl` override is passed in `providerTemplates.ts`). All other OpenAI-compatible providers include `/v1` in this field. Without it, the template will populate an incomplete URL, mirroring the same problem in `DEFAULT_BASE_URLS`.
```suggestion
"api": "https://api.minimaxi.com/v1",
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(llm): add MiniMax provider support" | Re-trigger Greptile |
| lmstudio: 'http://localhost:1234/v1', | ||
| bedrock: '', | ||
| browseros: '', | ||
| minimax: 'https://api.minimaxi.com', |
There was a problem hiding this comment.
Missing
/v1 suffix in default base URL
The DEFAULT_BASE_URLS entry for minimax is 'https://api.minimaxi.com', which is missing the /v1 path segment required by the OpenAI-compatible endpoint. Every other OpenAI-compatible provider in this map includes the full path (e.g. moonshot: 'https://api.moonshot.ai/v1', openai: 'https://api.openai.com/v1'). As a result, when a user selects MiniMax, the auto-populated base URL will cause all API calls to fail with a 404 or similar HTTP error.
The same issue exists in models-dev-data.json (line 5406), where the api field is "https://api.minimaxi.com" — this is used by enrichTemplate to derive defaultBaseUrl when no explicit override is given.
| minimax: 'https://api.minimaxi.com', | |
| minimax: 'https://api.minimaxi.com/v1', |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browseros-agent/apps/agent/lib/llm-providers/providerTemplates.ts
Line: 202
Comment:
**Missing `/v1` suffix in default base URL**
The `DEFAULT_BASE_URLS` entry for `minimax` is `'https://api.minimaxi.com'`, which is missing the `/v1` path segment required by the OpenAI-compatible endpoint. Every other OpenAI-compatible provider in this map includes the full path (e.g. `moonshot: 'https://api.moonshot.ai/v1'`, `openai: 'https://api.openai.com/v1'`). As a result, when a user selects MiniMax, the auto-populated base URL will cause all API calls to fail with a 404 or similar HTTP error.
The same issue exists in `models-dev-data.json` (line 5406), where the `api` field is `"https://api.minimaxi.com"` — this is used by `enrichTemplate` to derive `defaultBaseUrl` when no explicit override is given.
```suggestion
minimax: 'https://api.minimaxi.com/v1',
```
How can I resolve this? If you propose a fix, please make it concise.| } | ||
| ] | ||
| }, | ||
| "minimax": { |
There was a problem hiding this comment.
Missing
/v1 suffix in api field
The api value "https://api.minimaxi.com" is used by enrichTemplate as the defaultBaseUrl (since no defaultBaseUrl override is passed in providerTemplates.ts). All other OpenAI-compatible providers include /v1 in this field. Without it, the template will populate an incomplete URL, mirroring the same problem in DEFAULT_BASE_URLS.
| "minimax": { | |
| "api": "https://api.minimaxi.com/v1", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browseros-agent/apps/agent/lib/llm-providers/models-dev-data.json
Line: 5406
Comment:
**Missing `/v1` suffix in `api` field**
The `api` value `"https://api.minimaxi.com"` is used by `enrichTemplate` as the `defaultBaseUrl` (since no `defaultBaseUrl` override is passed in `providerTemplates.ts`). All other OpenAI-compatible providers include `/v1` in this field. Without it, the template will populate an incomplete URL, mirroring the same problem in `DEFAULT_BASE_URLS`.
```suggestion
"api": "https://api.minimaxi.com/v1",
```
How can I resolve this? If you propose a fix, please make it concise.|
I have read the CLA Document and I hereby sign the CLA |
- Add MINIMAX provider type to shared LLM schemas - Add createMinimaxModel factory using OpenAI-compatible SDK - Add MiniMax models to models-dev-data.json (M2.7, M2.5, M2.1, M2-her) - Add MiniMax to provider templates with default base URL and API key guide - Add 'minimax' option to NewProviderDialog enum Models supported: - MiniMax-M2.7 / MiniMax-M2.7-highspeed (context: 204800) - MiniMax-M2.5 / MiniMax-M2.5-highspeed (context: 204800) - MiniMax-M2.1 / MiniMax-M2.1-highspeed (context: 204800) - M2-her (context: 204800) API: https://api.minimaxi.com (OpenAI-compatible endpoint)
7bdfebe to
1edd4b8
Compare
|
I have read the CLA Document and I hereby sign the CLA |
Summary
Add MiniMax as a new LLM provider option in the "Configure New Provider" dialog.
Changes
packages/shared/src/schemas/llm.ts: AddMINIMAXtoLLM_PROVIDERSconstant andLLMProviderSchemaenumapps/server/src/lib/clients/llm/provider.ts: AddcreateMinimaxModel()factory using OpenAI-compatible SDKapps/agent/lib/llm-providers/types.ts: AddminimaxtoProviderTypeunionapps/agent/lib/llm-providers/models-dev-data.json: Add MiniMax models (M2.7, M2.5, M2.1, M2-her) with context window 204800apps/agent/lib/llm-providers/providerTemplates.ts: Add MiniMax template with default base URLhttps://api.minimaxi.comand API key guide linkapps/agent/entrypoints/app/ai-settings/NewProviderDialog.tsx: AddminimaxtoproviderTypeEnumSupported Models
API Details
https://api.minimaxi.com/v1(OpenAI-compatible)Testing
Verified API connectivity with MiniMax-M2.7 model using the OpenAI-compatible endpoint. Response:
status_code: 0(success).Notes
api.minimaxi.com) and international (api.minimax.io) versions use the same API format — this PR targets the domestic version following the Moonshot precedent