{"slug": "hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime", "title": "Hermes Agent adapter for Inkling-2-Mini: patching a LoRA into a model my runtime can't load", "summary": "A developer patched the harness-hub LoRA adapter for Inkling-2-Mini directly into the model's GGUF weights after finding that Basalt 0.6.2 and Maya v1.1.91 cannot load adapters at runtime. Naively dequantizing the Q8_0 attention projections, adding the rank-32 correction and requantizing discarded most of the adapter, because the delta's norm is only 0.16–0.23% of the weight norm and falls below one quantization step. The developer reports the workaround let Hermes Agent run real coding tasks with and without the adapter, which harness-hub says cuts steps and output length.", "body_md": "I use [Hermes Agent](https://github.com/NousResearch/hermes-agent) every day. It's an open-source AI agent from Nous Research: you give it a task, and it works on it by itself with tools like a terminal, file editing and web search. Hermes can run on a cloud model, but it can also hand work to a model on your own machine. Mine sends most of its coding tasks to Inkling-2-Mini, which runs locally on an RTX 5090 with [Basalt](https://github.com/jesdga95/basalt).\n\nThis week harness-hub published [an adapter](https://huggingface.co/harness-hub/Inkling-2-Mini-hermes-adapted) for exactly that combination: Inkling-2-Mini as the model behind Hermes Agent. An adapter (a LoRA) is a small add-on of about 50 MB that adjusts a model's behavior without retraining the whole model. This one was trained by letting Inkling do real tasks inside Hermes and rewarding it when it solved them well. According to harness-hub, the result solves more coding tasks with fewer steps and less text.\n\nThere was one problem. Basalt can't load an adapter (there's an open feature request for it), and neither can Maya, the other runtime I use for this model. So I put the adapter into the model file itself. The obvious way to do that threw most of the adapter away. This article shows why, what worked instead, and what changed when I let Hermes do real tasks with and without the adapter.\n\nVersions used: Basalt 0.6.2, Maya v1.1.91, Hermes Agent v0.23.1, Python `gguf` 0.19, one RTX 5090 (32 GB).\n\nEvery agent talks to its model in its own way. Hermes has its own system prompt, its own set of tools, and its own format for tool calls and results. A general model handles that fine, but not always efficiently: it reads a file it already read, runs an extra check, or writes a long explanation nobody asked for. Each of those steps costs time and tokens.\n\nThat's what this adapter targets. It doesn't teach Inkling new knowledge. It teaches it to work the way Hermes expects, so it gets to the answer in fewer steps. harness-hub makes separate adapters per agent (they also have versions for Codex, OpenCode, Claude Code and pi), because what works in one agent doesn't automatically carry over to another.\n\nFor my setup that's a good fit. When Hermes gets a coding job, it hands it to a sub-agent that runs on the local Inkling. That sub-agent is Hermes too, so every one of those tasks runs exactly in the setting the adapter was trained for.\n\nThe first thing to check is which weights a LoRA changes. `adapter_config.json` and the tensor names in the LoRA GGUF tell you:\n\n```\nadapter.type        lora\nadapter.lora.alpha  64.0\nblk.0.attn_k.weight.lora_a       [2304, 32]  F16\nblk.0.attn_k.weight.lora_b       [32, 1024]  F16\nblk.0.attn_output.weight.lora_a  [3072, 32]  F16\n...\n```\n\nRank 32, alpha 64, and only four targets per layer: the attention projections `attn_q`, `attn_k`, `attn_v` and `attn_output`, over all 24 layers. That's 96 tensors. The experts aren't in it.\n\nThat matters, because in both of my model files the routed experts are mostly NVFP4, taken bit for bit from the official release. Changing them would mean quantizing them again. The attention projections are plain Q8_0, about 480 MB in total. That part I can change.\n\nA LoRA is a small correction on top of existing weights: for each target it stores two thin matrices, and their product (times `alpha / r = 2`) is added to the original weight. The straightforward way to bake it in: unpack the Q8_0 weight, add the correction, pack it to Q8_0 again.\n\n```\nw = quants.dequantize(raw, Q8_0).reshape(d.shape)\nmerged = quants.quantize(w + d, Q8_0)\n```\n\nIt runs fine and the model loads. But the correction is tiny. Its norm is 0.16 to 0.23% of the weight's norm. Q8_0 stores blocks of 32 values as 8-bit integers with one scale per block, and for most values the delta is smaller than one quantization step. Rounding again snaps them back to where they were.\n\nharness-hub also publishes [a merged Q8_0 GGUF](https://huggingface.co/harness-hub/Inkling-2-Mini-hermes-adapted-GGUF), made from the BF16 base plus the LoRA. That gave me something to compare against. For `blk.0.attn_q.weight`:\n\nIn plain terms: in my version, most of the adapter was rounded away, and what changed was mostly noise. Merging at BF16 and quantizing once keeps far more of it.\n\nIf the maker's merged file stores the same tensors in the same type and shape as my pack, I don't need to merge anything. I can copy their 96 Q8_0 tensors byte for byte into my file and keep everything else: the NVFP4 experts, the drafter, the vision encoder, the tokenizer.\n\nTheir merged GGUF is 27.8 GB, mostly experts I don't want. Downloading only the parts I need works with HTTP range requests:\n\n`truncate -s`).` gguf.GGUFReader` to get each tensor's offset and size.\nThat's about 480 MB instead of 27.8 GB.\n\nThen the copy. `cp --reflink=auto` makes a copy-on-write clone of my pack, and the script writes the new bytes in place. The sizes are identical, so nothing shifts. On btrfs the new 19 GB pack takes 459 MB of extra disk space.\n\nFor Maya's GGUF that's all. A `.basalt` pack needs two more steps:\n\n`meta` section, relative to the start of the `gguf` section.\n\n```\n# recompute the gguf section's SHA-256 in the .basalt header\nwith open(dst, \"r+b\") as f:\n    head = bytearray(f.read(MF.HEADER_BYTES))\n    n = MF.HEADER.unpack_from(head, 0)[2]\n    for i in range(n):\n        o = MF.HEADER.size + i * MF.ENTRY.size\n        name, off, size, _, rest = MF.ENTRY.unpack_from(head, o)\n        if name.rstrip(b\"\\0\") == b\"gguf\":\n            MF.ENTRY.pack_into(head, o, name, off, size, digest, rest)\n    f.seek(0)\n    f.write(head)\n```\n\n`MF` is `tools/model_file.py` from the Basalt release, which also has `ModelFile.verify()`. After patching, the `gguf`, `meta` and `experts` sections all verified.\n\nI wanted two things from the test: the speed shouldn't drop, and Hermes should actually work better with it on my own tasks, not just on someone else's benchmark.\n\nOn Basalt I ran the arms alternately (base, adapter, adapter, base) to even out warm-up and thermals. Every arm ran the same set:\n\nThe agent tasks are small but real: a bug spread over two files in a pagination module, a function to implement from a docstring with hidden tests, a script that crashes on a config value, a rename across a package, finding a setting in 40 files, a CSV aggregation, and a log analysis. Each has a check script the agent never sees. I verified every check twice before using it: it must fail on the untouched task and pass on a reference solution. One of my own expected values was wrong the first time (I'd rounded 30.855 the wrong way), so that step is worth it.\n\nThe numbers per run come from the agent's own session database: tool calls, output tokens and duration.\n\nOn Basalt:\n\n|  | Base | With adapter | \n|---|---|---|\n| Decode, prose / code | 252-253 / 527-529 tok/s | 255-257 / 537 tok/s | \n| Prefill at 8K | 22,700-22,900 tok/s | 22,700 tok/s | \n| Use-case benchmark | 54/54, 9,001 and 11,828 tokens | 54/54, 6,968 and 7,680 tokens | \n| Agent tasks passed | 31/32 | 32/32 | \n| Tool calls | 115 | 94 (-18%) | \n| Output tokens | 26,081 | 19,215 (-26%) | \n| Total time | 162 s | 142 s (-12%) | \n\nSpeed is the same, which makes sense: only the attention weights changed, not their size or type. The difference is in behavior. With the adapter, Hermes reached the same results with fewer tool calls and less text, which is exactly what the adapter was trained for. That matches what harness-hub reports, fewer output tokens and fewer tool calls at an equal or higher pass rate, although their benchmarks are much harder than mine.\n\nOn Maya there was no gain. Both versions passed all 16 agent runs with about the same number of tokens, and code decoding with the adapter was 13% slower. My guess is the speculative drafter, which was trained against the original attention weights and now predicts a little worse. I didn't dig into it, because the Basalt result was clear.\n\nThe adapter pack is now the default for Inkling on my machine, so every coding task Hermes hands to the local model uses it. The original pack stays next to it for rollback.\n\nThe short version: when a LoRA is much smaller than one quantization step, don't merge it into quantized weights. Merge it at full precision once, or find someone who already did, and copy only the tensors that changed.", "url": "https://wpnews.pro/news/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime", "canonical_source": "https://dev.to/seppegadeyne/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime-cant-load-2an6", "published_at": "2026-12-04 19:37:21+00:00", "updated_at": "2026-12-04 19:44:30.105568+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "ai-tools", "mlops", "ai-infrastructure"], "entities": ["Hermes Agent", "Nous Research", "Inkling-2-Mini", "Basalt", "Maya", "harness-hub", "RTX 5090"], "also_reported_by": [], "takeaway": "Baking a LoRA into Q8_0 weights by dequantize-add-requantize loses most of the correction when the delta norm is under ~0.25% of the weight norm, so the adapter must be merged at higher precision or kept separate.", "recommendation": {"advice": "Check the LoRA's target tensors and delta-to-weight norm ratio before merging; if the delta is below one quantization step, merge at higher precision or keep the adapter unquantized.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime", "markdown": "https://wpnews.pro/news/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime.md", "text": "https://wpnews.pro/news/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime.txt", "jsonld": "https://wpnews.pro/news/hermes-agent-adapter-for-inkling-2-mini-patching-a-lora-into-a-model-my-runtime.jsonld"}}