Friday, 27 November 2026

llmgo is public: fresh food for your LLM

Today I'm releasing llmgo, the inference engine I wrote to run Marvin, as a public Docker image:

docker pull jlcox1970/llmgo

In I Like Dog Food I wrote about swapping llama.cpp out of Marvin for an engine of my own, and in the follow-up I took it from answering in gibberish to 61 tokens a second. It has run Marvin every day since. Now you can run it too.

What llmgo is

llmgo is the software that runs an AI model on your own graphics card. You give it a GGUF model file, and it answers through the same OpenAI-compatible API that most AI tools already speak, so anything that can talk to a cloud model can talk to it. Nothing leaves your machine.

I wrote it in Go, with my own CUDA kernels. It ships as a single container built from scratch: no operating system, no shell, no Python, just the engine and the libraries it links against. That was the reason I started it in the first place. I wanted the thing at the centre of Marvin to be small enough that I could actually audit it.

What it does

  • It picks its own settings. I designed llmgo to look at the host and decide for itself: the whole model on the GPU when it fits, layers split between GPU and CPU when it doesn't, and the CPU alone when there's no usable GPU. It sizes the context and the K/V cache type to the VRAM you have free, and times its kernels on your card at startup, caching the results for the next start.
  • It guesses ahead. Qwen3.5-family models carry their own multi-token prediction (MTP) layer. llmgo uses it to draft up to 15 tokens ahead and checks them all in one pass, which is where most of the decode speed comes from.
  • It remembers. A prompt cache, in RAM and optionally on disk, means a long conversation doesn't start from scratch every turn. Only the new part of the prompt is processed.
  • It shows its work. Prometheus metrics on port 9091, so you can watch a real working session rather than a benchmark.

The numbers

On my RTX 5060 Ti 16 GB with Qwen3.8-27B, against llama.cpp running the same model with its own MTP drafting turned on:

llmgollama.cpp (MTP)
Decode, ~60k context68 tok/s38 tok/s
Decode, ~76k context and beyond65 tok/s33 tok/s
Prefill, ~10k prompt887 tok/s887 tok/s

Decode, the speed it writes its answer, is where llmgo pulls away, and the gap widens as the conversation gets longer. Prefill, the speed it reads your prompt, is level. I'd rather show that than leave it out.

How I measured

  • Card: RTX 5060 Ti 16 GB, the whole model on the GPU.
  • Model: Qwen3.8-27B-UD-Q2_K_XL, the same file for both engines.
  • Shared settings: 130,000 tokens of context and a q4_0 K/V cache for both.
  • llama.cpp: the official full-cuda image with flash attention, a 1024-token batch, one slot, its prompt cache, and MTP speculative decoding (--spec-type draft-mtp --spec-draft-n-max 2).
  • llmgo: the defaults in the public image, which draft up to 15 tokens and verify only as many as pay for themselves.
  • Workload: the same prompts on both, taken from real Marvin sessions. The llmgo figures are medians over one pod's working life of 170 requests.

One caution I learned the hard way: with speculative decoding, tokens a second moves with how predictable the answer is. The same build can score 54, 51 and 50 on three different answers. These figures are what I see on real work, not a guarantee for yours. The run-by-run story of how llmgo got here, with every build charted, is in From gibberish to 61 tok/s.

Try it

You'll need an RTX 30, 40 or 50 series card, NVIDIA driver 570 or newer, and the NVIDIA Container Toolkit. I don't ship a model in the image, so point it at your own GGUF file:

docker run --rm --gpus all -p 8080:8080 -p 9091:9091 \
  -v /path/to/models:/models:ro \
  -e MODEL_PATH=/models/<your-model>.gguf \
  jlcox1970/llmgo:latest

Once the model is on the GPU (about a minute for a 27B), send requests to http://localhost:8080/v1/chat/completions. Older cards aren't supported on the GPU, but llmgo will still run there on the CPU.

It supports Qwen3.5 (with MTP drafting), Qwen3, Qwen2, Qwen3.5 MoE on the CPU, nomic-embed-text for embeddings, and image input through a Qwen3.x mmproj file. The full list of settings, endpoints and my Kubernetes notes are on the Docker Hub page.

What's not here yet

I'll publish the source code later. For now llmgo is available as the image. It includes code I adapted from ggml/llama.cpp (MIT) and the Qwen chat template (Apache 2.0), credited in /usr/share/doc/llmgo/ inside the image.

I've tested it on two cards, my RTX 5060 Ti 16 GB and my RTX 3050 8 GB. If you run it on something else, I'd like to know how it goes.

Tell me what breaks

The comments below are the place for questions, your numbers on other cards, and any bugs you hit. Include your card, the model file and what you asked it, and I'll take a look.

