Add direct MiniMax provider models - #97
Conversation
|
I added a separate |
|
Thanks for the review. I merged the latest main branch, preserved the MiniMax provider configuration while adopting the updated optional GitHub token manifest behavior, and pushed a new commit. I ran the focused MiniMax pytest suite (6 passed), Ruff, YAML and JSON parsing, and git diff checks. |
…get-provider-model-to-existing-provider-registry-recvoNoXySJNSL # Conflicts: # agentfield-package.yaml
|
Updated this PR with the latest main branch and resolved the manifest conflict while preserving the MiniMax provider configuration. I ran direct MiniMax config assertions, JSON parsing, YAML parsing, and git diff whitespace checks; pytest could not run in this runner because the project requires Python >=3.12 and the environment only has Python 3.10 without the agentfield package. |
AbirAbbas
left a comment
There was a problem hiding this comment.
This is close — the endpoints are MiniMax's first-party domains (api.minimax.io / api.minimaxi.com, with the documented Anthropic-compatible route), the branch sits exactly on top of current main, and nothing touches runtime-resolution code. Five things before it can land:
- CI-blocking:
tests/test_dockerfile.py::test_dockerfile_preserves_opencode_installfails on this branch — its"OPENROUTER_API_KEY" in dockerfile_contentassertion pointed at the inlineRUN echoJSON this PR (correctly) removes. Retarget it at the new layout: assert theCOPY opencode.json /root/.config/opencode/opencode.jsonline in both Dockerfiles and assertOPENROUTER_API_KEYappears inopencode.json. Full-suite result on this branch as-is: 1 failed, 1148 passed. (I know your runner is stuck on Python 3.10 — happy to re-run the full suite on our side after you push.) - MiniMax-M3 cost metadata is the long-context tier, not the standard rate:
0.6 / 2.4 / 0.12should be0.3 / 1.2 / 0.06(the ≤512K-input tier that applies to normal requests), in all three provider blocks. Cost reports would otherwise run 2×. Worth adding the 512K threshold note to the docs — the PR body promises a tiered schedule that isn't in the diff yet. - MiniMax-M2.7
limit.outputis set to204800(the context size); MiniMax documents max output196608. - The
require_one_ofadditions change the install contract:MINIMAX_API_KEYalone satisfies the wizard, but_default_runtime()never inspects it, so a MiniMax-only install resolves toclaude_codewith no credential and every build fails. Same shape forANTHROPIC_AUTH_TOKENalone (planning falls through tosonnetagainstapi.anthropic.com→ 401, sinceANTHROPIC_BASE_URLis only optional). Either document the mandatory companion vars (SWE_DEFAULT_RUNTIME,SWE_DEFAULT_MODEL,ANTHROPIC_BASE_URL) next to those options, or move them tooptional. Also worth a doc line: setting the globalANTHROPIC_BASE_URLredirects Claude Code and the built-in anthropic provider container-wide, so real Claude and MiniMax-anthropic can't be mixed in one deployment. - README nit: "The OpenCode adapter derives
/v1internally" — it doesn't; the config'sbaseURLappends/v1explicitly. The instruction is right, the explanation isn't.
|
Thanks for the review. I updated the Dockerfile assertions, MiniMax-M2.7 output limits, credential classification, and endpoint documentation, then pushed a new commit. I ran the Dockerfile test suite (6 passed). |
MiniMax prices M3 tiered by input length: the $0.60/$2.40/$0.12 figures are the >512K-input tier; normal requests bill at the $0.30/$1.20/$0.06 standard tier. The opencode cost blocks feed SWE-AF's cost accounting via OpenCode's per-step numbers, so the long-context figures would over-meter M3 spend ~2x. Also cap output at MiniMax's documented 512,000 max (524288 was a binary misread of 512K; context correctly uses decimal 1,000,000). README documents the tier split. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Warn that ANTHROPIC_API_KEY / CLAUDE_CODE_OAUTH_TOKEN must be unset when ANTHROPIC_BASE_URL points at MiniMax, so a real Anthropic credential is never sent to a third-party endpoint. - SWE_DEFAULT_RUNTIME default is auto-selected (open_code when only OPENROUTER_API_KEY is set), not a flat claude_code. - The MiniMax open_code recipe needs HARNESS_MODEL too: opencode's small_model interpolates HARNESS_MODEL, so without it small-model calls fall through to the baked OpenRouter default and require OPENROUTER_API_KEY. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reason: add target provider/model to existing provider registry
Add direct MiniMax model entries for the global and China OpenAI-compatible endpoints and a separate region-selectable Anthropic-compatible OpenCode provider. The registry exposes MiniMax-M3 and MiniMax-M2.7 with their supported modalities, reasoning capability, context limits, output limits, and pricing metadata. Deployment documentation also covers the Anthropic-compatible Claude runtime and the complete tiered pricing schedule. Existing defaults remain unchanged.
Validation:
AGENTFIELD_SERVER=http://localhost:9999 python -m pytest -q tests/test_minimax_provider_config.pyruff check tests/test_minimax_provider_config.pypython -m compileall -q swe_afjq empty opencode.jsongit diff --check