-
Notifications
You must be signed in to change notification settings - Fork 33
Add MiniMax M2.7 as alternative LLM provider for prompt refinement - #10
Open
octo-patch wants to merge 1 commit into
Open
Add MiniMax M2.7 as alternative LLM provider for prompt refinement #10octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
- Add get_minimax_response() using OpenAI-compatible API (api.minimax.io/v1) - Add has_minimax_key() and get_llm_response() auto-detect helper - Add refine_prompts_by_llm() and related functions that prefer MiniMax when MINIMAX_API_KEY is set, falling back to OpenAI - Update gradio/app.py to use the new provider-agnostic functions - Add 25 unit + integration tests in tests/test_minimax_provider.py
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 an alternative LLM provider for prompt refinement and random prompt generation in JavisDiT.
Changes
javisdit/utils/inference_utils.py: Addedget_minimax_response()using MiniMax OpenAI-compatible API (https://api.minimax.io/v1, modelMiniMax-M2.7, 204K context). Addedhas_minimax_key(),get_llm_response()(auto-detect: MiniMax preferred over OpenAI),refine_prompt_by_llm(),get_random_prompt_by_llm(), andrefine_prompts_by_llm()— all provider-agnostic wrappers.gradio/app.py: Updated imports and prompt-refinement logic to userefine_prompts_by_llm()andhas_minimax_key(). Now warns when neitherMINIMAX_API_KEYnorOPENAI_API_KEYis set.tests/test_minimax_provider.py: 25 tests (unit + integration) covering key detection, API configuration, temperature constraints, message format, provider priority, and end-to-end prompt refinement.Usage
Set
MINIMAX_API_KEYto use MiniMax for prompt refinement (takes priority over OpenAI):export MINIMAX_API_KEY=your_key_here python gradio/app.py configs/javisdit-v1-0/inference/sample.pyOr use OpenAI as before with
OPENAI_API_KEY. The integration is fully backward-compatible.MiniMax API Details
https://api.minimax.io/v1(OpenAI-compatible)MiniMax-M2.7(204K context)0.7(within MiniMax required range(0.0, 1.0])