MiMo Code Setup Guide 2026: Wire Xiaomi's Agent to Ollama

mimo-codeollamacoding-agentselfhostedai

TL;DR: MiMo Code is Xiaomi’s MIT-licensed fork of OpenCode that adds persistent cross-session memory for 200+ step agentic tasks. The bundled free access to MiMo-V2.5-Pro ended July 26, 2026, so the zero-cost path now runs through a local Ollama endpoint. If the memory system matters to you, it’s worth the switch; otherwise stick with upstream OpenCode.

MiMo Code + OllamaOpenCode + OllamaGoose + Ollama
Best forLong multi-session tasks needing memoryCLI-first devs who want the mature upstreamMCP-extension workflows, desktop app
Persistent memoryYes — SQLite FTS5, /dream, /distillNo (session-scoped)No (session-scoped)
LicenseMIT (code) + Xiaomi ToS on the APIMITApache 2.0
Local cost$0$0$0
The catchYoung fork (v0.1.x), free model goneNo cross-session memoryWeaker terminal ergonomics

Honest take: MiMo Code’s memory system is the only genuinely new idea here, and it works offline with your own model. Run it beside OpenCode for a week on a real project; if you never touch /dream, go back to upstream.

Xiaomi shipped MiMo Code on June 10, 2026, and the pitch was hard to ignore: an open-source coding harness that reportedly beats Claude Code on ultra-long 200+ step tasks, plus free bundled access to MiMo-V2.5-Pro, a 1.02-trillion-parameter MoE model. Six weeks later the fine print arrived. The v0.1.9 release notes (July 24, 2026) announced the sunset of the MiMo-V2.5 free trial on July 26. If you installed MiMo Code for the free frontier model, that channel is now closed.

That doesn’t kill the tool. MiMo Code is a fork of OpenCode, which means it speaks to any OpenAI-compatible endpoint — including the Ollama instance already running on your machine. The license reality, the exact mimocode.jsonc config that wires it to a local model, the two traps that make local agents silently fail, and whether the memory system justifies leaving upstream OpenCode — all below.

What MiMo Code actually is

MiMo Code (github.com/XiaomiMiMo/MiMo-Code, ~12.5k stars as of late July 2026, latest release v0.1.9 on July 24, 2026) forks OpenCode and keeps everything that makes the upstream good: the terminal TUI, multi-provider support, LSP integration, MCP servers, and plugins. On top of that it adds:

  • Persistent memory backed by SQLite FTS5 full-text search: project knowledge lands in MEMORY.md, session state in checkpoint.md, ad-hoc observations in notes.md, plus task logs.
  • Context reconstruction: when the context window fills, the agent checkpoints, then rebuilds a working context from memory with token budgeting instead of dying or blindly truncating.
  • /dream and /distill: /dream extracts durable knowledge from a session into project memory; /distill packages a workflow you just completed into a reusable skill.
  • Subagent orchestration and goal-driven loops for the long-horizon tasks the 200-step benchmark claims are built on.
  • tool_script (added in v0.1.7, July 20, 2026): programmatic tool orchestration in a QuickJS sandbox.

The 200+ step claim comes from Xiaomi’s own evaluation. No independent replication existed as of this writing, so treat it as a vendor benchmark. What you can verify yourself in an afternoon: whether checkpoint-and-reconstruct keeps a local agent coherent past the point where OpenCode loses the plot.

License check: mostly clean, one asterisk

The MiMo Code source is MIT — modification, redistribution, and commercial self-hosting are all fine. The model is a separate story with a happy ending: Xiaomi open-sourced MiMo-V2.5 and MiMo-V2.5-Pro weights on HuggingFace under plain MIT, explicitly allowing commercial deployment, continued training, and fine-tuning with no additional authorization. No MAU caps, no attribution clauses — cleaner than Kimi K2.7’s Modified MIT or the Llama Community License.

