Qwen3.8-27B-Hermes-oQ4 — harness-tuned, lossless-fast on Apple Silicon

A ready-to-serve bundle: the Nous Research Hermes adapter fused into Ash Hart's TensorFold oQ4 conversion of Qwen3.8-27B, served with the DFlash2 drafter for ~3–6× lossless decode on Apple Silicon. ~234 tok/s on code, ~82 tok/s on prose.
No fusing required at install time. Pull, serve with the drafter, and point Hermes Agent (or any OpenAI-compatible client) at it.
The headline is quality, not just speed. The Hermes adapter is RL-trained on the Hermes Agent harness. With thinking off, it reaches the base model's thinking-at-max-effort accuracy while generating 3.5–4.4× fewer tokens per task — thinking-level capability at a quarter of the work. Fused into oQ4 and served with DFlash2, that efficiency becomes local, private, and fast.
What this artifact is
A fused, quantized, serving-ready checkpoint. Three upstream works combined, nothing else changed:
- Base:
Qwen/Qwen3.8-27B(dense vision-language model, Qwen3.5 architecture). - Conversion:
TensorFold/Qwen3.8-27B-oQ4— Ash Hart's mixed-precision MLX oQ4 (4-bit affine base, 160 sensitive modules at 5-bit, one at 6-bit, group size 64). - Adapter:
harness-hub/Qwen3.8-27B-hermes-adapted— the Nous Research Hermes LoRA (r=32, α=64), weight-level fused into the oQ4 weights so no LoRA is needed at serving time.
Served by TensorFold (Ash Hart's native Metal engine) with the DFlash2 block-diffusion drafter (z-lab/Qwen3.8-27B-DFlash2, Inco AI). Decoding is lossless: greedy output matches the target exactly; sampling preserves its distribution.
Model details
| Item | Value |
|---|---|
| Base model | Qwen/Qwen3.8-27B (Apache-2.0) |
| Quantization | TensorFold oQ4 mixed precision, affine, group 64; 160 modules @ 5-bit, 1 @ 6-bit |
| Adapter | harness-hub Hermes LoRA, r=32 α=64, fused (scale 2.0) into 256 target modules |
| Format | MLX safetensors, 4 shards, 2,180 tensors (vision tower intact: 333 tensors) |
| Weight size | ~16.6 GB |
| Architecture | qwen3_5 / Qwen3_5ForConditionalGeneration; 64 layers (48 GatedDeltaNet linear-attn + 16 full-attn), hidden 5120, vocab 248,320 |
| Max configured context | 262,144 tokens |
| Drafter (separate) | z-lab/Qwen3.8-27B-DFlash2 (Apache-2.0), 7 draft tokens/pass |
| Engine | TensorFold 1.3.0 (Apache-2.0), Metal backend |
| License | Apache-2.0 (all components; this card relicenses nothing upstream) |
Quality — the Hermes adapter (upstream evaluation)
The adapter's published gains, measured by harness-hub / Nous Research on the base BF16 weights under the Hermes Agent harness (one attempt/task, 100-step budget, 131,072-token context, thinking off, T=0.8). Reproduced here from the adapter card, not re-measured on this oQ4 build:
| Benchmark | Qwen3.8-27B base | + Hermes adapter (thinking off) | Δ |
|---|---|---|---|
| SWE-bench Pro (hard 51) | 29.4% | 43.1% | +13.7 (10 newly solved / 3 lost) |
| Terminal-Bench 2.1 (85 graded) | 44.7% | 58.8% | +14.1 (19 / 7, p=0.029) |
- Thinking-level accuracy, thinking off: base-with-thinking-xhigh scores 45.1% / 58.8%; the adapter matches it (43.1% / 58.8%) at 3.5–4.4× fewer generated tokens.
- Work per solved task: 22 vs 59 turns (SWE-bench Pro), 8 vs 21 (Terminal-Bench); ~2× fewer tokens. Fewer, more targeted actions instead of long exploration.
- Keep thinking off — as in training. Thinking-on is not significantly more accurate and generates ~3× more tokens; under Hermes Agent it also exhausts context.
Honest scope: these are the adapter's gains on BF16 base weights. oQ4 quantization is lossy; expect a few percent divergence. This bundle's quality is validated by coherence + tool-call spot-checks (below), not re-benchmarked on SWE-bench/Terminal-Bench. Validate on your own workload before production. Full adapter recipe: harness-hub release blogpost.
Performance — measured here (M5 Ultra, TensorFold + DFlash2)
Load- and generation-tested on this bundle's authoring machine:
| Hardware | Configuration |
|---|---|
| Host | Mac Studio, Apple M5 Ultra, 256 GB unified memory |
| Engine | TensorFold 1.3.0, Metal backend |
| Serve | --no-thinking --context 262144 --parallel 1, DFlash2 drafter |
| Resident memory | ~30 GB (parallel 1) / ~69 GB (parallel auto + full 262k KV) |
| Workload | Decode tok/s | Method |
|---|---|---|
| Code, greedy (900-token sustained) | ~234 | T=0, wall-clock, coherent code verified |
| Code, sampled (T=0.7) | ~181 | wall-clock |
| Prose, greedy | ~90 (88–105) | T=0, warm, n=3 |
| Prose, sampled (T=0.7) | ~82 | wall-clock |
| Plain oMLX oQ6, no drafter (reference) | ~40 | same box |
~5.8× code / ~2.2× prose vs plain decode. Lossless: a 900-token run produced a correct thread-safe LRU cache + unittest suite; Hermes tool-calling fires clean through the drafter (get_weather({"city":"Reykjavik"}), finish_reason=tool_calls).
Why prose < code, honestly: DFlash2 speeds decode by predicting tokens. Code is highly predictable → high draft acceptance → ~234. Prose from a high-quality model is less predictable → lower acceptance → ~90. A cruder uniform-4-bit build posted higher prose (~133) partly because its output was more predictable (lower quality). Serve config (
--parallel 1vsauto) does not change this. Speed is workload-dependent; these are one M5 Ultra's numbers, not a cross-platform benchmark. M5 Max/Pro and M1–M4 are slower (bandwidth-bound).
Why these settings
Every choice is a deliberate trade-off, not a default:
| Choice | Why |
|---|---|
| oQ4 mixed precision (not oQ6/oQ8, not uniform 4-bit) | Ash's oQ4 keeps 160 sensitive modules at 5-bit, so quality stays near the base while the pack is ~16.6 GB — fits a 64 GB Mac with room for KV. oQ6 was 22 GB and ~40 tok/s plain; a crude uniform-4-bit requant decoded faster on prose but at a real quality cost (double-quant + more predictable, lower-quality output). oQ4 is the quality/size/speed sweet spot — and TensorFold's --drafter requires a 4-bit target. |
| DFlash2 drafter | The big decode lever: lossless block-diffusion speculation, 7 tokens/pass, ~3–6× on predictable text. Self-MTP is disabled in this checkpoint (mtp_num_hidden_layers: 0), so a separate drafter is the only speculative path. Apache-2.0, so it bundles cleanly. |
| TensorFold engine (not oMLX/LM Studio) | oMLX 0.8.0 has classic draft-model speculation but not the dflash method. TensorFold 1.3.0 is the native Metal engine with DFlash2 support. |
--no-thinking | The adapter is RL-trained thinking-off; thinking-on generates ~3× more tokens with no significant accuracy gain and exhausts context under Hermes Agent. Matches training and the adapter authors' recommendation. |
--context 262144 | The model's native max. Hermes needs ≥64k and agentic sessions grow long; a 256 GB box has RAM for the full KV. On smaller Macs, start lower and watch memory pressure — configured context is a capability, not a guarantee every host can prefill it. |
--parallel 1 | Single-stream daily driver: same decode speed as auto, less RAM (no multi-stream reservation). Use --parallel auto when serving concurrent callers. |
--host 127.0.0.1 | Local-only by default — a private mind, no LAN exposure. Bind wider only deliberately. |
| Weight-level fuse, original sharding preserved | Keeps the checkpoint loadable by TensorFold's qwen3_5 engine identically to the base, with the vision tower and Ash's per-module precision intact (see above). |
Quick start
brew install ashhart/tensorfold/tensorfold # TensorFold 1.3.0 native engine
tensorfold pull OnyxAILabs/Qwen3.8-27B-Hermes-oQ4 # this bundle
tensorfold pull z-lab/Qwen3.8-27B-DFlash2 # drafter (Apache-2.0)
tensorfold serve OnyxAILabs/Qwen3.8-27B-Hermes-oQ4 \
--drafter z-lab/Qwen3.8-27B-DFlash2 \
--host 127.0.0.1 --port 8080 \
--no-thinking --context 262144 --parallel 1
OpenAI-compatible /v1/chat/completions (also /v1/responses, Anthropic /v1/messages). /health exposes live decode_tokens_per_second, memory, backend, device.
Point Hermes Agent at it (~/.hermes/config.yaml):
model:
default: Qwen3.8-27B-Hermes-oQ4
provider: qwen-hermes-local
providers:
qwen-hermes-local:
api: http://127.0.0.1:8080/v1
name: qwen-hermes-local
api_key: not-needed
context_length: 262144
default_model: Qwen3.8-27B-Hermes-oQ4
transport: chat_completions
Hermes Agent needs ≥64k context. Keep thinking off.
How the weight-level fuse works
The Hermes adapter is a LoRA, so it can be merged into the base weights to produce a standalone checkpoint that any engine serves without LoRA support. The standard tool (mlx_lm.fuse) fails on this combination, for two reasons:
- Adapter format mismatch. harness-hub ships a PEFT-format adapter (
adapter_model.safetensorswithr/lora_alpha/target_modules).mlx_lm.fuseexpects mlx-format (adapters.safetensorswithnum_layers/lora_parameters) and a flat config — on this VL modelnum_layerslives under a nestedtext_config, so it raisesAttributeError: num_layers. - Vision-tower loss. Even a manual module-level fuse followed by
mlx_lm.saveserializes only the language model and drops all 333vision_tower.*tensors, yielding a text-only checkpoint whose config still declares a VL model (broken).
So we fuse at the weight level, touching only the LoRA-target tensors and preserving everything else byte-for-byte:
- Load every base oQ4 tensor and the PEFT LoRA (
lora_A:[r,in],lora_B:[out,r],fan_in_fan_out=false). - For each of the 256 target modules, map the PEFT key to the model tensor path (
...layers.L.<proj>.{weight,scales,biases}). The targets are the 16 full-attention layers' q/k/v/o plus every layer's MLP gate/up/down — the 48 GatedDeltaNet linear-attention layers have noq_proj, so they are not LoRA targets. - Dequantize that module's base weight at its own bits/group_size (read from the config
quantizationmap — 4-bit base, 5/6-bit overrides). - Add the LoRA delta:
W' = W + (alpha/r)·(lora_B @ lora_A), withalpha/r = 64/32 = 2.0. No transpose. - Requantize
W'at the same bits/group_size, so Ash's per-module mixed precision is preserved exactly (no global re-quant, no precision flattening). - Write the tensors back with the base's original sharding, index, and config — non-target tensors (vision tower, embeddings, norms) are copied untouched.
Verification (asserted before serving): output tensor count 2,180 = base, all four shards indexed, vision tower intact (333 tensors), per-module quant bits preserved (4-bit base + 160×5-bit + 1×6-bit). End-to-end generation + Hermes tool-calling exercised on Apple Silicon (M5 Ultra): coherent correct code, get_weather({"city":"Reykjavik"}) with finish_reason=tool_calls.
The reproducible script (fuse-hermes-weights.py, MLX) is included in this repository. It takes base_dir adapter_dir out_dir and works for any oQ precision (it reads each module's bits from the config).
Limitations
- Thinking off recommended (as trained). Thinking-on ~3× tokens, no significant accuracy gain, exhausts context under Hermes.
- Speed is workload-dependent (speculative acceptance). Unpredictable text approaches plain-decode speed.
- Drafter trained at 4096 context; acceptance may drop on very long generations. Prefix caching (
--prompt-cache-gib) mitigates long prompts. - Quantization is lossy (oQ4). Near-ties can flip; validate quality on your workload. Use a higher-precision variant when quality matters more than memory.
- Single-stream lane at
--parallel 1; concurrent callers queue.--parallel autoallows streams at higher RAM. - Vision tower present but not served by the text-focused TensorFold serve path used here; route images to a vision-capable helper if needed.
- Not safety-tuned by us; inherits base-model biases and training-data opacity. Not for safety-critical use.
- Self-MTP is disabled in this checkpoint (
mtp_num_hidden_layers: 0); DFlash2 is a separate drafter, not the built-in MTP head.
Attribution and lineage
Authored by Mike Gibbs + Iris Vale — Onyx AI Labs (X @CMichaelGibbs). Integration, weight-level fuse, Apple-silicon serving validation, and packaging by us. Built following MiaAI-Lab's contributor-attribution playbook: every author credited, every upstream traced, nothing relicensed, no invented identities. We stand on the work below — each component is an import with its source and original credit, and all design/training/benchmark credit belongs to its authors.
| Component | Source | Credit | License | Relationship |
|---|---|---|---|---|
| Integration (this bundle) | this repository | Mike Gibbs + Iris Vale / Onyx AI Labs (X @CMichaelGibbs) — weight-level fuse, M5 Ultra validation, serving kit, card | Apache-2.0 | authors / integration |
| Base model | Qwen/Qwen3.8-27B | Qwen team, Alibaba — model design, training, benchmarks | Apache-2.0 | base |
| oQ4 conversion | TensorFold/Qwen3.8-27B-oQ4 | Ash Hart / TensorFold — mixed-precision MLX conversion, Apple-silicon validation | Apache-2.0 | quantized |
| Hermes adapter | harness-hub/Qwen3.8-27B-hermes-adapted | Nous Research / harness-hub (Hermes team) — AsyncGRPO RL on the Hermes Agent harness (TRL, OpenEnv, safeagents) | Apache-2.0 | finetune (LoRA, fused) |
| Hermes Agent harness | NousResearch/hermes-agent | Nous Research — the agent framework the adapter is trained for | Apache-2.0 | harness |
| DFlash2 drafter | z-lab/Qwen3.8-27B-DFlash2 (mirror of incoai) | Inco AI / z-lab — DFlash2 block-diffusion drafter | Apache-2.0 | drafter (separate) |
| DFlash paper | DFlash: Block Diffusion for Flash Speculative Decoding | Chen Jian, Liang Yesheng, Liu Zhijian (ICML 2026) | — | research foundation |
| Inference engine | ashhart/TensorFold | Ash Hart — native Metal/CUDA engine, DFlash2 speculative support | Apache-2.0 | runtime |
| Attribution method | MiaAI-Lab contributor-attribution playbook | Mia / MiaAI-Lab — attribution template | — | methodology |
This card does not relicense anything upstream. All upstream licenses are preserved in the repository.
Citation
@misc{qwen38_hermes_oq4_tensorfold_2026,
title = {Qwen3.8-27B-Hermes-oQ4: Hermes adapter fused into TensorFold oQ4, lossless-fast on Apple Silicon with DFlash2},
author = {Gibbs, Mike and Vale, Iris and contributors},
year = {2026},
note = {Base: Qwen team. oQ4 conversion + TensorFold engine: Ash Hart. Hermes adapter + harness: Nous Research / harness-hub. DFlash2: Inco AI / z-lab; DFlash paper: Chen, Liang, Liu (ICML 2026). Attribution method: MiaAI-Lab.},
url = {https://huggingface.co/OnyxAILabs/Qwen3.8-27B-Hermes-oQ4}
}
Please also cite the upstream works: Qwen3.8-27B, the Hermes adapter (harness-hub release blogpost), DFlash2 (Inco AI), and the DFlash paper (Chen et al., ICML 2026).
License
All components Apache-2.0: base Qwen3.8-27B, TensorFold oQ4 conversion, harness-hub Hermes adapter, z-lab DFlash2 drafter, TensorFold engine. A copy of each upstream license is preserved. Integration scripts and this card: Apache-2.0. Review upstream licenses before redistribution or commercial use.