Skip to content

feat(image_gen): add MiniMax provider plugin - #47660

Closed
Vality wants to merge 1 commit into
NousResearch:mainfrom
Vality:feat/minimax-image-gen
Closed

feat(image_gen): add MiniMax provider plugin#47660
Vality wants to merge 1 commit into
NousResearch:mainfrom
Vality:feat/minimax-image-gen

Conversation

@Vality

@Vality Vality commented Jun 17, 2026

Copy link
Copy Markdown

What does this PR do?

Adds MiniMaxImageGenProvider — a first-class image_gen plugin for the MiniMax image generation API at https://api.minimax.io/v1/image_generation. The MiniMax image backend is currently a special case in the image_generate tool, hardcoded alongside the OpenAI-shaped path. This PR moves it onto the same PluginContext.register_image_gen_provider path that the other 5 backends (fal, krea, openai, openai-codex, xai) already use, so it benefits from the same picker UX, setup wizard, and error-response contract.

Why a separate plugin: MiniMax's image API is not OpenAI-compatible — POST /v1/images/generations returns 404. The native /v1/image_generation endpoint uses a different URL, a different response shape (data is a dict {image_urls, b64_json}, not a list), and an optional GroupId query parameter. A dedicated plugin keeps the OpenAI-shaped providers (fal, openai, openai-codex, xai) on their shared code path, while MiniMax handles its own auth + parsing + GroupId quirk in isolation. The picker gets a real model list, the setup wizard surfaces MINIMAX_API_KEY automatically, and the gateway gets uniform success_response / error_response regardless of which provider ran.

Related Issue

None — this is a feature addition.

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Changes Made

  • plugins/image_gen/minimax/__init__.py: MiniMaxImageGenProvider implementing the ImageGenProvider ABC. Three virtual model IDs (minimax-image-01, minimax-image-01-live, minimax-image-01-square) backed by the image-01 / image-01-live MiniMax models. Auth via Authorization: Bearer $MINIMAX_API_KEY; optional ?GroupId=$MINIMAX_GROUP_ID query string for accounts on group-scoped billing. Downloads the signed CDN URL to $HERMES_HOME/cache/images/ at tool-completion time (mirrors the xAI pattern in plugins/image_gen/xai/__init__.py) so the gateway's send_photo never hits the 30-minute TTL. Returns success_response / error_response per the base class contract.
  • plugins/image_gen/minimax/plugin.yaml: plugin manifest with kind: backend, requires_env: MINIMAX_API_KEY, optional_env: MINIMAX_GROUP_ID. Author: Vality.
  • tests/plugins/image_gen/test_minimax_provider.py: 31 unit tests + 1 opt-in live test. Covers is_available (with/without key), list_models (3 IDs in expected order), default_model, get_setup_schema (env vars + required:false for GroupId), _resolve_model (env override > config > default), _resolve_aspect (-square alias forces 1:1), generate() input validation (empty/whitespace prompt, missing key, invalid n, invalid response_format), request shape (URL with/without GroupId query, payload model field for each virtual ID, -square alias overrides aspect_ratio, seed / prompt_optimizer / aigc_watermark passthroughs), success path (URL response cached to disk, b64 response cached to disk, URL cache failure falls back to bare URL), error paths (401, 404 with GroupId message, empty data dict, response with neither url nor b64, timeout, connection error), and registration (register() wires the provider into the registry correctly).

How to Test

# Unit tests (no network)
pytest tests/plugins/image_gen/test_minimax_provider.py -q

# Live test (real API call, opt-in). The autouse _fake_api_key fixture
# overwrites MINIMAX_API_KEY for unit tests, so we read the real key
# from a side-channel env var (MINIMAX_API_KEY_LIVE) that the fixture
# doesn't touch.
MINIMAX_API_KEY_LIVE="$MINIMAX_API_KEY" RUN_LIVE_MINIMAX=1 \
  pytest tests/plugins/image_gen/test_minimax_provider.py::test_live_image_generation -v

End-to-end via the picker (after installing the plugin):

hermes tools  # → Image Generation → MiniMax → enter API key
# Then in a session:
# "Generate an image of a tiny red square"

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass (145 of 145 image_gen tests pass; 11 unrelated pre-existing failures in tests/tools/test_image_generation.py::TestManagedGatewayErrorTranslation, tests/plugins/memory/test_hindsight_provider.py::TestConfig, and tests/plugins/video_gen/test_fal_plugin.py::TestFamilyRouting are present on main without my changes — verified by stashing and re-running)
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Rhino Linux 2026.1 (RPi 5), Python 3.11.15, hermes-agent at commit 49dd91d68

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A (module docstring covers the auth quirks and endpoint shape; no user-facing docs to update)
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A (no new config keys; MINIMAX_API_KEY is surfaced via the existing get_setup_schema() flow)
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (image gen is a remote HTTPS call; the only platform-specific concern is save_url_image's requests usage, which matches the other 5 providers)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A (response shape matches the base class contract — success_response / error_response — used by all other providers)

@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins tool/vision Vision analysis and image generation provider/minimax MiniMax (Anthropic transport) P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #25451 — both add a dedicated MiniMax image_gen plugin at plugins/image_gen/minimax/ hitting the native /v1/image_generation endpoint (same feature, same approach). This PR is more comprehensive (3 virtual model IDs, GroupId handling) but the canonical earlier-open implementation is #25451. Both track feature request #10389.

@Vality
Vality force-pushed the feat/minimax-image-gen branch 2 times, most recently from 5df660d to 5357580 Compare June 23, 2026 18:16
Adds a hermes image_gen plugin for MiniMax (Anthropic transport)'s
native image generation API.

Why this exists:
- hermes-agent built-in image_gen only supports OpenAI /v1/images/generations
- MiniMax exposes a /v1/image_generation endpoint with its own
  request/response format, including GroupId header and
  per-model virtual IDs (image-01, image-01-live, etc.)
- Without a native plugin, hermes cannot generate images via MiniMax

This PR provides the same provider as NousResearch#47660 originally, but the
content is now applied on top of the current upstream main
(676236b) which was force-pushed since the PR was opened.
@Vality
Vality force-pushed the feat/minimax-image-gen branch from 75bcbf5 to 5e9302a Compare July 1, 2026 23:45
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the comprehensive MiniMax implementation and its focused provider tests.

This automated hermes-sweeper review is closing the PR under the standing in-tree-provider-integration policy: vendor-specific integrations must ship as standalone plugins, rather than as new provider directories in the Hermes core tree.

  • This PR adds the MiniMax-specific backend at plugins/image_gen/minimax/__init__.py and its bundled manifest at plugins/image_gen/minimax/plugin.yaml (PR head 5e9302aa73e2).
  • AGENTS.md:126-136 requires third-party product integrations to be distributed as standalone plugins because in-tree vendor integrations create an ongoing maintenance burden.
  • Hermes already supports the intended extension path: image-generation providers can register through ctx.register_image_gen_provider(...) and be installed from ~/.hermes/plugins/image_gen/<name>/ or a pip entry point (website/docs/developer-guide/image-gen-provider-plugin.md:17-25).
  • The duplicate discussion is relevant: @alt-glitch linked feat(image-gen): add MiniMax image-01 backend plugin #25451, which has since been closed under this same maintenance-boundary policy.

Please publish or continue this as a standalone MiniMax image-generation plugin repository, then share it in #plugins-skills-and-skins.


Automated hermes-sweeper review; closed as not planned under standing policy in-tree-provider-integration. This is a maintenance-boundary decision, not a judgment of the implementation's quality.


Closed as not-planned per standing maintainer policy (in-tree-provider-integration). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) tool/vision Vision analysis and image generation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants