Skip to content

Add MiniMax as first-class LLM provider for agents and classifiers#454

Open
octo-patch wants to merge 1 commit intoawslabs:mainfrom
octo-patch:feature/add-minimax-provider
Open

Add MiniMax as first-class LLM provider for agents and classifiers#454
octo-patch wants to merge 1 commit intoawslabs:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax as a first-class LLM provider for both agents and classifiers in the Python SDK, following the same patterns as the existing OpenAI and Anthropic providers.

What's included

  • MiniMaxAgent — Agent implementation using MiniMax's OpenAI-compatible API (https://api.minimax.io/v1), supporting both streaming and non-streaming responses, custom system prompts with template variables, retriever integration, and configurable inference parameters
  • MiniMaxClassifier — Classifier implementation for intent routing using MiniMax models with function calling support
  • Model constantsMINIMAX_MODEL_ID_M2_7 and MINIMAX_MODEL_ID_M2_7_HIGHSPEED for the latest MiniMax models
  • Temperature clamping — Automatic clamping of temperature values ≤ 0 to 0.01 (MiniMax API requires positive temperature)
  • minimax install extrapip install "agent-squad[minimax]" (reuses the openai SDK dependency)
  • README update — MiniMax listed as an installation option alongside AWS, Anthropic, and OpenAI

Files changed (12 files, ~1091 additions)

File Change
python/src/agent_squad/agents/minimax_agent.py New MiniMaxAgent + MiniMaxAgentOptions
python/src/agent_squad/classifiers/minimax_classifier.py New MiniMaxClassifier + MiniMaxClassifierOptions
python/src/agent_squad/agents/__init__.py Optional import for MiniMaxAgent
python/src/agent_squad/classifiers/__init__.py Optional import for MiniMaxClassifier
python/src/agent_squad/types/types.py Model ID constants
python/src/agent_squad/types/__init__.py Export model constants
python/setup.cfg minimax install extra
README.md MiniMax installation section
python/src/tests/agents/test_minimax_agent.py 24 unit tests
python/src/tests/agents/test_minimax_agent_integration.py 3 integration tests
python/src/tests/classifiers/test_minimax_classifier.py 12 unit tests
python/src/tests/classifiers/test_minimax_classifier_integration.py 1 integration test

Test plan

  • 24 unit tests for MiniMaxAgent (init, system prompt, process_request, handlers)
  • 12 unit tests for MiniMaxClassifier (init, temperature clamping, process_request)
  • 3 integration tests for MiniMaxAgent (single response, streaming, multi-turn)
  • 1 integration test for MiniMaxClassifier (classify tech question)
  • All 268 existing tests continue to pass with no regressions
  • Verified with actual MiniMax API (MINIMAX_API_KEY)

Usage example

from agent_squad.agents import MiniMaxAgent, MiniMaxAgentOptions

agent = MiniMaxAgent(MiniMaxAgentOptions(
    name="TechExpert",
    description="A technology expert that answers programming questions",
    api_key="your-minimax-api-key",
    model="MiniMax-M2.7",
    streaming=True,
    inference_config={
        'maxTokens': 2000,
        'temperature': 0.7,
    }
))

Add MiniMaxAgent and MiniMaxClassifier that leverage MiniMax's
OpenAI-compatible API (https://api.minimax.io/v1) with M2.7 and
M2.7-highspeed models. Includes temperature clamping, custom base_url
support, streaming, and 40 tests (24 agent + 12 classifier unit tests
+ 4 integration tests).
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