Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions server/fastapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ To keep onboarding straightforward, the classic FastAPI route is centered around
- `claude`
- `gemini`
- `grok`
- `minimax`

### STT

Expand Down Expand Up @@ -203,6 +204,7 @@ The current simple provider map is:
- `claude` LLM: `ANTHROPIC_API_KEY`
- `gemini` LLM: `GEMINI_API_KEY`
- `grok` LLM: `XAI_API_KEY`
- `minimax` LLM: `MINIMAX_API_KEY`
- `deepgram` STT: `DEEPGRAM_API_KEY`
- `whisper` STT: no external API key required
- `elevenlabs` TTS: `ELEVENLABS_API_KEY`
Expand All @@ -220,6 +222,7 @@ Each supported provider now has its own module file so the layout is easy to und
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/llm/anthropic.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/llm/gemini.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/llm/grok.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/llm/minimax.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/stt/deepgram.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/stt/whisper.py`
- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/fastapi/models/tts/elevenlabs.py`
Expand Down Expand Up @@ -261,6 +264,17 @@ CLASSIC_LLM_PROVIDER=gemini
CLASSIC_TTS_PROVIDER=openai
```

### Deepgram + MiniMax + ElevenLabs

```env
CLASSIC_STT_PROVIDER=deepgram
CLASSIC_LLM_PROVIDER=minimax
CLASSIC_TTS_PROVIDER=elevenlabs
```

MiniMax uses an OpenAI-compatible chat API, so only `MINIMAX_API_KEY` is
required. The default model is `MiniMax-M3`.

## Unified Experience Across Elato

A simple way to keep the product understandable is:
Expand Down
3 changes: 3 additions & 0 deletions server/fastapi/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GEMINI_API_KEY=your_gemini_api_key
XAI_API_KEY=your_xai_api_key
MINIMAX_API_KEY=your_minimax_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_key
CARTESIA_API_KEY=your_cartesia_api_key
# Whisper STT in Pipecat is local/offline, so it does not require an API key.
# MiniMax is OpenAI-compatible. Override the base URL for the mainland China
# endpoint if needed: MINIMAX_BASE_URL=https://api.minimaxi.com/v1

# Classic route providers
CURRENT_VOICE_ROUTE=classic
Expand Down
42 changes: 42 additions & 0 deletions server/fastapi/models/llm/minimax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""MiniMax LLM provider.

MiniMax exposes an OpenAI-compatible chat-completions API, so we reuse
Pipecat's ``OpenAILLMService`` and only point it at the MiniMax base URL.
This mirrors how Pipecat wires other OpenAI-compatible vendors (Grok, Groq,
DeepSeek, ...) and keeps the provider module thin.

Docs: https://platform.minimax.io/docs/api-reference/text-openai-api
"""

from __future__ import annotations

import os

from pipecat.services.openai.llm import OpenAILLMService

# Overseas (default) OpenAI-compatible endpoint. Mainland China users can set
# MINIMAX_BASE_URL to https://api.minimaxi.com/v1 instead.
DEFAULT_BASE_URL = "https://api.minimax.io/v1"
DEFAULT_MODEL = "MiniMax-M3"


def create_service(**kwargs):
"""Create an OpenAI-compatible Pipecat LLM service backed by MiniMax."""
api_key = kwargs.get("api_key") or os.getenv("MINIMAX_API_KEY")
base_url = kwargs.get("base_url") or os.getenv("MINIMAX_BASE_URL") or DEFAULT_BASE_URL
model = kwargs.get("model") or DEFAULT_MODEL

settings_kwargs: dict[str, object] = {"model": model}
if kwargs.get("system_instruction") is not None:
settings_kwargs["system_instruction"] = kwargs["system_instruction"]

# MiniMax requires temperature in the (0.0, 1.0] range and rejects 0, so we
# default to 1.0 instead of leaving it unset / passing 0.
temperature = kwargs.get("temperature")
settings_kwargs["temperature"] = 1.0 if temperature is None else temperature

return OpenAILLMService(
api_key=api_key,
base_url=base_url,
settings=OpenAILLMService.Settings(**settings_kwargs),
)
7 changes: 7 additions & 0 deletions server/fastapi/models/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ class ProviderSpec:
env=("XAI_API_KEY",),
description="xAI Grok via Pipecat.",
),
"minimax": ProviderSpec(
name="minimax",
category="llm",
module="models.llm.minimax",
env=("MINIMAX_API_KEY",),
description="MiniMax (OpenAI-compatible) chat models such as MiniMax-M3.",
),
},
"stt": {
"deepgram": ProviderSpec(
Expand Down