Skip to content

Add MiniMax as LLM provider for layout generation (M2.7/M2.5 models)#20

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

Add MiniMax as LLM provider for layout generation (M2.7/M2.5 models)#20
octo-patch wants to merge 1 commit into
TonyLianLong:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

This PR adds MiniMax as a cloud LLM provider for stage 1 layout generation, alongside the existing OpenAI (GPT-4/GPT-3.5) and self-hosted options.

Changes

  • utils/llm.py: Add MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed to model_names; detect minimax in get_llm_kwargs() to use https://api.minimax.io/v1 base URL; update get_layout() to route MiniMax through the chat completions endpoint
  • utils/api_key.py: Add minimax_api_key reading from MINIMAX_API_KEY environment variable
  • README.md: Add Option 1b documenting how to use MiniMax models
  • tests/test_minimax.py: 25 unit tests + 3 integration tests (28 total)

Usage

export MINIMAX_API_KEY=your_minimax_api_key
python prompt_batch.py --prompt-type demo --model MiniMax-M2.7 --auto-query --always-save --template_version v0.1

MiniMax models use the OpenAI-compatible API, so no additional dependencies are needed — the existing requests calls work as-is. Temperature 0.25 is within MiniMax's valid range (0.0, 1.0].

Available models

Model Context
MiniMax-M2.7 204K tokens
MiniMax-M2.7-highspeed 204K tokens
MiniMax-M2.5 204K tokens
MiniMax-M2.5-highspeed 204K tokens

- Add MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed
  to model_names list
- Detect minimax models in get_llm_kwargs(): use https://api.minimax.io/v1 base URL
  and MINIMAX_API_KEY env var for authentication
- Update get_layout() to use chat/completions endpoint and message content parsing
  for MiniMax models (OpenAI-compatible API)
- Add minimax_api_key to utils/api_key.py with MINIMAX_API_KEY env var support
- Add README section documenting MiniMax usage (Option 1b)
- Add tests/test_minimax.py: 25 unit tests + 3 integration tests

MiniMax (https://www.minimax.io/) provides powerful cloud LLM models
(MiniMax-M2.7, MiniMax-M2.5, 204K context) via an OpenAI-compatible API.
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