Skip to content

Navigation Menu

Sign in
Sign up

Add MiniMax M2.7 as alternative LLM provider for prompt refinement - #10

Open
octo-patch wants to merge 1 commit into
JavisVerse:main from
octo-patch:feature/add-minimax-provider
Open

Add MiniMax M2.7 as alternative LLM provider for prompt refinement #10
octo-patch wants to merge 1 commit into
JavisVerse:main from
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

@octo-patch octo-patch commented Apr 3, 2026

Copy link
Copy Markdown

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: Added get_minimax_response() using MiniMax OpenAI-compatible API (https://api.minimax.io/v1, model MiniMax-M2.7, 204K context). Added has_minimax_key(), get_llm_response() (auto-detect: MiniMax preferred over OpenAI), refine_prompt_by_llm(), get_random_prompt_by_llm(), and refine_prompts_by_llm() — all provider-agnostic wrappers.

  • gradio/app.py: Updated imports and prompt-refinement logic to use refine_prompts_by_llm() and has_minimax_key(). Now warns when neither MINIMAX_API_KEY nor OPENAI_API_KEY is 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_KEY to 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.py

Or use OpenAI as before with OPENAI_API_KEY. The integration is fully backward-compatible.

MiniMax API Details

  • Base URL: https://api.minimax.io/v1 (OpenAI-compatible)
  • Default model: MiniMax-M2.7 (204K context)
  • Temperature: set to 0.7 (within MiniMax required range (0.0, 1.0])

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /