Skip to content

feat: add and expand MiniMax provider support#182

Open
Hi-Jiajun wants to merge 16 commits intoTHU-MAIC:mainfrom
Hi-Jiajun:feat/minimax-image
Open

feat: add and expand MiniMax provider support#182
Hi-Jiajun wants to merge 16 commits intoTHU-MAIC:mainfrom
Hi-Jiajun:feat/minimax-image

Conversation

@Hi-Jiajun
Copy link

@Hi-Jiajun Hi-Jiajun commented Mar 21, 2026

Summary

This PR adds and expands MiniMax support across OpenMAIC's built-in providers, including LLM, TTS, image, and video.

What changed

  • LLM
    • keep MiniMax on the Anthropic-compatible provider type
    • update the default MiniMax base URL to https://api.minimaxi.com
    • add MiniMax-M2, MiniMax-M2.1, MiniMax-M2.1-lightning, MiniMax-M2.1-highspeed, MiniMax-M2.5, MiniMax-M2.5-lightning, MiniMax-M2.5-highspeed, and MiniMax-M2.7-highspeed
  • TTS
    • add built-in MiniMax TTS model options: speech-2.8-turbo, speech-2.8-hd, speech-2.6-turbo, speech-2.6-hd, speech-02-turbo, speech-02-hd
    • persist the selected TTS model in settings
    • expose the MiniMax TTS model selector in the settings UI
    • pass ttsModel through /api/generate/tts
    • align default MiniMax TTS base URL with https://api.minimaxi.com
  • Image
    • add the built-in minimax-image provider integration
    • add image-01 and image-01-live
    • align the default MiniMax image base URL with https://api.minimaxi.com
  • Video
    • add the built-in minimax-video provider integration
    • add MiniMax-Hailuo-2.3, MiniMax-Hailuo-2.3-Fast, MiniMax-Hailuo-02, T2V-01-Director, and T2V-01
    • align the default MiniMax video base URL with https://api.minimaxi.com
  • Docs/config
    • refresh .env.example, README.md, and README-zh.md with MiniMax examples and updated defaults

Validation

  • pnpm eslint lib/ai/providers.ts
  • pnpm eslint lib/audio/constants.ts lib/media/image-providers.ts lib/media/video-providers.ts lib/ai/providers.ts
  • pnpm eslint components/settings/audio-settings.tsx app/api/generate/tts/route.ts lib/store/settings.ts lib/audio/constants.ts lib/audio/tts-providers.ts
  • pnpm build

Notes

  • This PR does not add MiniMax Music support.
  • The implementation in this PR was written 100% by GPT-5.4.

Hi-Jiajun added 3 commits March 20, 2026 07:04
- Add 'minimax-image' to ImageProviderId union
- Implement minimax-image-adapter with generateWithMiniMaxImage and testMiniMaxImageConnectivity
- Register adapter in image-providers.ts (generateImage + testImageConnectivity)
- Add IMAGE_MINIMAX to IMAGE_ENV_MAP in provider-config.ts
- Add provider name and icon mappings in settings/index.tsx
- Add i18n entries (zh + en) for providerMiniMaxImage
- Add IMAGE_MINIMAX_API_KEY / BASE_URL to .env.example
- Model: image-01, supports 1:1/16:9/4:3/9:16 aspect ratios
- Add 'minimax-video' to VideoProviderId union
- Implement minimax-video-adapter: async task pattern (submit → poll → get URL)
  - POST /v1/video_generation to submit
  - GET /v1/query/video_generation?task_id=xxx to poll status
  - Supports Hailuo 2.3, Hailuo 02, T2V-01-Director, T2V-01 models
  - Supports 6s/10s duration, 720P/1080P resolution
- Register adapter in video-providers.ts (generateVideo + testVideoConnectivity)
- Add VIDEO_MINIMAX to VIDEO_ENV_MAP in provider-config.ts
- Add provider name and icon mappings in settings/index.tsx
- Add i18n entries (zh + en) for providerMiniMaxVideo
- Add VIDEO_MINIMAX_API_KEY / BASE_URL to .env.example
@Hi-Jiajun Hi-Jiajun changed the title feat: expand MiniMax provider support feat: add and expand MiniMax provider support Mar 21, 2026
Hi-Jiajun and others added 6 commits March 21, 2026 21:29
# Conflicts:
#	.env.example
#	components/generation/media-popover.tsx
#	components/settings/audio-settings.tsx
#	components/settings/index.tsx
#	lib/audio/constants.ts
#	lib/audio/tts-providers.ts
#	lib/audio/types.ts
#	lib/i18n/settings.ts
#	lib/server/provider-config.ts
#	lib/store/settings.ts
@Hi-Jiajun
Copy link
Author

Hi-Jiajun commented Mar 22, 2026

Synced this branch with the latest upstream/main on 2026-03-23 and resolved the provider/config merge conflicts locally.

This keeps the MiniMax image, video, and TTS changes aligned with the then-current main branch, including the newer Grok and ElevenLabs provider additions, so the PR is easier to review against a current baseline.

# Conflicts:
#	components/settings/audio-settings.tsx
@Hi-Jiajun
Copy link
Author

Hi-Jiajun commented Mar 24, 2026

Synced this branch again with the latest upstream/main on 2026-03-24 and resolved the new merge conflict introduced by the Discussion TTS changes.

The branch returned to a mergeable state after that sync, and the refreshed Lint & Typecheck run passed.

Copy link
Contributor

@wyuc wyuc left a comment

Choose a reason for hiding this comment

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

Three issues:

  1. LLM defaultBaseUrl dropped the /anthropic/v1 suffix. Since MiniMax uses type: 'anthropic', this will break all LLM calls.

  2. Base URLs are inconsistent across .env.example, README EN, README ZH, and adapter code (mixing api.minimaxi.com, api.minimax.com, api.minimax.io). Please unify per service.

  3. Please verify the video adapter's file download path. The code constructs /v1/files/${file_id} as the URL directly. Check if MiniMax requires a separate file retrieval call instead.

Also consider adding MiniMax-M2.7 (non-highspeed) from PR #170 since this PR is the more comprehensive MiniMax addition.

@Hi-Jiajun
Copy link
Author

Hi-Jiajun commented Mar 24, 2026

Addressed the latest review feedback in commit 96dd9f2:

  • Fixed MiniMax LLM defaultBaseUrl to use the Anthropic-compatible https://api.minimaxi.com/anthropic/v1 endpoint, and added normalization so custom MiniMax base URLs also resolve correctly.
  • Unified MiniMax examples and runtime defaults to the domestic https://api.minimaxi.com domain across .env.example, both READMEs, and adapters.
  • Changed the MiniMax video adapter to call GET /v1/files/retrieve?file_id=... and use the returned download_url instead of constructing the file URL directly.
  • Added MiniMax-M2.7 to the built-in MiniMax model list.

Also added a small Vitest check for the MiniMax provider defaults. Local eslint, tsc --noEmit, and vitest runs all pass.

@Hi-Jiajun
Copy link
Author

Hi-Jiajun commented Mar 24, 2026

Follow-up adjustment in commit 4b597a2:

  • Restored MiniMax-Hailuo-2.3-Fast in the MiniMax video model list after re-checking the official MiniMax docs.

I initially removed it while narrowing the list, but the official MiniMax video/model documentation does list it, so the PR now keeps the video model list aligned with MiniMax's published availability.

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.

2 participants