Files
Plexum-minimax-provider/README.md
hzhang e44936990c feat: Plexum-minimax-provider v0.1 — MiniMax via Anthropic-compat endpoint
Plexum ProviderPlugin that serves MiniMax models through MiniMax's
Anthropic-compatible HTTP endpoint
(https://api.minimax.io/anthropic, or CN api.minimaxi.com). Inspired
by openclaw's extensions/minimax provider-registration, but rewritten
in Go for Plexum's SDK.

internal/anthropic/ (~210 LOC + 6 tests):
- minimal HTTP+SSE Anthropic Messages client (POST /v1/messages,
  stream:true, parses event:/data: SSE frames)
- handles non-2xx as HTTP error; stream errors land as Event{Type:"error"}
- 1 MiB SSE line cap; per-conn 5min timeout

internal/translate/ (~220 LOC):
- CanonicalToAnthropic: canonical.TurnRequest → MessagesRequest
- blockToAnthropic: TextBlock / ToolUseBlock / ToolResultBlock /
  ThinkingBlock → loose ContentBlock map; preserves signatures + cache
  control
- Translator: per-turn state machine; consumes anthropic.Event stream
  and emits canonical.TurnEvent stream (handles thinking blocks +
  tool_use input_json_delta accumulation + signature_delta capture)

cmd/plexum-minimax-provider-plugin/:
- Plugin manifest declares provider.models = [MiniMax-M2.7,
  MiniMax-M2.7-highspeed]
- Backend fixed to "api" (per scope); region "global"|"cn" + base_url
  override supported via config
- HostConfig from <profile>/plugins/plexum-minimax-provider/config.json
  {api_key, region?, base_url?, max_tokens_default?}

scripts/install.sh: build + manifest emit; operator writes config.json
+ allows plugin + adds an agent + restarts.

End-to-end verified against the real key:
1. plexum say --agent-id mini ... → "Hi, I'm MiniMax!"
2. Multi-turn continuity: agent recalled the prior reply
3. Via gateway socket: {"outcome":"text","text":"\n\npong"}
4. Via Fabric channel (alice posts → plugin inbound → mini agent
   → MiniMax → outbound REST → reply visible in bt2-clean seq=11):
     "Hi there! 👋 Fun fact: Octopuses have three hearts, blue blood,
      and neurons distributed throughout their arms—so their tentacles
      can 'think'"

The MiniMax-M2.7-highspeed variant works the same way but hit a
Code Plan rate-limit ceiling during testing (not a plugin issue).

Deferred:
- OAuth (Code Plan portal) — not in v1 scope per request
- MiniMax Portal provider (separate provider id minimax-portal)
- Image / TTS / video / music providers (separate plugins later)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 16:01:38 +01:00

1.9 KiB
Raw Blame History

Plexum-minimax-provider

Plexum ProviderPlugin that serves MiniMax models via MiniMax's Anthropic-compatible HTTP endpoint.

Status

v0.1 — current: API key auth, streaming SSE, declared models MiniMax-M2.7 + MiniMax-M2.7-highspeed. Backend fixed to api (global https://api.minimax.io/anthropic or CN https://api.minimaxi.com/anthropic).

Deferred: OAuth (Code Plan portal), MiniMax Portal provider, image / TTS / video / music providers (separate plugins later if wanted).

Install

cd ~/Plexum-minimax-provider
./scripts/install.sh

Then:

  1. Write API key to ~/.plexum/plugins/plexum-minimax-provider/config.json:

    {
      "api_key": "sk-cp-..."
    }
    

    (chmod 600 it.)

  2. Allow the plugin in ~/.plexum/plexum.json:

    {"plugins": {"allow": ["plexum-minimax-provider"]}}
    
  3. Point an agent at a MiniMax model:

    plexum agent-add --model MiniMax-M2.7 my-agent
    
  4. Restart the gateway and talk:

    systemctl --user restart plexum
    plexum say --agent-id my-agent --session-id $(plexum new-session --agent-id my-agent) "hello"
    

Config options

Field Default Notes
api_key (required) sk-cp-... style key from MiniMax
region global cn switches to api.minimaxi.com
base_url override either region's default
max_tokens_default 4096 used when TurnRequest.MaxTokens is unset

Architecture

  • internal/anthropic/ — minimal HTTP+SSE Anthropic Messages client
  • internal/translate/canonical.TurnRequest ↔ Anthropic Messages, SSE Event → canonical.TurnEvent per-block state machine
  • cmd/plexum-minimax-provider-plugin/ — Plexum SDK ProviderPlugin entry

Both text, thinking, and tool_use content blocks round-trip losslessly (signatures preserved for thinking blocks).

License

Same as Plexum.