Skip to content

feat: add MiniMax as LLM provider (llm-chain-minimax crate)#306

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

feat: add MiniMax as LLM provider (llm-chain-minimax crate)#306
octo-patch wants to merge 1 commit into
sobelio:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds a new llm-chain-minimax crate that integrates MiniMax LLM models via their OpenAI-compatible API, following the same architecture pattern as llm-chain-openai.

What's included

  • New crate llm-chain-minimax — Full Executor trait implementation using async-openai with MiniMax's API endpoint (https://api.minimax.io/v1)
  • Model support — MiniMax-M2.7, M2.7-highspeed, M2.5, M2.5-highspeed with context window metadata (up to 1M tokens)
  • Think-tag stripping — Automatically strips <think>...</think> reasoning tags from M2.5+ model responses
  • executor!(minimax) macro — Integrated into the existing executor macro system
  • Environment-based configMINIMAX_API_KEY and optional MINIMAX_API_BASE_URL
  • 16 unit tests + 3 integration tests — Covering model parsing, tokenization, context sizes, and live API calls
  • README updates — Added MiniMax to the features list and getting started guide

Supported models

Model Context Window
MiniMax-M2.7 1M tokens
MiniMax-M2.7-highspeed 1M tokens
MiniMax-M2.5 1M tokens
MiniMax-M2.5-highspeed 204K tokens

Files changed (12 files, 934 additions)

  • crates/llm-chain-minimax/ — New crate (Cargo.toml, README, src/, tests/, examples/)
  • crates/llm-chain/src/executor.rs — Added minimax variant to executor! macro
  • docs/README.md — Added MiniMax to features and getting started sections

Test plan

  • All 16 unit tests pass (cargo test -p llm-chain-minimax)
  • All 3 integration tests pass with live MiniMax API (--ignored flag)
  • Doc-tests pass
  • Crate builds without errors
  • Verify existing llm-chain-openai tests still pass (no modifications to existing crate logic)

Add a new llm-chain-minimax crate that integrates MiniMax LLM models
(M2.7, M2.7-highspeed, M2.5, M2.5-highspeed) via their OpenAI-compatible API.

- Implements the Executor trait using async-openai with MiniMax API endpoint
- Adds Model enum with context size metadata (up to 1M tokens for M2.7)
- Strips think tags from model responses (M2.5+ thinking support)
- Adds executor!(minimax) macro support
- Includes 16 unit tests and 3 integration tests
- Updates README with MiniMax documentation
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