Skip to content

feat: add MiniMax as cloud LLM provider#285

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

feat: add MiniMax as cloud LLM provider#285
octo-patch wants to merge 1 commit intoggozad:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Adds MiniMax as an alternative cloud LLM provider alongside Ollama, enabling users to chat with MiniMax-M2.7, M2.7-highspeed, M2.5 and M2.5-highspeed models directly from the terminal.

Changes

  • minimaxclient.py: New MiniMaxLLM client with SSE streaming via httpx, tool call support, <think> tag parsing for thinking mode, and temperature clamping to [0, 1.0]
  • chat_edit.py: Provider selector (RadioSet: Ollama / MiniMax) in the model selection screen — MiniMax option is automatically disabled when MINIMAX_API_KEY is not set
  • config.py: MINIMAX_API_KEY and MINIMAX_BASE_URL environment variables
  • types.py: provider field on ChatModel (defaults to "ollama" for backward compatibility)
  • store.py + v0_14_8.py: Database migration to persist provider per chat session
  • chat.py: _create_llm_client() factory that routes to the correct client based on provider, plus httpx.HTTPStatusError error handling
  • 31 unit tests + 3 integration tests covering model listing, think-tag parsing, temperature clamping, streaming, and live API calls

Configuration

export MINIMAX_API_KEY="your-key-here"
# Optional: export MINIMAX_BASE_URL="https://api.minimax.io/v1"
oterm

When MINIMAX_API_KEY is set, a provider toggle appears in the chat creation screen.

No breaking changes

  • Existing Ollama-only workflows are unaffected (provider defaults to "ollama")
  • No new Python dependencies (uses httpx already available via ollama)
  • Database auto-migrates with ALTER TABLE chat ADD COLUMN provider

Test plan

  • 31 unit tests pass (model types, think-tag parsing, temperature clamping, streaming with mocked HTTP)
  • 3 integration tests pass against live MiniMax API
  • Manual testing: create MiniMax chat, stream response, verify thinking mode, verify tool calls
  • Verify existing Ollama tests still pass when Ollama server is available

Add MiniMax (https://www.minimaxi.com) as an alternative cloud LLM provider,
enabling users to chat with MiniMax-M2.7, M2.7-highspeed, M2.5 and
M2.5-highspeed models directly from the terminal.

- New MiniMaxLLM client with streaming, tool calls, thinking mode support
- Provider selector (RadioSet) in the ChatEdit screen
- MINIMAX_API_KEY / MINIMAX_BASE_URL environment variable configuration
- Database migration to persist the provider per chat
- 31 unit tests + 3 integration tests
@ggozad
Copy link
Copy Markdown
Owner

ggozad commented Mar 26, 2026

Hey!
I am contemplating switching everything to pydantic AI which would make oterm be able to use any provider.
Would it be ok wait a bit and see if I can pull it off soon, otherwise will look into this?

If you are willing to help let me know and I will open a PR next week if I make progress.

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