The asterisk: MiMo Code’s README notes that usage is also subject to “Use Restrictions and Xiaomi MiMo Terms of Service.” That applies to Xiaomi’s hosted API channel, not to the MIT code you run against your own endpoint. Wire it to Ollama and the ToS never enters the picture — one more argument for the local setup below.

Install

macOS and Linux:

curl -fsSL https://mimo.xiaomi.com/install | bash

Or via npm on any platform, which is easier to pin and uninstall:

npm install -g @mimo-ai/cli

First launch walks you through provider setup. Since the MiMo Auto free channel sunset on July 26, skip the hosted options and go straight to a custom provider.

Wire it to Ollama

You need a model that supports tool calling. This is the first trap, inherited straight from the OpenCode lineage: point the agent at a model without tool-call support and it will chat pleasantly while editing exactly zero files. Qwen3-Coder-Next is the strongest local pick on a 24GB card; Qwen3.6-35B-A3B also works well.

ollama pull qwen3-coder-next

MiMo Code reads config from .mimocode/mimocode.jsonc in your project or ~/.config/mimocode/mimocode.jsonc globally. Adapting the custom-provider template from the official README to a local Ollama endpoint:

{
  "model": "custom/qwen3-coder-next",
  "provider": {
    "custom": {
      "name": "Ollama",
      "models": { "qwen3-coder-next": { "name": "qwen3-coder-next" } },
      "options": {
        "baseURL": "http://localhost:11434/v1",
        "apiKey": "ollama"
      }
    }
  }
}

The apiKey value is arbitrary — Ollama ignores it, but the OpenAI-compatible client requires something. Restart MiMo Code after editing; like upstream, it reads config at launch.

The context-window trap

Second trap, and it bites harder here than in any other harness: Ollama defaults to a 4,096-token context (num_ctx), and an agent that checkpoints and reconstructs context is exactly the workload that overflows it instantly. Symptoms are silent — truncated prompts, forgotten instructions, tool calls that reference files the model can no longer see. The memory system cannot save you if the reconstructed context gets chopped to 4k before the model reads it.

Fix it with a Modelfile:

cat > Modelfile <<'EOF'
FROM qwen3-coder-next
PARAMETER num_ctx 32768
EOF
ollama create qwen3-coder-next-32k -f Modelfile

Then reference qwen3-coder-next-32k in mimocode.jsonc. Verify the model is actually on your GPU while the agent runs:

$ ollama ps
NAME                      ID            SIZE     PROCESSOR    UNTIL
qwen3-coder-next-32k      3f1c9a2b8d    21 GB    100% GPU     4 minutes from now

100% GPU is what you want. A cloud suffix in the name or 0 GB in the SIZE column means inference is happening somewhere that isn’t your machine. A 32k context at Q4_K_M on a 30B-class model fits a 24GB RTX 3090 with room to spare; the GPU buying guide at runaihome.com has the full VRAM math per model tier.

What about self-hosting MiMo-V2.5-Pro itself?

The weights are MIT and sitting on HuggingFace, so it’s legal. It’s just not practical. At 1.02T total parameters, even a 4-bit quant lands in the ~500GB+ range — the same multi-node math as Kimi K2.7, a fellow 1T-class MoE. The 42B active parameters and the hybrid attention design (sliding-window/global interleave at 6:1, which cuts KV-cache by roughly 7× per the model card) make it efficient for its size, but its size is datacenter size.

If you want to try the full model against your codebase before committing to anything, renting a multi-GPU pod on RunPod for a few hours is the sane way to do it. For daily driving on your own hardware, a 30B-class local model in the harness is the realistic setup.

Does the memory system hold up locally?

The honest answer after wiring it to a 30B local model: partially, and the failure mode is important to understand. The memory system stores what the model writes into it. A frontier model distills accurate, well-structured project knowledge; a 30B model occasionally distills confident nonsense, and SQLite FTS5 will faithfully retrieve that nonsense into every future session. Low-quality completions don’t just waste one session — they pollute the library.

