MiniMax Integration
MiniMax is a Chinese AI company offering high-performance LLMs via an OpenAI-compatible API.
Embabel integrates MiniMax as a first-class provider using the same OpenAiCompatibleModelFactory pattern as other OpenAI-compatible providers.
Add the Dependency
Section titled “Add the Dependency”<dependency> <groupId>com.embabel.agent</groupId> <artifactId>embabel-agent-starter-minimax</artifactId></dependency>implementation("com.embabel.agent:embabel-agent-starter-minimax")implementation 'com.embabel.agent:embabel-agent-starter-minimax'API Key Configuration
Section titled “API Key Configuration”Set your MiniMax API key via environment variable (recommended) or Spring property:
export MINIMAX_API_KEY=your-api-keyOr in application.yml:
embabel: agent: platform: models: minimax: api-key: your-api-keyAvailable Models
Section titled “Available Models”| Model Name | Model ID | Context Window | Input (per 1M tokens) | Output (per 1M tokens) |
| --- | --- | --- | --- | --- |
| MiniMax-M2.7 | MiniMax-M2.7 | 1M tokens | $1.10 | $4.40 |
| MiniMax-M2.7-highspeed | MiniMax-M2.7-highspeed | 1M tokens | $0.55 | $2.20 |
MiniMax-M2.7 is the flagship model, optimized for quality.
MiniMax-M2.7-highspeed trades some quality for significantly lower latency and cost — a good choice for intermediate steps in a multi-action agent flow.
Using MiniMax Models
Section titled “Using MiniMax Models”Reference models by name in @LlmCall or programmatically via ai.withLlm():
// Declarative@LlmCall(llm = "MiniMax-M2.7")fun summarize(article: Article): Summary
// Programmaticai.withLlm("MiniMax-M2.7-highspeed") .create<Classification>("Classify this input")// Declarative@LlmCall(llm = "MiniMax-M2.7")Summary summarize(Article article);
// Programmaticai.withLlm("MiniMax-M2.7-highspeed") .create("Classify this input", Classification.class);Or map MiniMax models to roles in your configuration:
embabel: models: llms: cheapest: MiniMax-M2.7-highspeed best: MiniMax-M2.7Then reference by role with the # prefix:
@LlmCall(llm = "#cheapest")fun extractEntities(text: String): EntityList@LlmCall(llm = "#cheapest")EntityList extractEntities(String text);Temperature Clamping
Section titled “Temperature Clamping”MiniMax models require temperature in the range (0.0, 1.0] — a value of exactly 0.0 is not permitted.
Embabel’s MiniMaxOptionsConverter clamps temperature automatically:
- Values
⇐ 0.0are raised to0.01 - Values
> 1.0are lowered to1.0
A DEBUG log message is emitted whenever clamping occurs.
No action is required on your part — this is handled transparently.
Configuration Reference
Section titled “Configuration Reference”embabel: agent: platform: models: minimax: api-key: your-api-key # Alternative to MINIMAX_API_KEY env var base-url: https://api.minimax.io/v1 # Default; override for proxies max-attempts: 4 # Retry attempts (default: 4) backoff-millis: 1500 # Initial backoff ms (default: 1500) backoff-multiplier: 2.0 # Backoff multiplier (default: 2.0) backoff-max-interval: 60000 # Max backoff ms (default: 60000)