Skip to content

feat: add MiniMax as first-class LLM provider#123

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

feat: add MiniMax as first-class LLM provider#123
octo-patch wants to merge 1 commit intoEladlev:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as a first-class LLM provider for AutoPrompt, enabling users to leverage MiniMax M2.7 and M2.5 series models for both prompt optimization (meta-prompt LLM) and prediction tasks.

Changes

  • utils/config.py: Add minimax branch in get_llm() factory using ChatOpenAI with OpenAI-compatible API endpoint (https://api.minimax.io/v1). Temperature is clamped to (0.0, 1.0] per MiniMax API requirements.
  • utils/llm_chain.py: Enable structured output support (with_structured_output) and OpenAI cost tracking callback for MiniMax provider.
  • config/llm_env.yml: Add minimax credentials section with MINIMAX_API_KEY and MINIMAX_API_BASE.
  • config/config_default.yml: Add MiniMax to the supported provider list comment.
  • docs/installation.md: Add MiniMax configuration instructions with example YAML snippets.
  • README.md: Mention MiniMax in the supported LLM providers list.

Supported Models

Model Context Notes
MiniMax-M2.7 1M tokens Latest flagship model
MiniMax-M2.7-highspeed 1M tokens Optimized for speed
MiniMax-M2.5 204K tokens Previous generation
MiniMax-M2.5-highspeed 204K tokens Fast variant

Usage

Test plan

  • 16 unit tests covering: provider routing, temperature clamping, API key/base URL config, model_kwargs passthrough, case-insensitive matching, structured output, callback selection, fallback to LLMChain
  • 3 integration tests verifying real API calls with M2.7, M2.7-highspeed, and temperature clamping
  • All 19 tests passing

Add MiniMax (M2.7 / M2.7-highspeed / M2.5 / M2.5-highspeed) as a
supported LLM provider via OpenAI-compatible API. MiniMax models
offer 1M context windows and can be used for both meta-prompt
refinement and prediction.

Changes:
- utils/config.py: Add MiniMax branch in get_llm() with temperature
  clamping (0,1] and configurable API key/base URL
- utils/llm_chain.py: Enable structured output and OpenAI cost
  tracking callback for MiniMax provider
- config/llm_env.yml: Add minimax credentials section
- config/config_default.yml: Document MiniMax in provider comment
- docs/installation.md: Add MiniMax configuration instructions
- README.md: Mention MiniMax in supported providers
- tests/: 16 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.

2 participants