Skip to content

feat: add MiniMax M2.7/M2.5 provider support via minimax/ prefix#18

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

feat: add MiniMax M2.7/M2.5 provider support via minimax/ prefix#18
octo-patch wants to merge 1 commit into
dylanhogg:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

This PR adds first-class MiniMax LLM provider support to llmgraph via a minimax/ model prefix, routing through LiteLLM's OpenAI-compatible API path.

What changed

  • llmgraph/library/llm.py — added _is_minimax_model() and _resolve_model_config() helpers; updated make_call() to auto-route minimax/<model> to openai/<model> with MiniMax's API base URL and clamped temperature
  • llmgraph/library/consts.py — added minimax_api_base, minimax_default_model, and minimax_model_prefix constants
  • tests/test_llm_minimax.py — 22 tests (9 unit _is_minimax_model, 11 unit _resolve_model_config, 3 integration tests for make_call)
  • README.md — added MiniMax usage example

Usage

export MINIMAX_API_KEY=your_api_key_here
llmgraph machine-learning "https://en.wikipedia.org/wiki/Artificial_intelligence" \
  --levels 3 --llm-model minimax/MiniMax-M2.7

Supported models: MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed (all 204K context).

Provider-specific handling

Behaviour Detail
Base URL Auto-set to https://api.minimax.io/v1 when using minimax/ prefix
Auth Set MINIMAX_API_KEY env var; LiteLLM picks it up automatically
Temperature Clamped to (0.0, 1.0] — MiniMax rejects temperature=0
Model routing minimax/MiniMax-M2.7openai/MiniMax-M2.7 via LiteLLM OpenAI-compat path

Test results

22 passed in 8.29s

- Add _is_minimax_model() and _resolve_model_config() helpers in llm.py
- Auto-route minimax/<model> to openai/<model> via MiniMax's OpenAI-compat API
- Auto-set base_url to https://api.minimax.io/v1 when using minimax/ prefix
- Clamp temperature to (0.0, 1.0] as required by MiniMax API
- Add minimax_api_base, minimax_default_model constants in consts.py
- Add 22 unit + integration tests in tests/test_llm_minimax.py
- Document MiniMax usage with MINIMAX_API_KEY in README.md
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