42 3 days ago

cloud
ollama run igovet/minimax-m3-opencode

Details

3 days ago

4c557d013734 · 429B ·

{ "num_ctx": 524288, "num_predict": 16384, "repeat_last_n": 2048, "repeat_penalty":

Readme

MiniMax M3 — OpenCode (Ollama Cloud)

Modelfile & provider preset tuned for stable work inside OpenCode over Ollama Cloud.


Background

When using Ollama Cloud models from OpenCode, several issues surface out of the box:

  • Stream stalls — the response repeatedly pauses mid-token.
  • Stream freezes → timeout — long stalls trip the upstream timeout.
  • Same issues on plain HTTP — disabling streaming does not make them go away.
  • Reasoning loops — some models (notably DeepSeek) get stuck inside their own reasoning trace and never escape.

The settings below were arrived at empirically and raise the stability of Ollama Cloud + OpenCode to roughly 95%. The remaining edge cases look like Ollama Cloud throughput / model overload bugs, not configuration problems.

⚠️ These settings are experimental. They are not endorsed by Ollama or OpenCode — they are what happened to work best in our environment.


TL;DR

Field Value
Base model minimax-m3:cloud
Context window 524288
Output limit (in OpenCode) 524288 (equals context)
Temperature 1.0
Top-p / Top-k 0.95 / 40
Repeat penalty 1.1 (last 2048 tokens)
Variants (no variants block — model has no reasoningEffort surface)

Modelfile

FROM minimax-m3:cloud

PARAMETER num_ctx         524288
PARAMETER num_predict     16384
PARAMETER temperature     1.0
PARAMETER top_p           0.95
PARAMETER top_k           40
PARAMETER repeat_penalty  1.1
PARAMETER repeat_last_n   2048

OpenCode configuration

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama",
      "options": {
        "baseURL": "http://localhost:11434/v1",
        "timeout": 1200000,
        "headerTimeout": 1200000
      },
      "models": {
        "igovet/minimax-m3-opencode": {
          "_launch": false,
          "name": "MiniMax M3 OpenCode",
          "limit": {
            "context": 524288,
            "output": 524288
          }
        }
      }
    }
  }
}

Notes

Why output is set equal to context

Ollama does not honor a separate output (max output tokens) reliably through the OpenAI-compatible surface that @ai-sdk/openai-compatible speaks to. If you set output near 16384 you will see the stream cut off mid-response with no error.

The workaround used here is to make output formally equal to context. The model still decides when to stop on its own; we just stop clipping it on the client side.

Long timeouts

timeout and headerTimeout are bumped to 20 minutes (1200000 ms). Cloud models occasionally queue for several minutes during peak load, and the default AI SDK timeouts will fire long before that.

Why this model, not M2.7

M3 is the larger sibling of M2.7 with a 512K context and slightly higher sampling temperature (0.7 vs 0.6). The extra temperature buys more diverse planning behavior on long contexts. Use M3 when you need to load multiple modules into the prompt at once; use M2.7 for quick scoped edits.

Higher temperature

temperature 0.7 is unusual for this preset family — most others sit at 0.6. M3 specifically benefits from the extra diversity on long contexts, where repetition in the planning phase otherwise creeps in around the ~200K token mark.


Reasoning effort — when to pick what

This preset does not declare variants, so the OpenCode reasoning-effort selector will be unavailable for this model. Use the default model selection.

If you want explicit effort control anyway, you can add the standard block — Ollama will ignore unknown values rather than error out:

"variants": {
  "high":   { "reasoningEffort": "high"   },
  "medium": { "reasoningEffort": "medium" },
  "low":    { "reasoningEffort": "low"    },
  "none":   { "reasoningEffort": "none"   }
}

Recommended use inside OpenCode (when variants are added):

Variant Use it for
high Whole-repository reasoning: planner, architect-*, database-architect on multi-DB / multi-service problems.
medium Default for code-writing sub-agents on a known scope (backend-developer, refactorer).
low code-reviewer, qa-engineer, security-auditor on small scopes.
none Inline completions / quick classification.