Skip to content

feat(llm): add MiniMax as first-class LLM provider#741

Open
octo-patch wants to merge 1 commit intoOpenSPG:masterfrom
octo-patch:feature/add-minimax-provider
Open

feat(llm): add MiniMax as first-class LLM provider#741
octo-patch wants to merge 1 commit intoOpenSPG:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

  • Add MiniMaxClient as a registered LLM provider (type: minimax), inheriting from OpenAIClient
  • Auto-detect MINIMAX_API_KEY from environment, with temperature clamping to [0.0, 1.0]
  • Support MiniMax-M2.7 (default), MiniMax-M2.5, and MiniMax-M2.5-highspeed models

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

File Description
kag/common/llm/minimax_client.py New MiniMaxClient class with @LLMClient.register("minimax")
kag/common/llm/__init__.py Export MiniMaxClient
tests/unit/common/llm/test_minimax.py 21 unit tests + 3 integration tests

Usage

Or via Python:

Test plan

  • 21 unit tests pass (registration, defaults, temperature clamping, API key handling, sync/async calls, streaming, tool calls)
  • 3 integration tests pass with real MiniMax API (sync, async, streaming)
  • Verify existing OpenAI/Ollama tests still pass (no changes to existing code)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant