Skip to content

Add multi-provider LLM support with MiniMax integration#78

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

Add multi-provider LLM support with MiniMax integration#78
octo-patch wants to merge 1 commit into
emarco177:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

  • Add a reusable utils/llm_provider.py factory that lets students switch between OpenAI, MiniMax, Anthropic, Google, and Ollama via LLM_PROVIDER env var
  • Auto-detects provider from available API keys (MINIMAX_API_KEY, OPENAI_API_KEY, etc.)
  • MiniMax-specific temperature clamping (0 → 0.01) and OpenAI-compatible API routing
  • Example scripts: examples/minimax_hello_world.py and examples/multi_provider_example.py
  • Updated README to mention MiniMax and document multi-provider usage

Why

The course currently hardcodes ChatOpenAI in all branches. This utility lets students experiment with different LLM providers — including MiniMax (M2.7, M2.5, M2.5-highspeed) — by dropping utils/llm_provider.py into any project branch and changing one env var.

Files changed (9 files, ~523 additions)

File Description
utils/llm_provider.py Provider factory with get_chat_model()
examples/minimax_hello_world.py Standalone MiniMax usage example
examples/multi_provider_example.py Multi-provider switching demo
tests/test_llm_provider.py 30 unit tests
tests/test_integration_minimax.py 3 integration tests (live API)
README.md MiniMax in providers list + usage docs
.gitignore Ignore *.pyc files

Test plan

  • 30 unit tests pass (provider detection, temperature clamping, factory, error handling)
  • 3 integration tests pass against live MiniMax API
  • Verify examples run end-to-end with a MiniMax API key
  • Test with other providers (OpenAI, Ollama)

Usage

export LLM_PROVIDER=minimax
export MINIMAX_API_KEY=your-key-here
python examples/minimax_hello_world.py

Add a reusable LLM provider factory (utils/llm_provider.py) that lets
students switch between OpenAI, MiniMax, Anthropic, Google, and Ollama
via a single environment variable.  Includes auto-detection from API
keys, MiniMax-specific temperature clamping, and example scripts.

- utils/llm_provider.py: provider factory with get_chat_model()
- examples/minimax_hello_world.py: standalone MiniMax example
- examples/multi_provider_example.py: multi-provider demo
- tests/test_llm_provider.py: 30 unit tests
- tests/test_integration_minimax.py: 3 integration tests
- README.md: mention MiniMax + provider usage instructions
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