Skip to content

Add MiniMax tokenizer calibration support - #265

Open
octo-patch wants to merge 1 commit into
cortexkit:masterfrom
octo-patch:octo/20260801-provider-add-recvqmIPMcqhey
Open

Add MiniMax tokenizer calibration support#265
octo-patch wants to merge 1 commit into
cortexkit:masterfrom
octo-patch:octo/20260801-provider-add-recvqmIPMcqhey

Conversation

@octo-patch

@octo-patch octo-patch commented Aug 1, 2026

Copy link
Copy Markdown

Reason: Add first-party MiniMax tokenizer calibration support for the current text models and both regional OpenAI-compatible endpoints.

Changes:

  • Route minimax and minimax-cn calibration requests to their respective chat-completions endpoints.
  • Catalog MiniMax-M3 and MiniMax-M2.7 for both regional routes.
  • Test endpoint selection and the existing prompt/tool token delta parsing.

Checks:

  • bun test packages/plugin/scripts/calibrate-tokenizer/providers/openai-compatible.test.ts
  • bun run --cwd packages/plugin typecheck
  • git diff --check
  • jq -e '.tests | length > 0' packages/plugin/scripts/calibrate-tokenizer/models.json
  • bun run --cwd packages/plugin lint (currently fails on unrelated existing diagnostics and the checked-in Biome schema version mismatch)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Add MiniMax tokenizer calibration for MiniMax-M3 and MiniMax-M2.7 across global and China OpenAI‑compatible endpoints. This enables measuring system and tool token deltas for MiniMax via chat completions.

Written for commit c4ffff6. Summary will update on new commits.

Review in cubic

Greptile Summary

Adds tokenizer-calibration coverage for MiniMax’s current text models across its global and China OpenAI-compatible endpoints.

  • Adds MiniMax-M3 and MiniMax-M2.7 catalog entries for both regional provider identifiers.
  • Routes each provider identifier to its corresponding chat-completions endpoint.
  • Tests regional endpoint selection, catalog coverage, and the existing baseline-relative prompt and tool token calculations.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security failures identified.

The added provider identifiers route to distinct supported endpoints, the catalog entries follow existing runner contracts, and the tests exercise both regional routes and token-delta calculations.

Important Files Changed

Filename Overview
packages/plugin/scripts/calibrate-tokenizer/models.json Adds distinct global and China calibration entries for MiniMax-M3 and MiniMax-M2.7 using the runner’s documented null-tokenizer fallback.
packages/plugin/scripts/calibrate-tokenizer/providers/openai-compatible.ts Adds explicit MiniMax regional endpoint mappings using the existing OpenAI-compatible authentication, payload, and usage-parsing path.
packages/plugin/scripts/calibrate-tokenizer/providers/openai-compatible.test.ts Verifies model catalog coverage, regional endpoint routing, and the existing baseline-relative prompt and tool token calculations.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C[MiniMax calibration catalog entry] --> P{Provider}
  P -->|minimax| G[api.minimax.io]
  P -->|minimax-cn| CN[api.minimaxi.com]
  G --> R[OpenAI-compatible chat completions]
  CN --> R
  R --> U[Read usage.prompt_tokens]
  U --> D[Calculate system and tool deltas]
Loading

Reviews (1): Last reviewed commit: "feat(calibration): add MiniMax provider ..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

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