feat: add MiniMax as first-class LLM provider (chat + embedding)#356
Open
octo-patch wants to merge 1 commit intovolcengine:mainfrom
Open
feat: add MiniMax as first-class LLM provider (chat + embedding)#356octo-patch wants to merge 1 commit intovolcengine:mainfrom
octo-patch wants to merge 1 commit intovolcengine:mainfrom
Conversation
Add MiniMax (https://www.minimaxi.com/) as a fully supported LLM provider alongside OpenAI and Doubao, covering both chat completion and embedding generation. Backend changes (opencontext/llm/llm_client.py): - Add MINIMAX enum to LLMProvider - Implement _minimax_embedding() for native MiniMax embedding API (non-OpenAI-compatible: uses texts/type/vectors format) - Implement _minimax_embedding_async() for async embedding support - Fix _request_embedding() to properly handle MiniMax path (avoid NameError on undefined response variable) - Fix _request_embedding_async() to route MiniMax to native API instead of falling through to incompatible OpenAI SDK - Add MiniMax embedding validation in validate() - Add MiniMax error codes (invalid_api_key, insufficient_balance) to _extract_error_summary() Frontend changes: - Add MiniMax to ModelTypeList enum with M2.7/M2.7-highspeed models - Add embo-01 embedding model and api.minimax.io base URL presets - Add MiniMax provider icon (minimax.svg) - Wire up API key link, base URL routing, and form rendering - Add MiniMax default model in form initialValues Documentation: - Update README.md and README_zh.md to list MiniMax as supported - Add minimax option in config.yaml examples Tests (22 unit + 3 integration): - TestLLMProviderEnum: enum value validation - TestMiniMaxChatClient: init, completion, streaming, thinking - TestMiniMaxEmbeddingClient: native API format, auth, errors, truncation - TestMiniMaxValidation: chat and embedding validation paths - TestMiniMaxErrorHandling: MiniMax-specific error extraction - TestMiniMaxIntegration: real API tests (requires MINIMAX_API_KEY)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add MiniMax as a fully supported LLM provider alongside OpenAI and Doubao, covering both chat completion (via OpenAI-compatible API) and embedding generation (via MiniMax native API).
Changes
Backend (
opencontext/llm/llm_client.py):MINIMAXenum toLLMProvider_minimax_embedding()/_minimax_embedding_async()for MiniMax native embedding API (embo-01model, non-OpenAI-compatible format usingtexts/type/vectors)_request_embedding()to avoidNameErroron undefinedresponsevariable in the MiniMax code path_request_embedding_async()to route MiniMax to native API instead of falling through to incompatible OpenAI SDKvalidate()invalid_api_key,insufficient_balance) to_extract_error_summary()Frontend (
settings/constants.tsx,settings.tsx):ModelTypeListwith M2.7 / M2.7-highspeed modelsembo-01embedding model andapi.minimax.iobase URL presetsminimax.svg)Documentation (
README.md,README_zh.md):minimaxoption in config.yaml examplesTests (22 unit + 3 integration):
MINIMAX_API_KEY)Test Plan
MiniMax Models