Skip to content

feat: add MiniMax as alternative LLM provider#20

Open
octo-patch wants to merge 1 commit intoSkywalkerDarren:masterfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as alternative LLM provider#20
octo-patch wants to merge 1 commit intoSkywalkerDarren:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax M2.7 and M2.7-highspeed as alternative chat model providers via their OpenAI-compatible API.

Changes

  • config.py: Add MiniMax-M2.7 (1M context) and MiniMax-M2.7-highspeed to SUPPORTED_GPT_MODELS; add open_ai_base_url config field; temperature clamping for MiniMax (must be > 0); is_minimax_model() helper
  • ai.py: Pass base_url to OpenAI() client constructor; tiktoken fallback to cl100k_base for non-OpenAI models; fix streaming ChoiceDelta attribute access
  • config.example.json: Add open_ai_base_url field
  • readme.md / readme.zh.md: Add MiniMax configuration documentation (EN + ZH)
  • tests/test_minimax.py: 20 unit tests + 3 integration tests

Usage

{
  "open_ai_key": "your-minimax-api-key",
  "open_ai_base_url": "https://api.minimax.io/v1",
  "open_ai_chat_model": "MiniMax-M2.7"
}

Embeddings still use OpenAI embedding API. MiniMax is chat-only.

Test plan

  • 20 unit tests pass (model definitions, config parsing, base_url, temp clamping, tiktoken fallback)
  • 3 integration tests pass (mock + live MiniMax API calls, streaming)
  • Existing OpenAI models still work

Add MiniMax M2.7 and M2.7-highspeed models as chat providers via
OpenAI-compatible API. Users can point to MiniMax by setting
open_ai_base_url in config.json.

Changes:
- config.py: add MiniMax models to SUPPORTED_GPT_MODELS, add
  open_ai_base_url config, temperature clamping for MiniMax (>0)
- ai.py: pass base_url to OpenAI client, tiktoken fallback for
  non-OpenAI models, fix streaming delta attribute access
- config.example.json: add open_ai_base_url field
- readme.md/readme.zh.md: add MiniMax usage documentation
- tests/test_minimax.py: 20 unit + 3 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