feat(model_apis): add MiniMax Cloud API as text generation provider - #339
feat(model_apis): add MiniMax Cloud API as text generation provider#339octo-patch wants to merge 2 commits into
Conversation
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
`OpenAI` is only exported by openai>=1.0.0. On a 0.x install -- which pyproject still permits via `openai >= 0.27.0` -- the package imports fine but the symbol is missing, raising ImportError. ModuleNotFoundError does not catch that, so the guard was bypassed and `import xturing.model_apis` failed outright. Verified against a simulated 0.x layout: the module now imports and construction raises the intended actionable error.
|
Pushed a one-line fix to this branch (thanks for enabling maintainer edits).
Verified against a simulated 0.x layout: the module now imports and construction raises the intended actionable error. The overall shape of the PR is good — the deferred-dependency pattern matches Three things left for you, none blocking:
Heads-up on ordering: this conflicts with #318 on |
Review findingsThanks for this — the structure is genuinely good. A few things need resolving before this can merge. Blocking1. Could you confirm the model IDs against a live endpoint? The PR ships I'm flagging this rather than asserting it's wrong — you may have access to models I can't see. But because every unit test is mock-based, CI would pass identically with non-existent IDs, so nothing here can catch it. A transcript from a real call with 2. openai 0.x vs 1.x conflict, currently undeclared. Either bump/declare the dependency, or drop the SDK and call the endpoint with 3. Note that no workflow has ever run on this branch — as an outside contributor's PR it needs a maintainer to approve the run, so Worth addressing
TestsThey pass locally, but they will never run in CI as things stand. The SecurityClean. No hardcoded credentials (test keys are literal |
|
Correction to my earlier comment. I said no workflow had ever run on this branch — that was wrong.
So no maintainer approval is needed, and my point 3 is confirmed by CI rather than just predicted: the pre-commit job failed. A local One thing that's changed since: #343 has now merged, adding a |
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
Usage
Test plan