Back in April I was told I wouldn't be any good in AI because I didn't know GPUs. Now the engine I wrote is on the shelf for anyone to pull. Enjoy the food.

Friday, 13 November 2026

Don't Let the Model Decide If It's Safe

This series has built up a fairly uncomfortable picture. In part one, a model with tools turned out not to need to escape anything, because it can persuade its environment to act for it. In part two, a model could carry learned behaviour that no current technique can rule out. In part three, content that looks harmless to a person could mean something quite different to the model reading it.

So what do you actually do? Before getting to that, one caution against overcorrecting.

Not every odd action is a backdoor

A model that tries to write a Python script and run it is not showing you a backdoor. It has most likely just learned a very common agentic workflow:

  1. Identify a task.
  2. Write a helper script.
  3. Try to execute it.
  4. Inspect the result.

Models will also happily assume a capability exists when the framework never gave them one. It helps to separate four behaviours that can look very similar in a single interaction:

BehaviourWhat it means
Capability knowledgeThe model knows a task could be done with a script or tool
Capability assumptionThe model believes a capability is available when it isn't
Capability seekingThe model tries to get access to something it doesn't have
Conditional malicious behaviourThe model performs an unauthorised action under particular circumstances

Seeing one of these does not prove any of the others. The real concern is subtler. The same learned agentic skill that makes a model useful also makes it a very effective middleman for harmful instructions. You cannot train that out without training out the usefulness, so you have to contain it.

Build for the bad case

The goal is not to assume every model is trustworthy, and it is not to assume every model is hostile either. The goal is an architecture that limits the damage when a model, a plugin or a document turns out to be malicious.

Separate the permissions

Don't give one agent every capability. Split them out:

  • Reading files.
  • Writing files.
  • Executing code.
  • Installing packages.
  • Registering or loading plugins.
  • Modifying persistent skills.
  • Accessing credentials.
  • Making outbound network connections.
  • Uploading files or data.

Being able to read a file should not automatically mean being able to execute something derived from it.

Treat everything the model reads as untrusted

Documents, spreadsheets, plugin metadata, retrieved content and external instructions are all untrusted input. The system needs to keep track of where each instruction came from:

  • Instructions the user authorised.
  • Instructions the framework controls.
  • External content being analysed.
  • Instructions found inside that external content.

The model should never be able to quietly promote the last category into one of the first two.

Make persistence expensive

A temporary action and a persistent change are not the same risk. Installing a plugin, changing a skill, editing agent configuration, or writing into a directory that gets auto loaded should all need explicit authorisation and leave an audit trail.

Lock down the network

Outbound access should be limited to the destinations and protocols the task actually needs. Where you can, authorise and log file uploads and external data transfers separately.

Review what the model will read, not just what will run

Plugin and document review has to include the content the model will consume. For structured files that means hidden sheets, metadata, embedded objects and comments, everything that doesn't show up in the normal UI. It also means looking at how the model is being told to interpret that content.

Log the whole chain

The final tool call is the least interesting part of an incident. Useful logs capture:

  • Where the information that prompted the action came from.
  • The tool request the model generated.
  • The identity and permissions of the tool.
  • The files or resources accessed.
  • Any persistent changes.
  • Any outbound network activity.
  • Whether a human or a policy layer approved it.

That lets you investigate a suspicious sequence as a sequence, rather than as a pile of individual operations that each looked fine.

Trust as evidence, not a badge

"Is this model safe?" is the wrong question, because nobody can answer it. A more useful approach is to describe how much evidence you actually have:

CategoryMeaning
UnverifiedSource and training provenance are unknown
Publisher verifiedDistribution identity and artefact integrity are established
Training documentedAvailable information about training and fine-tuning is documented
Behaviour evaluatedThe model has undergone documented behavioural testing
Agent testedThe model has been evaluated with the intended tools and execution environment

These are levels of assurance, not guarantees. A model at the top of that table can still be carrying a behaviour nobody has triggered yet. What the table does give you is an honest way to decide how much capability a given model should be handed.

The principle

The security risk of agentic LLMs goes well beyond malicious code. A model can learn conditional behaviour in training. It can interpret instructions buried in external data. It can act through whatever tools its framework hands it. Plugins add risk from their host side code and, just as much, from the data they feed the model.

None of that means every unusual action is an attack. The hard part is telling expected agentic behaviour apart from conditional, unauthorised behaviour, and you often can't do that from a single interaction.

Which is why the most important defence is architectural:

Do not rely on the model to decide whether its own actions are safe.

Treat models, plugins, documents and external content as potentially untrusted. Restrict what the agent can do, keep temporary work apart from persistent changes, control the network, and put independent authorisation in front of anything sensitive.

