Skip to content

feat(model_apis): add MiniMax Cloud API as text generation provider#339

Open
octo-patch wants to merge 1 commit intostochasticai:mainfrom
octo-patch:feature/add-minimax-cloud-api
Open

feat(model_apis): add MiniMax Cloud API as text generation provider#339
octo-patch wants to merge 1 commit intostochasticai:mainfrom
octo-patch:feature/add-minimax-cloud-api

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as the 4th cloud text-generation API provider (alongside OpenAI, Cohere, and Claude).

xTuring already has excellent MiniMax M2 local fine-tuning support (PR #307) — this PR complements it by adding cloud API access to MiniMax latest models (M2.7 / M2.7-highspeed) for self-instruct data generation and text generation workflows.

Changes

File Description
src/xturing/model_apis/minimax.py MiniMaxTextGenerationAPI — OpenAI-compat client at api.minimax.io/v1, temperature clamping, retry with exponential backoff. Convenience classes MiniMaxM27 and MiniMaxM27HighSpeed.
src/xturing/model_apis/init.py Register minimax, minimax_m2_7, minimax_m2_7_highspeed in BaseApi registry
tests/xturing/model_apis/test_minimax_api.py 18 unit tests + 3 integration tests (skip when MINIMAX_API_KEY not set)
README.md Cloud API table with all 4 providers, usage example, roadmap update

Usage

from xturing.model_apis import MiniMaxM27

api = MiniMaxM27(api_key="your-minimax-api-key")
results = api.generate_text(
    prompts=["Explain quantum computing for beginners."],
    max_tokens=256,
    temperature=0.7,
)
print(results[0]["response"]["choices"][0]["text"])

Test plan

  • 18 unit tests pass
  • 3 integration tests pass with live MINIMAX_API_KEY
  • Existing Claude API tests still pass (pre-existing failures unrelated)
  • No new dependencies — reuses existing openai SDK

Add MiniMax as a 4th cloud text-generation API alongside OpenAI, Cohere,
and Claude. Uses the OpenAI-compatible endpoint at api.minimax.io/v1,
with temperature clamping (MiniMax requires >0), retry logic, and
convenience wrappers for MiniMax-M2.7 and MiniMax-M2.7-highspeed.

- src/xturing/model_apis/minimax.py: MiniMaxTextGenerationAPI + presets
- src/xturing/model_apis/__init__.py: register minimax/m2_7/m2_7_highspeed
- tests/xturing/model_apis/test_minimax_api.py: 18 unit + 3 integration tests
- README.md: Cloud API table and usage example
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