feat: add MiniMax Cloud API as alternative prompt enhancement provider - #96
Open
octo-patch wants to merge 1 commit into
Open
feat: add MiniMax Cloud API as alternative prompt enhancement provider#96octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
Add MiniMax as an alternative LLM provider for prompt enhancement (PE) alongside the existing DeepSeek integration. MiniMax offers an OpenAI- compatible API with models like MiniMax-M2.7 (1M context) that can be used for prompt recaptioning in HunyuanImage-3.0 image generation. Changes: - Add PE/minimax_client.py: MiniMaxClient with OpenAI-compat API, temperature clamping (0,1], think-tag stripping, retry logic - Modify run_image_gen.py: --llm-provider flag (deepseek/minimax), --sys-prompt-type flag for selecting prompt style - Update README.md: MiniMax installation, usage examples, CLI args - Add tests/test_minimax_provider.py: 31 unit + 3 integration tests
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
--llm-providerCLI flag (deepseek/minimax) and--sys-prompt-typeflag (universal/text_rendering) for flexible prompt rewriting configurationhttps://api.minimax.io/v1with models like MiniMax-M2.7 (1M context window) — users only needpip install openaiand aMINIMAX_API_KEYChanges
PE/minimax_client.pyMiniMaxClientclass with OpenAI-compat API, temperature clamping (0,1], think-tag stripping, retry logicrun_image_gen.py--llm-providerflag, new--sys-prompt-typearg (fixes missing arg reference)README.mdtests/test_minimax_provider.pyMotivation
The current PE module only supports DeepSeek via Tencent Cloud's LKEAP SDK, which requires Tencent Cloud credentials. Adding MiniMax as an alternative:
Test plan
python3 run_image_gen.py --prompt 'test' --rewrite 1 --llm-provider minimax(requires GPU for full image generation)Usage