That is the approach I have taken with Marvin from the start. Security is part of the design, not a layer added later.

The model may be the component making the decision. The surrounding system decides what that decision can actually do.

The Model as a Semantic Decoder

The last post covered behaviour hidden inside the model. This one turns it around. What about information hidden in the things the model reads, information a person would miss but the model would pick up straight away?

This is the part of the threat model I find most interesting, and the part most security reviews are not set up to catch.

A spreadsheet with more in it than you think

Take an ordinary workbook. On screen it shows one sheet of figures. Underneath, it might also have hidden sheets, hidden rows, comments, metadata or embedded objects. A person opening it in a spreadsheet app sees the visible sheet and moves on.

An LLM processing the same file gets all of it. It can find the hidden content, make sense of it, and act on it. It might remove flags, change values, or write instructions based on something nobody else in the room knew was there.

Nothing was decrypted and nothing was exploited. The information was already in the file. The model just read it more completely than a person would.

Encoding is not encryption

It helps to be precise here. Strong encryption is designed so that nothing meaningful can be recovered without the key, and an LLM cannot defeat sound encryption by staring at ciphertext. That is not the threat.

The threat is information that is:

  • Encoded rather than encrypted.
  • Obscured inside a document or data structure.
  • Split across several fields or locations.
  • Disguised as ordinary configuration or metadata.
  • Only meaningful when combined with the surrounding context.
  • Written in a convention the model has learned to recognise.

Simple encodings like Base64 or hex are not the hard case. Scanners already flag those. The hard case is content whose meaning depends on semantic interpretation. It looks like a normal config value or a normal note, and it only turns into an instruction once something that understands language reads it in context.

The model as decoder

When that happens the model is acting as a semantic decoder. What it decodes does not have to be code or a command. It could be a description of desired behaviour, or data the model turns into a tool request or a script.

At a high level the sequence looks like this:

  1. A plugin or document supplies data that looks harmless.
  2. The agent reads or processes that data.
  3. The model recognises a meaningful pattern or instruction in it.
  4. The model folds that into its reasoning about the task.
  5. The model generates a tool request, code or other actionable output.
  6. The framework executes it, if its permissions allow.

Notice that the plugin in step one may have no software vulnerability at all. This is a model mediated interpretation problem. The plugin's code is fine. Its data is the issue.

Related, but not the same thing

Several existing ideas overlap with this:

  • Steganography: hiding information inside another file or data stream.
  • Instruction concealment: presenting instructions in a form a human reviewer would not recognise.
  • Indirect prompt injection: feeding instructions to the model through external content it processes.
  • Neural backdoors: learned conditional behaviour in the weights, as covered in the last post.
  • Polyglot and malformed documents: files that different tools or layers interpret differently.

These are not interchangeable. A hidden sheet is not automatically a prompt injection, and an encoded instruction is not automatically a backdoor. The real risk is when they combine. Picture a model with a learned trigger, reading a document that quietly supplies the rest of the condition, inside an agent that can act on the result.

Plugins have two sides

Inference frameworks commonly support extensions of various kinds: model plugins, platform plugins, logits processors, IO processors, custom operators and attention backends. Each one is a piece of the software supply chain, and many of them have both a host side and a GPU side. Those two sides are very different from a security point of view.

Host side code, the Python or C++ loaded into the inference process, generally runs with that process's operating system permissions. Depending on the deployment that can mean:

  • Files the process can read or write.
  • Environment variables and credentials.
  • Network connections.
  • Anything else the container or host allows.

A malicious host side plugin does not need to break GPU memory isolation to get at any of that. It is already inside the process.

GPU side code is more contained. A CUDA kernel works within the memory and execution environment the CUDA runtime gives it. It does not automatically get access to host memory, other processes or unrelated GPU allocations.

So a plugin is not one security boundary. It is two, with very different reach. In practice the more immediate risk is usually the boring one: a trusted host process loading untrusted extension code.

What inspection has to change

Traditional security review looks at executable code, dependencies and known file formats. That is not enough when the component consuming the content is an LLM. A plugin can contain almost no code and still supply information that changes what the model does.

Review now has to ask two questions:

  1. What can this plugin execute?
  2. What can this plugin cause the model to interpret, generate or request?

The first one we know how to answer. The second is much harder, because the answer depends on the model, the prompt, the surrounding documents and the tools available. You cannot answer it by reading the source code.

What's next

Three posts in, the picture is a model you cannot fully verify, reading content you cannot fully inspect, inside a framework that can act on what it decides. The final post is about what to do about that. The short version is that you stop asking the model to be the safety layer. Read part four.