Skip to content

feat: 新增 MiniMax LLM 与 TTS 支持#75

Open
octo-patch wants to merge 1 commit into
wwbin2017:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat: 新增 MiniMax LLM 与 TTS 支持#75
octo-patch wants to merge 1 commit into
wwbin2017:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

简介 / Summary

新增 MiniMax 作为 LLM 与 TTS 提供方,按现有模块化架构无缝接入,丰富百聆的对话与语音合成选择。

Add MiniMax as a new provider for both chat (LLM) and speech (TTS), following the existing modular architecture.

改动 / Changes

  • bailing/llm.py:新增 MiniMaxLLM。MiniMax 提供 OpenAI 兼容的 Chat Completions 接口,因此直接继承现有的 OpenAILLM,默认模型 MiniMax-M3、默认 Base URL https://api.minimax.io/v1
  • bailing/tts.py:新增 MiniMaxTTS,调用 MiniMax T2A v2 HTTP 接口,将返回的 hex 编码音频解码写入文件,符合 AbstractTTSto_tts(text) 接口。
  • config/config.yaml:在 LLMTTS 下新增对应配置项(默认不改变 selected_module)。
  • README.md / README_en.md:补充 MiniMax 的配置说明。

用法 / Usage

LLM:将 selected_module.LLM 设为 MiniMaxLLM,在 LLM.MiniMaxLLM.api_key 填入密钥即可(默认 MiniMax-M3)。
TTS:将 selected_module.TTS 设为 MiniMaxTTS,复用同一 api_key(默认 speech-2.8-hd)。

测试 / Testing

  • 单元测试:MiniMaxLLM 默认值/自定义覆盖/工厂创建均通过;MiniMaxTTS 请求构造、endpoint、hex 解码(输出有效 mp3 头)、错误码处理均通过。
  • 接口连通性:已对 /v1/chat/completions/v1/t2a_v2 实测,鉴权与模型名均被正确识别。

说明:MiniMaxLLM 复用 OpenAILLM 流式逻辑,不引入新依赖;MiniMaxTTS 仅使用已有的 requests。默认模块选择保持不变,是否启用 MiniMax 完全由用户在 config.yaml 中决定。

Add MiniMax as a new provider for both chat (LLM) and speech (TTS):

- MiniMaxLLM: subclasses OpenAILLM since MiniMax exposes an
  OpenAI-compatible Chat Completions API; defaults to MiniMax-M3 with
  base URL https://api.minimax.io/v1.
- MiniMaxTTS: calls the MiniMax T2A v2 HTTP API and writes hex-decoded
  audio to a file, matching the AbstractTTS interface.
- Add config entries for both modules in config/config.yaml.
- Document MiniMax setup in README.md and README_en.md.
@hjxbin

hjxbin commented Jun 24, 2026 via email

Copy link
Copy Markdown

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