feat(llm): add MiniMax as first-class LLM provider#741
Open
octo-patch wants to merge 1 commit intoOpenSPG:masterfrom
Open
feat(llm): add MiniMax as first-class LLM provider#741octo-patch wants to merge 1 commit intoOpenSPG:masterfrom
octo-patch wants to merge 1 commit intoOpenSPG:masterfrom
Conversation
Add MiniMaxClient that inherits from OpenAIClient and registers as type "minimax" in the LLMClient registry. MiniMax provides an OpenAI-compatible API, so the client reuses existing OpenAI infrastructure with MiniMax-specific defaults: - Default base URL: https://api.minimax.io/v1 - Default model: MiniMax-M2.7 - Temperature clamping to [0.0, 1.0] - Auto-detection of MINIMAX_API_KEY environment variable Supported models: MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.5-highspeed Usage in kag_config.yaml: llm: type: minimax model: MiniMax-M2.7 api_key: ${MINIMAX_API_KEY} Includes 21 unit tests and 3 integration tests covering registration, defaults, temperature clamping, API key handling, sync/async calls, streaming, and tool/function calling.
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
MiniMaxClientas a registered LLM provider (type: minimax), inheriting fromOpenAIClientMINIMAX_API_KEYfrom environment, with temperature clamping to [0.0, 1.0]Motivation
MiniMax provides powerful LLMs with an OpenAI-compatible API. Adding MiniMax as a first-class provider gives KAG users an easy way to use MiniMax models for knowledge extraction, reasoning, and Q&A without manual base URL configuration.
Changes
kag/common/llm/minimax_client.pyMiniMaxClientclass with@LLMClient.register("minimax")kag/common/llm/__init__.pyMiniMaxClienttests/unit/common/llm/test_minimax.pyUsage
Or via Python:
Test plan