Skip to content

Add MiniMax as first-class LLM provider (M2.7 + M2.7-highspeed, MINIMAX_API_KEY auto-detection, temp clamping)#42

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

Add MiniMax as first-class LLM provider (M2.7 + M2.7-highspeed, MINIMAX_API_KEY auto-detection, temp clamping)#42
octo-patch wants to merge 1 commit into
aibox22:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

This PR adds MiniMax as a first-class LLM provider for readmex.

Changes

src/readmex/config.py

  • Added MINIMAX_API_KEY environment variable support: when set (and LLM_API_KEY is not set), it automatically configures the LLM provider with MiniMax defaults:
    • Base URL: https://api.minimax.io/v1
    • Model: MiniMax-M2.7
    • Individual settings (LLM_BASE_URL, LLM_MODEL_NAME) still take precedence

src/readmex/utils/model_client.py

  • Added _is_minimax(base_url) — detects minimax.io / minimax.chat endpoints
  • Added _get_effective_temperature() — clamps temperature to > 0.0 for MiniMax (the API rejects temperature=0)
  • Added llm_is_minimax to get_current_settings() return dict

README.md / README_CN.md

  • New "Using MiniMax as the LLM Provider" section under Configuration with env-var and config-file examples, plus a model table

tests/test_minimax_provider.py (19 tests, all passing)

  • 6 config auto-detection unit tests
  • 7 provider detection & temperature-clamping unit tests
  • 6 integration tests with mocked HTTP

Quick start

export MINIMAX_API_KEY="<your key>"
export T2I_API_KEY="<your t2i key>"  # e.g. OpenAI for logo generation
readmex /path/to/your/project

Available MiniMax models

Model Context Notes
MiniMax-M2.7 204K Recommended
MiniMax-M2.7-highspeed 204K Faster, lower cost
MiniMax-M2.5 204K Previous generation
MiniMax-M2.5-highspeed 204K Previous generation, fast

- config.py: MINIMAX_API_KEY auto-detection sets llm_api_key,
  base_url (https://api.minimax.io/v1), and default model
  (MiniMax-M2.7) when no explicit LLM_API_KEY is present
- model_client.py: _is_minimax() URL detector; _get_effective_temperature()
  clamps temperature to 0.01 for MiniMax when set to 0; exposes
  llm_is_minimax flag in get_current_settings()
- README.md / README_CN.md: MiniMax configuration section with
  env-var and config-file examples, model table
- tests/test_minimax_provider.py: 19 unit + integration tests
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