Skip to content

feat: add MiniMax as alternative LLM provider#10

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

feat: add MiniMax as alternative LLM provider#10
octo-patch wants to merge 1 commit into
curiousily:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

  • Add utils/llm_provider.py multi-provider utility supporting OpenAI and MiniMax (M2.5 / M2.5-highspeed) via OpenAI-compatible API
  • Add tutorial notebook 20.multi-provider-llm-with-minimax.ipynb demonstrating chat, prompt templates, chains, streaming, and side-by-side provider comparison
  • Update README with provider documentation and usage examples

What is MiniMax?

MiniMax provides large language models with up to 204K context window. Their API is OpenAI-compatible, making integration straightforward via LangChain's ChatOpenAI.

How it works

Set LLM_PROVIDER=minimax and MINIMAX_API_KEY environment variables to use MiniMax across all notebooks:

from utils.llm_provider import get_chat_model
chat = get_chat_model(provider="minimax", temperature=0)

The utility handles:

  • Provider-specific API base URL and model defaults
  • Temperature clamping for MiniMax (0.0–1.0)
  • Automatic fallback to chat endpoint for providers without completion API

Test plan

  • 25 unit tests covering provider resolution, temperature clamping, factory functions
  • 3 integration tests with live MiniMax API (chat, system messages, streaming)
  • All tests passing

Files changed (7 files, 753 additions)

File Description
utils/__init__.py Package init
utils/llm_provider.py Multi-provider factory (get_chat_model, get_llm, get_embeddings)
20.multi-provider-llm-with-minimax.ipynb Tutorial notebook
README.md Provider docs + notebook link
tests/__init__.py Test package init
tests/test_llm_provider.py 25 unit tests
tests/test_integration.py 3 integration tests

Add multi-provider LLM support with utils/llm_provider.py that enables
switching between OpenAI and MiniMax (M2.5/M2.5-highspeed) via the
LLM_PROVIDER env var. Includes tutorial notebook, README docs, and
25 unit + 3 integration tests.
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