self-hosted/ai
§01·recipe · llm

North Mini Code 1.0 on RTX 3090: Local Agentic Coding via llama.cpp + OpenHands (24GB Entry Tier)

llmadvanced24GB+ VRAMJul 3, 2026

This advanced recipe sets up North Mini Code 1.0 on the RTX 3090, needing about 24 GB of VRAM.

models
tools
prerequisites
  • NVIDIA RTX 3090 (24GB VRAM) — this is the entry tier for North Mini Code; the Q4_K_M GGUF at ~17.5 GB leaves only ~6 GB for the KV cache, so context is the binding constraint (see below)
  • Python 3.10+ (for the OpenHands agent client)
  • A recent llama.cpp or Ollama build that includes cohere2_moe architecture support — the arch landed in the b9626 build (see Installation); the GGUF was quantized with release b9630
  • ~18GB free disk for the Q4_K_M GGUF weight file

What You'll Build

A local, private agentic-coding setup: North Mini Code 1.0 — Cohere Labs' open Apache-2.0 Mixture-of-Experts coding model — served as an OpenAI-compatible endpoint by llama.cpp on a single 24GB RTX 3090, driven by the OpenHands coding agent so the model can read your repo, run shell commands, and edit files. North Mini Code is a 30B-A3B MoE (30B total parameters, ~3B active per token) built for pure agentic coding: it emits native JSON-schema tool calls and supports interleaved thinking (a reasoning stream alongside its tool calls). This recipe uses the third-party Q4_K_M GGUF (~17.5 GB on disk) — the quant that fits a 24GB card with real working context.

Hardware data: RTX 3090 (24GB VRAM) · North Mini Code 1.0 Q4_K_M GGUF (~17.5 GB weights) · moderate-context, comfortable fit · See benchmark data

ℹ️ Apache-2.0 — commercial use is allowed. North Mini Code 1.0 ships under Apache-2.0, which is notable because Cohere's open weights usually land under the non-commercial CC-BY-NC. Apache-2.0 is a permissive license: you may use, modify, and deploy this model commercially. Confirm the terms against the model card before you ship.

ℹ️ An MoE keeps all experts resident — the file size is the VRAM cost. North Mini Code is a 128-expert Mixture-of-Experts that activates 8 experts per token (~3B active parameters). The low active count is a speed property — it does not shrink VRAM. All 128 experts stay loaded, so the memory footprint is the full quant file: ~17.5 GB at Q4_K_M, not some smaller "active" fraction. Do not expect the ~3B-active figure to reduce the memory requirement.

⚠️ 256K context does NOT fit on a 24GB card. The model's context window is 256K tokens (config max_position_embeddings 500000), and its attention interleaves a 4096-token sliding window with periodic global attention — which makes the KV cache at long context large. With ~17.5 GB of weights resident, the RTX 3090 has roughly 6 GB left for the KV cache. That is enough for a healthy short-to-moderate working context, but not for the full 256K — that needs a 32GB+ card or aggressive KV-cache quantization. This recipe caps context deliberately; read the Running section before you launch.

Requirements