Three practical mitigations:

  1. Review MEMORY.md weekly. It’s a plain markdown file in your project. Prune wrong entries like you’d prune a bad comment.
  2. Use /dream deliberately, at the end of sessions that went well — not as an automatic ritual after every session.
  3. Keep /distill for workflows you’ve verified twice. A distilled skill built from a lucky run is a trap you set for yourself.

Where it clearly beats stateless harnesses: resuming work. Kill the terminal mid-refactor, come back the next day, and the checkpoint file plus project memory get the agent productive in one prompt instead of ten minutes of re-explanation. Goose and upstream OpenCode both start cold every session; that difference compounds over a long project.

MiMo Code vs OpenCode vs Goose, side by side

MiMo Code v0.1.9OpenCode v1.17.xGoose v1.39+
OriginXiaomi fork of OpenCodeAnomaly Co (upstream)Block → Agentic AI Foundation
LicenseMITMITApache 2.0
Cross-session memoryYes (SQLite FTS5)NoNo
InterfaceTerminal TUITerminal TUICLI + desktop app
Maturityv0.1.x, June 2026v1.x, ~183K starsv1.39.x, ~50K stars
Local endpoint configmimocode.jsonc custom provideropencode.json + openai-compatibleconfig.yaml + Ollama provider
Skills/extensions/distill skills, MCP, pluginsMCP, plugins70+ community MCP extensions

Upstream OpenCode remains the safer default: bigger community, faster fixes, a year of hardening. MiMo Code is six weeks old, and forks of fast-moving projects have a documented habit of drifting behind upstream — whether Xiaomi keeps pulling OpenCode’s improvements is the open question that decides this fork’s long-term viability.

When NOT to use MiMo Code

  • Your tasks fit in one session. Bug fixes, single-file changes, and short scripts get zero value from persistent memory. Use OpenCode and skip the fork risk.
  • You need an in-editor agent. Neither MiMo Code nor OpenCode lives in VS Code. Cline does — aicoderscope.com’s local-first Cline setup covers that path with the same Ollama backend.
  • You were here for the free 1T model. That ended July 26, 2026. Xiaomi’s hosted API continues as a paid channel, but at that point you’re comparing prices with every other API vendor, and the harness choice is a separate decision.
  • You can’t audit memory files. In a team or compliance setting, an agent that silently writes project knowledge to disk and reinjects it later is a review burden. Stateless is simpler to reason about.

Verdict

The free-model sunset stripped away the marketing and left something more interesting: the first open-source coding harness where cross-session memory is a first-class feature, under a clean MIT license, running entirely on hardware you own. Wired to a tool-calling local model with the context window raised, it does what it claims — imperfectly, with a young codebase and a memory library that needs occasional gardening. Try it on one long-running project. Keep OpenCode installed. In six months, one of two things will be true: upstream will have grown its own memory system, or this fork will have earned its place.

FAQ

Is MiMo Code still free after the July 26 trial sunset? The software is MIT-licensed and free forever. What ended was free hosted access to MiMo-V2.5-Pro through the built-in MiMo Auto channel. Pointed at a local Ollama model, MiMo Code costs $0 per token with no expiration.

Which local models work with MiMo Code? Any model behind an OpenAI-compatible endpoint that supports tool calling. Qwen3-Coder-Next and Qwen3.6-35B-A3B are the strongest picks on a 24GB card; smaller tool-calling models run on 12–16GB but degrade noticeably on multi-file tasks. Non-tool-calling models connect fine and then do nothing — that’s the trap to check first.

Can I import my OpenCode config? Not directly — MiMo Code uses mimocode.jsonc with a slightly different provider schema, so plan on a few minutes of manual translation. Your MCP servers and general workflow carry over conceptually, but the config files are not interchangeable.

Sources

Was this article helpful?