Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Add MiniMax M2.7/M2.5 as LLM provider with temperature clamping#82

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

Add MiniMax M2.7/M2.5 as LLM provider with temperature clamping#82
octo-patch wants to merge 1 commit into
Haste171:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

  • Adds MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, and MiniMax-M2.5-highspeed to the llm_map in BaseHandler via the OpenAI-compatible API at https://api.minimax.io/v1
  • Clamps temperature to (0.01, 1.0] for MiniMax (API constraint), while leaving OpenAI/Anthropic models unaffected
  • Exposes all four models in /chat endpoint available_models list and the Streamlit UI selectbox
  • Adds MINIMAX_API_KEY env var to example.env and documents supported providers in README
  • Ships 22 passing tests (13 unit + 9 integration)

Test plan

  • python -m pytest tests/ -v — 22 passed, 0 failed
  • All existing OpenAI/Anthropic models still present in llm_map
  • Temperature clamping verified: input 0.0 → 0.01, input 1.5 → 1.0
  • MINIMAX_API_KEY env var picked up correctly

Usage

Add MINIMAX_API_KEY=<your-key> to .env, then select any MiniMax-* model from the chat UI or POST to /chat with "model": "MiniMax-M2.7".

- handlers/base.py: register MiniMax-M2.7, MiniMax-M2.7-highspeed,
  MiniMax-M2.5, MiniMax-M2.5-highspeed in llm_map via ChatOpenAI with
  base_url=https://api.minimax.io/v1; clamp temperature to (0.01, 1.0]
- endpoints/chat.py: add all four MiniMax models to available_models
- ui/main.py: add MiniMax models to Streamlit selectbox
- example.env: add MINIMAX_API_KEY placeholder
- README.md: add supported providers table with MiniMax entry
- tests/: 13 unit + 9 integration tests (22 total, all passing)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant