Skip to content

feat: add MiniMax provider support to benchmark tools#777

Open
octo-patch wants to merge 1 commit intoMemPalace:developfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax provider support to benchmark tools#777
octo-patch wants to merge 1 commit intoMemPalace:developfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax LLM provider support to the benchmark evaluation tools (locomo_bench.py and longmemeval_bench.py), enabling researchers to benchmark MemPalace memory retrieval using MiniMax models as the LLM scorer instead of being locked in to Anthropic.

Changes

  • benchmarks/locomo_bench.py: Added _llm_base_url() helper that routes MiniMax-* model names to MiniMax's Anthropic-compatible endpoint (https://api.minimax.io/anthropic) and Claude models to https://api.anthropic.com. Updated _llm_call(), llm_rerank_locomo(), and _load_api_key() to use the correct endpoint and API key.

  • benchmarks/longmemeval_bench.py: Same changes applied to diary_ingest_session(), llm_rerank(), and _load_api_key().

  • tests/test_benchmark_minimax.py: 16 unit tests covering URL routing and API key selection for both benchmark files.

Supported Models

Model Type
MiniMax-M2.7 Default — Peak Performance
MiniMax-M2.7-highspeed Faster variant

MiniMax uses an Anthropic-compatible API, so the same request format and x-api-key header are used — only the base URL changes.

Usage

# LoCoMo benchmark with MiniMax reranker
MINIMAX_API_KEY=<key> python benchmarks/locomo_bench.py data.json \
  --mode hybrid --llm-rerank --llm-model MiniMax-M2.7

# LongMemEval diary mode with MiniMax
MINIMAX_API_KEY=<key> python benchmarks/longmemeval_bench.py data.json \
  --mode diary --llm-model MiniMax-M2.7

# Domestic (China) endpoint override
MINIMAX_BASE_URL=https://api.minimaxi.com/anthropic ...

API Reference

- Add _llm_base_url() helper that routes MiniMax models to
  https://api.minimax.io/anthropic (Anthropic-compatible endpoint)
  and Claude models to https://api.anthropic.com
- Update _llm_call() and llm_rerank_locomo() in locomo_bench.py to
  use the correct endpoint based on model name
- Update diary_ingest_session() and llm_rerank() in longmemeval_bench.py
  with the same routing logic
- Update _load_api_key() in both files to check MINIMAX_API_KEY env var
  when a MiniMax model is specified, falling back to ANTHROPIC_API_KEY
- Support MINIMAX_BASE_URL env var to override the default MiniMax endpoint
  (useful for domestic users: https://api.minimaxi.com/anthropic)
- Supported models: MiniMax-M2.7, MiniMax-M2.7-highspeed
- Add 16 unit tests covering URL routing and API key selection logic

Usage:
  python benchmarks/locomo_bench.py data.json --mode hybrid --llm-rerank \
    --llm-model MiniMax-M2.7
  MINIMAX_API_KEY=<key> python benchmarks/longmemeval_bench.py data.json \
    --mode diary --llm-model MiniMax-M2.7
@igorls igorls added the enhancement New feature or request label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants