Skip to content

Add MiniMax as a first-class chat LLM provider#56

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

Add MiniMax as a first-class chat LLM provider#56
octo-patch wants to merge 1 commit intostoyan-stoyanov:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax as a new chat LLM provider alongside OpenAI, Claude, and PaLM.

  • MiniMaxChat class extending BaseChatLLM — uses MiniMax's OpenAI-compatible API (https://api.minimax.io/v1), so no new dependencies are required (reuses the existing openai library)
  • Supports MiniMax-M2.7 (default) and MiniMax-M2.7-highspeed models with 204K context window
  • Temperature clamping to MiniMax's accepted range (0.0, 1.0]
  • Per-request api_key and api_base to avoid global state conflicts with OpenAI
  • Full sync/async support via the existing call_with_retry / async_call_with_retry utilities

Changes

File Description
llmflows/llms/minimax_chat.py New MiniMaxChat class
llmflows/llms/__init__.py Export MiniMaxChat
tests/llms/test_minimax_chat.py 19 unit tests
tests/llms/test_minimax_chat_integration.py 3 integration tests
README.md Add MiniMax chat example + mention in features

5 files changed, 567 additions, 1 deletion

Usage

from llmflows.llms import MiniMaxChat, MessageHistory

llm = MiniMaxChat(api_key="<your-minimax-api-key>", model="MiniMax-M2.7")
message_history = MessageHistory()
message_history.add_user_message("Hello!")

response, call_data, model_config = llm.generate(message_history)
print(response)

Test plan

  • All 19 unit tests pass (initialization, temperature clamping, generate, format_results, model variants)
  • All 3 integration tests pass (multi-turn conversation, max_messages, config completeness)
  • All 69 existing tests pass with no regressions
  • Manual test with a real MiniMax API key

Add MiniMaxChat class that extends BaseChatLLM, providing access to
MiniMax models (MiniMax-M2.7, MiniMax-M2.7-highspeed) via their
OpenAI-compatible API endpoint. Reuses the existing openai library
with a custom api_base, so no new dependencies are required.

Key features:
- Temperature clamping to MiniMax's accepted range (0.0, 1.0]
- Per-request api_key and api_base to avoid global state conflicts
- Full sync/async support via call_with_retry/async_call_with_retry
- 19 unit tests + 3 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