NewsAI & DevelopmentOpen Source

llama.cpp v0.4.1: –load-mode Replaces Three Flags

llama.cpp v0.4.1 terminal showing --load-mode flag replacing --mmap and --mlock flags

llama.cpp tagged v0.4.1 on September 14 and quietly broke every deployment script still passing --mmap, --mlock, or --direct-io. All three flags are gone. If you’re running llama-server via a systemd unit, a Docker entrypoint, or a shell script pinned to those arguments, your invocation will throw an invalid argument error until you update it. The replacement is a single --load-mode flag with six explicit values. This is not a dramatic change — but it will catch you at the worst possible moment if you don’t fix it before you upgrade.

Migrate Your Scripts Before Upgrading

The mapping is straightforward for most cases. Here’s what changes:

Old flag–load-mode equivalent
(default, nothing)auto
--mmap--load-mode mmap
--mlock--load-mode mmap+mlock
--direct-io--load-mode dio
--no-mmap --no-mlock--load-mode none

The most common pattern — --mlock to keep the model pinned in RAM — becomes --load-mode mmap+mlock. Before, --mlock implied --no-mmap. Now it does not. There’s one edge case worth knowing: if you were running --no-mmap --mlock for MoE expert CPU offload, that exact combination has no clean replacement. The --load-mode mlock value behaves differently. GitHub issue #26110 tracks this regression.

# Breaks on v0.4.1 — fix before upgrading
llama-server --mlock -m model.gguf

# Correct v0.4.1 equivalents
llama-server --load-mode mmap+mlock -m model.gguf  # was: --mlock
llama-server --load-mode mmap -m model.gguf         # was: --mmap
llama-server --load-mode dio -m model.gguf          # was: --direct-io
llama-server --load-mode none -m model.gguf         # was: --no-mmap --no-mlock

If you embed libllama directly in a C++ project, there’s a second API-level break: llama_sampler_chain_n() now returns int32_t instead of int. A rebuild will catch it, but a mismatch in the header won’t always fail loudly at runtime. Check the full release notes before upgrading any embedding project.

JSONL Logging: Production Monitoring Arrives

The least-headlined addition is the one that matters most for anyone running llama.cpp in a real workflow. Pass --log-jsonl to llama-server (or set LOG_JSON=1) and you get machine-readable per-request logs: latency, token counts, slot assignment, and request parameters. This is not a cosmetic feature — it’s what makes llama.cpp scrapable by Prometheus, shippable to Grafana Loki or Datadog, and debuggable inside an agent pipeline. Structured logging is the line between a server you run and a service you operate.

Maple 20B-A1B: A 20-Billion-Parameter Model on Your CPU

v0.4.1 adds support for three new model architectures. The notable one is Maple 20B-A1B — a ternary mixture-of-experts model whose initial llama.cpp implementation is CPU-only. No CUDA, no Metal. Weights stored as -1, 0, or +1 are dramatically more compact than float16, and when only a fraction of experts activate per token, effective memory use drops further. GPU support will follow; the CPU-first landing is what deserves attention. Tencent Hunyuan 4 (preview architecture hy_v4) and Spark2.5 also arrive in this release.

What Arrived in v0.4.0 Two Weeks Earlier

The September 4 release started this versioning era. llama.cpp moved from build numbers — b10105-style identifiers — to numbered releases with migration notes. That shift matters: it’s an acknowledgment that downstream tools need a stable contract to pin against. v0.4.0 added --lazy-mode for on-demand tensor loading in large MoE models, --kv-unified-per-slot for per-slot server context limits in multi-user deployments, and model support for Qwen3.8-Flash-Next and Nemotron-3-Puzzle-75B-A9B.

The Plumbing Is Finally Serious

Look at what v0.4.0 and v0.4.1 together shipped: numbered versioning with migration docs, structured JSONL logging, server subprocess routing for multi-model deployments, per-slot context management, and a JSON schema refactor for reliable structured output. None of those are capability headlines. All of them are what you build when local AI is running in production pipelines and someone is on the hook for keeping it up. llama.cpp in 2024 was a project you ran. In late 2026, it’s a service you operate. These two releases make that transition explicit.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:News