Skip to content

feat: add MiniMax as LLM provider for financial evaluation#92

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

feat: add MiniMax as LLM provider for financial evaluation#92
octo-patch wants to merge 1 commit intoThe-FinAI:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as an alternative commercial LLM provider for financial benchmark evaluation alongside OpenAI.

MiniMax offers large language models (M2.7, M2.5) with 204K context windows via an OpenAI-compatible chat completions API, making it a drop-in option for evaluating financial tasks.

Changes

  • Refactored ChatLM to support configurable API_BASE_URL and API_KEY_ENV class attributes (backward-compatible, defaults to OpenAI)
  • Added MiniMaxLM subclass (src/minimax_lm.py) with:
    • Temperature clamping to (0.0, 1.0] as required by MiniMax API
    • 204K context window support for all models
    • Automatic routing via MINIMAX_API_KEY environment variable
  • Updated evaluator.py to auto-detect MiniMax model names and route to MiniMaxLM
  • Added MiniMaxModel for FActScore evaluation (src/factscore_package/minimax_lm.py)
  • Extended OpenAIModel with optional api_base parameter for custom endpoints
  • Updated README with MiniMax usage instructions under Commercial APIs section
  • Added 33 tests (30 unit + 3 integration) covering config, routing, temperature clamping, and live API calls

Usage

export MINIMAX_API_KEY=YOUR_KEY_HERE
python eval.py     --model MiniMax-M2.7     --tasks flare_ner,flare_sm_acl,flare_fpb

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

Test Plan

  • 30 unit tests pass (mocked dependencies)
  • 3 integration tests pass with live MiniMax API
  • Existing OpenAI functionality unchanged (backward-compatible refactor)
  • Run full evaluation suite with MiniMax model on a financial task

Add MiniMax (M2.7, M2.7-highspeed, M2.5, M2.5-highspeed) as an
alternative commercial LLM provider alongside OpenAI for financial
benchmark evaluation. MiniMax offers 204K context windows via an
OpenAI-compatible API.

Changes:
- Refactor ChatLM to support configurable API base URL and key env var
- Add MiniMaxLM subclass with temperature clamping (0,1]
- Update evaluator routing to auto-detect MiniMax model names
- Add MiniMaxModel for FActScore evaluation
- Add api_base parameter to OpenAIModel for custom endpoints
- Add 30 unit tests + 3 integration tests
- Update README with MiniMax usage instructions

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
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