ComponentMinimumTested
GPU24GB VRAM (this is North Mini Code's floor at Q4_K_M)RTX 3090 (24GB, Ampere GA102, sm_86)
RAM16GB system RAM (32GB comfortable for the agent + repo)
Storage~18GB (the Q4_K_M GGUF is ~17.5 GB)18.74 GB file (North-Mini-Code-1.0-Q4_K_M.gguf)
Softwarellama.cpp or Ollama with cohere2_moe support; Python 3.10+ for OpenHandsllama.cpp llama-server (b9626+), OpenHands

There is no first-party GGUF — Cohere Labs ships safetensors plus fp8 and w4a16 quants only, and points to community quantizations, per the North Mini Code 1.0 model card. This recipe uses the vetted imatrix GGUF from bartowski: the Q4_K_M file is 18.74 GB (18,744,024,640 bytes → ~17.5 GiB) per the bartowski/North-Mini-Code-1.0-GGUF file tree. Neighbouring quants there are Q3_K_M ~14.2 GB, IQ4_XS 16.58 GB, Q4_K_M 18.74 GB, Q5_K_M 21.85 GB, Q6_K 26.4 GB, and Q8_0 32.44 GB — of these, Q5_K_M (20.34 GiB) is a tight fit on a 24GB card that leaves almost no KV headroom, so Q4_K_M is the recommended quant for this GPU.

Installation

1. Install llama.cpp with cohere2_moe support

North Mini Code uses the cohere2_moe architecture (Cohere2MoeForCausalLM). Support for this arch was added to llama.cpp in PR #24260 and first shipped in the b9626 build; bartowski quantized the GGUF with release b9630, per the bartowski GGUF model card. You need a llama.cpp new enough to include that arch — an older binary will fail to load the model with an unknown-architecture error. Build from source at a recent commit, or use a b9626-or-later release binary, per the llama.cpp README:

# Build from source with CUDA (guarantees a recent-enough arch table)
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j

The RTX 3090 is Ampere (GA102, sm_86) and is fully supported by a standard CUDA build — no special wheel or FP8 path is needed (the GGUF quants are integer formats, so the absence of FP8 tensor cores on Ampere is irrelevant here).

2. Download the Q4_K_M GGUF

llama-server can pull the GGUF straight from Hugging Face and cache it locally. The -hf flag takes <user>/<model>:<quant>:

# Downloads North-Mini-Code-1.0-Q4_K_M.gguf (~17.5 GB) into the llama.cpp cache on first use
llama-server -hf bartowski/North-Mini-Code-1.0-GGUF:Q4_K_M --port 8000

The first launch downloads ~18 GB; subsequent launches reuse the cached file. To download explicitly first, grab North-Mini-Code-1.0-Q4_K_M.gguf from the GGUF repo files tab and pass it with -m <path> instead.

3. Install the OpenHands coding agent

OpenHands is an open-source agentic-coding client that drives any OpenAI-compatible endpoint:

pip install openhands-ai

Alternatively, run the OpenHands Docker image — in that case point its base URL at http://host.docker.internal:8000/v1 so the container can reach the llama.cpp server running on your host. Aider and Cline are drop-in alternatives; both drive the same OpenAI-compatible endpoint.

Running

1. Serve North Mini Code with the correct chat template

This is the step that makes or breaks tool-calling. North Mini Code ships a custom chat template (chat_template.jinja) that carries tool_call_id and the interleaved-thinking format; the model card documents its tool-calling as JSON-schema function calls with a reasoning field, per the model card. A generic ChatML path will break tool-calling — the model won't emit clean tool calls and OpenHands won't be able to edit files.

Two gotchas the maintainers called out on the arch-support PR (#24260): (a) Cohere ships two conflicting templates — an outdated one in tokenizer_config.json and the current one in chat_template.jinja; some GGUFs embed the wrong one. (b) The reference template for GGUFs lives at models/templates/Cohere2-MoE.jinja in the llama.cpp tree. Serve with --jinja so llama.cpp applies the GGUF's embedded Jinja template rather than a built-in fallback, and if tool-calling still misbehaves, point it explicitly at the reference template with --chat-template-file:

llama-server \
    -hf bartowski/North-Mini-Code-1.0-GGUF:Q4_K_M \
    --port 8000 \
    --jinja \
    -ngl 99 \
    -c 32768 \
    -fa on \
    -ctk q8_0 -ctv q8_0
  • --jinja enables the model's own Jinja chat template — required for the interleaved-thinking + tool-call format to work in an agent client.
  • -ngl 99 offloads all layers to the GPU (the ~17.5 GB Q4 file plus the KV cache must sit in VRAM — see the MoE note above).
  • -c 32768 caps context at 32K. This is a deliberate, comfortable starting point for the 3090 — well under the model's 256K ceiling, which does not fit here. Raise or lower it while watching nvidia-smi (see Troubleshooting).
  • -fa on enables Flash Attention, and -ctk q8_0 -ctv q8_0 quantize the K and V caches to 8-bit — roughly halving KV-cache memory versus the fp16 default, which buys back usable context.

This exposes an OpenAI-compatible API at http://localhost:8000/v1. Ollama is a valid alternative — it too needs a build with cohere2_moe support, and it applies its own template, so verify tool-calling works before relying on it for agent edits.

2. Point OpenHands at the local server

OpenHands routes through LiteLLM, so a custom OpenAI-compatible endpoint uses an openai/ model prefix, per the OpenHands local-LLM docs:

export LLM_MODEL="openai/North-Mini-Code-1.0"
export LLM_BASE_URL="http://localhost:8000/v1"
export LLM_API_KEY="EMPTY"   # any non-empty string; local servers don't check it

openhands

OpenHands will now use North Mini Code to plan, run shell commands, and edit files in your workspace. Its interleaved thinking drives planning and its native tool-calling drives the file/shell actions.

Results

  • VRAM usage: The Q4_K_M weights are ~17.5 GB (18.74 GB file) and must stay resident, leaving roughly 6 GB of the RTX 3090's 24 GB for the KV cache and activations — which is why context is capped at 32K and the KV cache is 8-bit-quantized above. File sizes are verified via the bartowski GGUF file tree.
  • Quality notes: Cohere reports North Mini Code 1.0 scoring SWE-Bench Verified 80.2% pass@10, Terminal-Bench v2 55.1% pass@10, and mini-SWE-Agent 61.0% pass@1 on agentic-coding evals, per the model card. Those are the vendor's own benchmarks, not a measurement on this GPU. Recommended sampling per the model card is temperature 1.0, top_p 0.95.
  • Speed: North Mini Code 1.0 is brand-new, so there is no community throughput benchmark for it on the RTX 3090 yet — /check/north-mini-code-1-0/rtx-3090 has no benchmark data. We omit the tok/s figure rather than invent one or borrow one from different hardware.

For the full benchmark data, see /check/north-mini-code-1-0/rtx-3090.

Troubleshooting

"unknown model architecture: cohere2moe" (or the model won't load)

Your llama.cpp is older than the build that added cohere2_moe support. The arch landed in PR #24260 (first in the b9626 build); the GGUF itself was made with release b9630, per the bartowski GGUF card. Rebuild from a recent git pull of llama.cpp, or download a b9626-or-later release binary. The same applies to Ollama — you need a version whose bundled llama.cpp includes the arch.

The agent won't edit files / tool calls come out malformed

Almost always a chat-template problem. North Mini Code needs its custom Jinja template for tool-calling; a generic ChatML fallback breaks it. First, make sure you launched llama-server with --jinja (above). If it still misbehaves, the GGUF may carry the outdated template that Cohere ships in tokenizer_config.json rather than the current chat_template.jinja — a mismatch the maintainers flagged on PR #24260. The fix is to pass the reference template explicitly:

# Download the reference template from the llama.cpp tree, then point the server at it
curl -L -o Cohere2-MoE.jinja \
  https://raw.githubusercontent.com/ggml-org/llama.cpp/master/models/templates/Cohere2-MoE.jinja
llama-server -hf bartowski/North-Mini-Code-1.0-GGUF:Q4_K_M --port 8000 \
    --jinja --chat-template-file Cohere2-MoE.jinja -ngl 99 -c 32768 -fa on -ctk q8_0 -ctv q8_0

Out of memory at launch, or the KV cache won't fit

The ~17.5 GB of weights leave ~6 GB on a 24GB card. OOM at startup usually means the context is set too high. Lower -c (try -c 16384), keep -ctk q8_0 -ctv q8_0 and -fa on enabled, and close any other GPU app before launching. Watch nvidia-smi during a real agent task — a hard coding problem produces a long interleaved-thinking stream that grows the KV cache mid-generation, so size for the peak, not the idle load. If you need the full 256K context, that requires a 32GB (e.g. RTX 5090) or larger card, or heavier KV-cache quantization.

torch/CUDA or llama.cpp reports no GPU

Confirm your llama.cpp build has CUDA enabled (GGML_CUDA=ON when building from source) and that -ngl 99 is offloading layers. The RTX 3090 (Ampere sm_86) needs no special flags beyond a standard CUDA build; you do not need FP8 support (the GGUF quants are integer) and you do not need to install flash-attn separately — llama.cpp's -fa on uses its own built-in attention kernels.

common questions
How much VRAM does North Mini Code 1.0 need?

About 24 GB — the minimum this recipe targets.

Which GPUs is North Mini Code 1.0 tested on?

RTX 3090 (24 GB).

How hard is this setup?

Advanced — follow the steps above.