Skip to content

okf: add MiniMax provider (MiniMax-M3, MiniMax-M2.7) to the reference agent - #249

Open
octo-patch wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
octo-patch:octo/20260729-provider-add-recvq9yGfJzNUC
Open

okf: add MiniMax provider (MiniMax-M3, MiniMax-M2.7) to the reference agent#249
octo-patch wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
octo-patch:octo/20260729-provider-add-recvq9yGfJzNUC

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: The reference agent had no MiniMax provider, so MiniMax-M3 / MiniMax-M2.7 and the global and China endpoints could not be selected.

What this adds

The reference agent threaded a single model string straight into
google.adk.Agent and the index synthesizer's google.genai client, so the
only reachable backend was the default Gemini one. This adds MiniMax as a second
provider without changing that default.

  • New reference_agent.providers module holding a small MiniMax registry:
    • Models: MiniMax-M3 (1,000,000-token context; text/image/video input;
      adaptive/disabled thinking) and MiniMax-M2.7 (204,800-token context;
      text input; always-on thinking), each with per-million-token pricing.
    • Two regional endpoints: global_en (https://api.minimax.io/v1) and
      cn_zh (https://api.minimaxi.com/v1), each with its chat and Anthropic
      base URLs and docs root. The region is chosen with KC_MINIMAX_REGION
      (default global_en).
  • build_model() returns a LiteLlm bound to the selected endpoint when the
    --model value names a MiniMax model, and returns the string unchanged
    otherwise — so a Gemini id keeps the existing behavior byte for byte.
  • agent.py (both the BQ and web agents) and the index synthesizer route
    through the resolver; a MiniMax model reads its key from MINIMAX_API_KEY.
  • --model help and the README credentials section document the new provider,
    the two models, the endpoint selection, and the API-key variable.

Heavy imports (google.adk LiteLlm, litellm) are lazy, only loaded when a
MiniMax model is actually used, so the default path takes on no new dependency.

Checks

  • python3 -m pytest -q tests/test_providers.py tests/test_index.py tests/test_bundle_tools.py tests/test_viewer.py tests/test_document.py — 44 passed. New tests/test_providers.py covers model detection, both model specs, both regional endpoints, region override/validation, and the pass-through of non-MiniMax names.
  • ruff check --select I,F,E on the changed source files — clean.

The remaining tests in this suite require optional runtime dependencies
(google-adk, google-cloud-bigquery, markdownify) that are not part of this
change and were not installable in the sandbox.

Route the reference agent's --model through a new providers module so a
MiniMax id (MiniMax-M3 / MiniMax-M2.7) runs on MiniMax via LiteLlm while a
Gemini id keeps the existing default path. Support the global and China
regional endpoints via KC_MINIMAX_REGION and read the key from
MINIMAX_API_KEY. Heavy imports stay lazy so the default path is unchanged.
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