Add MiniMax as LLM provider for layout generation (M2.7/M2.5 models)#20
Open
octo-patch wants to merge 1 commit into
Open
Add MiniMax as LLM provider for layout generation (M2.7/M2.5 models)#20octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: AddMiniMax-M2.7,MiniMax-M2.7-highspeed,MiniMax-M2.5,MiniMax-M2.5-highspeedtomodel_names; detectminimaxinget_llm_kwargs()to usehttps://api.minimax.io/v1base URL; updateget_layout()to route MiniMax through the chat completions endpointutils/api_key.py: Addminimax_api_keyreading fromMINIMAX_API_KEYenvironment variableREADME.md: Add Option 1b documenting how to use MiniMax modelstests/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.1MiniMax models use the OpenAI-compatible API, so no additional dependencies are needed — the existing
requestscalls work as-is. Temperature0.25is within MiniMax's valid range(0.0, 1.0].Available models
MiniMax-M2.7MiniMax-M2.7-highspeedMiniMax-M2.5MiniMax-M2.5-highspeed