Documentation

34.8 Embedded, server, and mock backends

Embedded, server, and mock backends

The embedded backend runs llama.cpp inside nlmx with a local GGUF and does not require network access. The server backend speaks an OpenAI-compatible HTTP API. By default its URL must resolve to localhost/127.0.0.1 and only plain HTTP is supported; [policy] allow_remote_server=true is an explicit expansion of the data boundary.

How the mechanism works

The mock backend replays JSON replies and is intended for tests, demonstrations, and policy rehearsal. It still passes actions through the real policy and can run real commands, as the Chapter 34 sessions demonstrate. Mock means scripted language-model behavior, not simulated guardrails.

Evidence from nlmx 4.16.1

Model backend changes where request/context text is processed, not the downstream nlmx verification. Grammar and JSON-mode support also differ: embedded grammar is direct; servers may accept or reject response-format constraints.

What the mechanism protects—and what it does not

The mechanism controls a defined part of the workflow. It does not make the model’s prose correct, select the right scientific question, validate external data, or transfer accountability away from the user. Treat policy safety, computational success, statistical adequacy, and scientific validity as separate conclusions.

Review practice

Before enabling a remote server, document endpoint ownership, authentication and transport limitations, data classification, prompt content, logging, retention, jurisdiction, incident response, and approval. A loopback-looking URL should still be checked for local proxy behavior.

For a novice, read the human transcript first, then the JSONL event log, exact settings/commands, and native command outputs. “The session completed” describes the outer process only; individual proposals may have been planned, declined, refused, failed, corrected, or executed.

Evidence to retain

  • nlmx version/build, backend identity, .ask settings, policy, limits, and system prompt;
  • request, raw replies, help/manual/file context events, confirmations, refusals, and corrections;
  • every settings version and exact executed command, with child exit status and full output;
  • reviewer interpretation, unresolved warnings, scientific limitations, and final disposition.

See the previous page, next page, and guardrail, policy, and audit index.