Skip to content

Add MiniMax as first-class LLM provider#45

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

Add MiniMax as first-class LLM provider#45
octo-patch wants to merge 1 commit intodatadreamer-dev:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as a first-class LLM provider in DataDreamer, extending the existing OpenAI class to leverage MiniMax's OpenAI-compatible API endpoint (https://api.minimax.io/v1).

Key Changes

  • New MiniMax class (src/llms/minimax.py): Extends OpenAI with MiniMax-specific configurations
    • Temperature clamping to MiniMax's required (0.0, 1.0] range
    • Model-specific context lengths: 1M tokens for M2.7, 204K for M2.5
    • Model-specific max output lengths: 16K for M2.7, 8K for M2.5
    • MINIMAX_API_KEY environment variable auto-detection
  • Updated src/llms/__init__.py: Registered MiniMax in exports and __all__
  • 30 unit tests + 3 integration tests (tests/test_minimax.py): Module structure, constants, implementation logic, and live API tests
  • In-project test class (src/tests/llms/test_llms.py): TestMiniMax class following existing test patterns

Supported Models

Model Context Length Max Output
MiniMax-M2.7 1,000,000 16,384
MiniMax-M2.7-highspeed 1,000,000 16,384
MiniMax-M2.5 204,800 8,192
MiniMax-M2.5-highspeed 204,800 8,192

Usage

from datadreamer.llms import MiniMax

# Using environment variable MINIMAX_API_KEY
llm = MiniMax("MiniMax-M2.7")

# Or with explicit API key
llm = MiniMax("MiniMax-M2.7", api_key="your-key")

results = llm.run(
    ["Generate a creative story about AI."],
    max_new_tokens=500,
    temperature=0.7,
)

Test Plan

  • All 30 unit tests pass (module structure, constants, implementation logic, project test integration)
  • All 3 integration tests pass against live MiniMax API (M2.7, M2.7-highspeed, temperature edge case)
  • Verify compatibility with DataDreamer's caching and retry mechanisms
  • Verify DataDreamer session workflow (with DataDreamer(...))

Add MiniMax as a new LLM provider that extends the existing OpenAI class,
leveraging MiniMax's OpenAI-compatible API endpoint. This enables users to
use MiniMax's M2.7 and M2.5 model families for prompting and synthetic data
generation workflows.

Key changes:
- New MiniMax class in src/llms/minimax.py extending OpenAI
- Temperature clamping to MiniMax's (0.0, 1.0] range
- Model-specific context lengths (1M for M2.7, 204K for M2.5)
- Model-specific max output lengths (16K for M2.7, 8K for M2.5)
- MINIMAX_API_KEY environment variable support
- 30 unit tests + 3 integration tests in tests/test_minimax.py
- In-project test class in src/tests/llms/test_llms.py
- Registered in src/llms/__init__.py exports

Supported models:
- MiniMax-M2.7 (1M context)
- MiniMax-M2.7-highspeed (1M context)
- MiniMax-M2.5 (204K context)
- MiniMax-M2.5-highspeed (204K context)
@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


PR Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

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