Skip to content

Add MiniMax as alternative LLM provider (default model: M3) - #20

Open
octo-patch wants to merge 2 commits into
bragai:mainfrom
octo-patch:feature/add-minimax-provider
Open

Add MiniMax as alternative LLM provider (default model: M3)#20
octo-patch wants to merge 2 commits into
bragai:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

@octo-patch octo-patch commented Mar 22, 2026

Copy link
Copy Markdown

Summary

  • Add multi-provider LLM factory (utils/llm_provider.py) supporting OpenAI (default) and MiniMax via LLM_PROVIDER env var
  • Default MiniMax chat model is MiniMax-M3 (512K context, 128K max output, image input)
  • Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed available as overrides
  • Add MiniMaxEmbeddings class for MiniMax embo-01 (1536 dims) native API integration
  • Add bonus notebook [6]_rag_with_minimax.ipynb demonstrating full RAG pipeline with MiniMax M3 + embo-01
  • Update .env.example with MiniMax configuration options
  • Update README.md with provider comparison table and quick-start guide

Key Features

  • Zero code changes: Switch providers by setting LLM_PROVIDER=minimax in .env
  • Latest model default: New requests default to MiniMax-M3 — the most recent MiniMax release
  • Temperature clamping: Automatically clamps temperature to MiniMax-accepted [0, 1] range
  • Native embedding support: MiniMaxEmbeddings wraps the proprietary embo-01 API (uses texts/type fields, not OpenAI-compatible)
  • Drop-in replacement: get_chat_model() returns a standard LangChain ChatOpenAI instance that works with all existing chains

Models

Model Notes
MiniMax-M3 (default) 512K context window, 128K max output, image input supported
MiniMax-M2.7 Previous-generation model
MiniMax-M2.7-highspeed Previous-generation low-latency variant

Test Plan

  • 44 unit tests covering provider resolution, temperature clamping, factory methods, embedding API calls
  • 6 integration tests (3 chat + 3 embedding) with real MiniMax API
  • All unit tests pass locally
  • Chat integration tests pass with live API
  • Embedding integration tests pass (subject to rate limits)

PR Bot and others added 2 commits March 22, 2026 19:07
- Add utils/llm_provider.py: multi-provider factory for ChatOpenAI with
  OpenAI (default) and MiniMax support via LLM_PROVIDER env var
- Add utils/minimax_embeddings.py: LangChain Embeddings wrapper for
  MiniMax embo-01 (1536 dims) with native API format
- Add notebooks/[6]_rag_with_minimax.ipynb: complete RAG walkthrough
  using MiniMax M2.7 for chat and embo-01 for embeddings
- Update .env.example with MiniMax configuration
- Update README.md with multi-provider docs and comparison table
- Add 44 unit tests and 6 integration tests

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
- Set MiniMax-M3 as the default chat model in PROVIDER_DEFAULTS
- Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed as override options
- Update README provider table to list M3/M2.7/M2.7-highspeed and 512K context
- Update notebook [6]_rag_with_minimax.ipynb to use M3 in the RAG chain example
- Update unit tests to assert M3 is the default
@octo-patch octo-patch changed the title Add MiniMax as alternative LLM provider Add MiniMax as alternative LLM provider (default model: M3) Jun 7, 2026
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