feat: add MiniMax as alternative LLM provider#72
Open
octo-patch wants to merge 1 commit intoOpenGVLab:mainfrom
Open
feat: add MiniMax as alternative LLM provider#72octo-patch wants to merge 1 commit intoOpenGVLab:mainfrom
octo-patch wants to merge 1 commit intoOpenGVLab:mainfrom
Conversation
Add MiniMax (M2.7, M2.7-highspeed, M2.5, M2.5-highspeed) as a first-class LLM provider alongside OpenAI. Changes: - New iGPT/controllers/llm_provider.py with MiniMaxLLM class and create_llm() factory. Wraps MiniMax's OpenAI-compatible chat completion API as a LangChain BaseLLM. Includes temperature clamping (MiniMax requires >0) and think-tag stripping. - Updated ConversationBot.init_agent() to accept provider/api_key params and use the factory instead of hardcoded OpenAI. - Updated app.py with a provider selector dropdown in the login UI. - Auto-detection: if MINIMAX_API_KEY is set (without OPENAI_API_KEY), MiniMax is chosen automatically. Or set LLM_PROVIDER=minimax explicitly. - 33 unit tests + 3 integration tests. - README docs with model table and usage instructions.
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
Adds MiniMax as a first-class LLM provider alongside OpenAI for InternGPT's conversation agent.
Key changes:
iGPT/controllers/llm_provider.py—MiniMaxLLMclass wrapping MiniMax's OpenAI-compatible chat completion API as a LangChainBaseLLM, pluscreate_llm()factory for provider-agnostic LLM creationConversationBot.init_agent()to acceptprovider/api_keyparametersapp.pywith a provider dropdown selector (OpenAI / MiniMax) in the login UIMINIMAX_API_KEYis set (withoutOPENAI_API_KEY), MiniMax is chosen automatically; or setLLM_PROVIDER=minimaxexplicitly<think>tag stripping, both old and new openai SDK supportFiles changed (7, +547 additions):
iGPT/controllers/llm_provider.py— new provider moduleiGPT/controllers/ConversationBot.py— usecreate_llm()factoryiGPT/controllers/__init__.py— export new symbolsapp.py— provider selector UI + MiniMax login supportREADME.md— usage docs with model tabletests/test_llm_provider.py— 33 unit teststests/test_llm_provider_integration.py— 3 integration testsTest plan
This PR is fully backward-compatible — existing OpenAI users see no behavior change.