Skip to content

Add MiniMax as alternative LLM provider#27

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

Add MiniMax as alternative LLM provider#27
octo-patch wants to merge 1 commit into
cocacola-lab:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax as an alternative LLM provider alongside OpenAI, configurable via environment variables.

Changes

  • New llm_provider.py — provider abstraction module with auto-detection (MINIMAX_API_KEY to MiniMax), temperature clamping (MiniMax requires (0, 1]), <think> tag stripping for reasoning models, and openai v0.x / v1.x SDK compatibility
  • Updated access.py — replaced hardcoded openai.ChatCompletion.create() + key cycling with the provider module; legacy tokens.txt key rotation preserved as fallback
  • README — added LLM Provider Configuration section with MiniMax setup instructions and available models
  • 35 tests — 31 unit tests (test_llm_provider.py) + 4 integration tests (test_integration_minimax.py), all passing

Configuration

# Use MiniMax (auto-detected if MINIMAX_API_KEY is set)
export MINIMAX_API_KEY=your-key

# Or explicit
export LLM_PROVIDER=minimax
export LLM_MODEL=MiniMax-M2.7  # default, 204K context

Available MiniMax models: MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed

Files changed (5 files, 670 additions)

File Change
tools/back-end/llm_provider.py New provider abstraction module
tools/back-end/access.py Use provider module instead of hardcoded OpenAI
tools/tests/test_llm_provider.py 31 unit tests
tools/tests/test_integration_minimax.py 4 integration tests
README.md Provider config docs

Test plan

  • All 35 tests pass
  • Existing OpenAI flow unchanged (default provider)
  • MiniMax provider resolves correct API base, model, and key
  • Temperature clamping prevents invalid values for MiniMax
  • Think-tag stripping works for MiniMax reasoning models
  • Legacy tokens.txt key rotation still works
  • Live MiniMax API integration test passes

Add multi-provider support to ChatIE via environment variables, enabling
MiniMax M2.7/M2.7-highspeed as an alternative to OpenAI GPT models.

Changes:
- New llm_provider.py module with provider abstraction (auto-detection,
  temperature clamping, think-tag stripping, openai v0.x/v1.x compat)
- Updated access.py to use provider module instead of hardcoded OpenAI
- README: LLM provider configuration docs with MiniMax setup instructions
- 31 unit tests + 4 integration tests (35 total, all passing)
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