A LoRA adapter for Qwen/Qwen3.8-27B, trained with reinforcement learning to work as the model behind Hermes Agent on software-engineering and terminal tasks.
[!Tip] Thinking-level accuracy, at a quarter of the tokens. With thinking off, this adapter is level with the base model thinking at its highest reasoning effort (
xhigh) under the same setup: 43.1% vs 45.1% on SWE-bench Pro, 58.8% vs 58.8% on Terminal-Bench 2.1, while generating 3.5–4.4× fewer tokens per task. Keep thinking off. See Thinking vs no thinking, and the context window note: under Hermes Agent, many thinking-on sessions ran out of context.
[!Note] All results are under the Hermes Agent harness: one attempt per task, a 100-step budget, a 131,072-token context window, thinking off unless stated, text only (the vision tower is not served), sampling at temperature 0.8 with top-p 1.0 (the training sampling). Base model and adapter always run under identical settings. These numbers are not comparable with the ones on the Qwen3.8-27B card, which uses other harnesses (Terminus, Claude Code), thinking at maximum effort, larger budgets and the full SWE-bench Pro.
Full recipe will be shared in the release blogpost for anyone to build their own harness adapter.
Pick your setup
A real SWE-bench Pro task under Hermes Agent: the base model probes Qt's URL encoding modes for dozens of calls, breaks the test file with a bad patch and runs out of its budget; this adapter fixes the regex and the path setter, checks the task's scenarios and passes, in 35 tool calls.
Still version, and the taskTask: instance_qutebrowser__qutebrowser-deeb15d6f009b3ca0c3bd503a7cef07462bd16b4 from SWE-bench Pro (hard 51): when
incrementing or decrementing a number in a URL, leave percent-encoded parts (such as %3A) intact. Both runs are from the
evaluation above: the base model was graded 0, this adapter 1. Each line is one tool call as the trajectory recorded it,
cut to fit; Hermes Agent's tool names are shortened (python for execute_code, shell for terminal, read for
read_file).
| Benchmark | Qwen3.8-27B | Qwen3.8-27B, thinking | Qwen3.8-27B-hermes-adapted | Qwen3.8-27B-hermes-adapted, thinking |
|---|---|---|---|---|
| SWE-bench Pro (hard 51) | 29.4% | 45.1% | 43.1% | 51.0% |
| Terminal-Bench 2.1 | 44.7% | 58.8% | 58.8% | 57.6% |
The four runs are compared on the tasks all of them graded: all 51 of SWE-bench Pro, and 85 of Terminal-Bench 2.1.
"Thinking" is the chat template's thinking mode at its default reasoning effort (xhigh). Thinking-on scores under Hermes
Agent are limited by the context window: see the note below.
One attempt per task, thinking off, paired against the base model under Hermes Agent on the same tasks. The interval is 95%; the p-value is an exact sign test on the tasks that changed outcome.
| Benchmark | Tasks | Qwen3.8-27B | Qwen3.8-27B-hermes-adapted (step 160) | Difference (points) | Newly solved / lost |
|---|---|---|---|---|---|
| SWE-bench Pro (hard 51) | 51 | 29.4% | 43.1% | +13.7 ± 13.3 | 10 / 3 (p = 0.092) |
| Terminal-Bench 2.1 | 85 | 44.7% | 58.8% | +14.1 ± 11.4 | 19 / 7 (p = 0.029) |
Medians per task, this adapter / the base model, over the tasks both solved: same tasks, same outcome, so the numbers measure only how much work each needed. Generated tokens are everything the model writes (visible content, reasoning and tool calls).
| Tasks | Turns | Tool calls | Generated tokens | |
|---|---|---|---|---|
| vs the base model | ||||
| SWE-bench Pro | 12 | 22 / 59 | 28 / 63 | 4.1k / 8.5k |
| Terminal-Bench 2.1 | 31 | 8 / 21 | 7 / 23 | 1.6k / 3.5k |
| vs the base model with thinking | ||||
| SWE-bench Pro | 16 | 24 / 42 | 28 / 50 | 5.5k / 22.9k |
| Terminal-Bench 2.1 | 38 | 8 / 10 | 8 / 12 | 2.1k / 7.4k |
| SWE-bench Pro (hard 51) | Terminal-Bench 2.1 | |
|---|---|---|
| This adapter vs the base model with thinking (tasks only one solves) | 6 / 7 | 12 / 12 |
| Generated tokens per task (median), base model with thinking / this adapter | 22.5k / 6.5k | 21.0k / 4.8k |
| Model calls per task (median), base model with thinking / this adapter | 30 / 25 | 15 / 17 |
| This adapter with thinking vs without (tasks only one solves) | 8 / 4 | 9 / 10 |
Under this setup, thinking mode on its own brings the base model to this adapter's accuracy, within noise; the adapter
gets there without it, at 3.5–4.4× fewer tokens. Thinking runs use the template's default reasoning effort (xhigh) and
at most 32,768 output tokens per model call.
All models were evaluated with a 131,072-token context window, under Hermes Agent's default configuration, with no context compaction set up. A session that outgrew the window ended there and was scored as a failure (0), for every model alike. With thinking on, Hermes Agent sends each turn's reasoning back to the model, so long sessions run out of context: many failed thinking-on attempts, for the base model and for this adapter, ended this way, often after a few dozen steps. Thinking-on scores here reflect this setup, not the best each model could reach with a larger window or compaction. Thinking-off runs were much less affected.
Evaluation checksharness-hub/Qwen3.8-27B-hermes, reported 27.5% → 49.0% on SWE-bench Pro before these reruns.Every evaluation attempt behind this card, solved or not, is in the harness-hub/harness-adapters-trajectories bucket: base model and adapter, thinking on and off, on both benchmarks, with each attempt's grade, trajectory, harness log and verifier output, scrubbed of secrets. The files carry canary strings: keep them out of training data. One gap: for this adapter on SWE-bench Pro with thinking off, the grades of all 51 tasks are there but only 3 trajectories, the rest were lost when a partial rerun overwrote the archive.
vllm serve Qwen/Qwen3.8-27B \
--enable-lora --max-lora-rank 32 \
--lora-modules qwen3.8-hermes=harness-hub/Qwen3.8-27B-hermes-adapted \
--language-model-only --enable-prefix-caching --mamba-cache-mode align \
--enable-auto-tool-choice --tool-call-parser qwen3_xml --reasoning-parser qwen3 \
--default-chat-template-kwargs '{"enable_thinking": false}' \
--max-model-len 131072
This is the configuration of the evaluations. Keep thinking off, as in training: with it on, the adapter is not
significantly more accurate and generates about 3× more tokens. Prefix caching on this hybrid model needs
--mamba-cache-mode align; without it, every agent turn re-reads its whole history.
Install Hermes Agent:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Add the server to ~/.hermes/config.yaml:
model:
default: qwen3.8-hermes
provider: custom
base_url: http://localhost:8000/v1
api_key: dummy
Hermes Agent needs at least 64,000 tokens of context.
hermes chat -q "Find out why the tests in tests/test_parser.py fail and fix the bug."
transformers serve is a lightweight OpenAI-compatible
server, for local use and experimentation (vLLM is faster under load). It handles Qwen's tool calls out of the box.
Serve the merged checkpoint from Merge the adapter into the base model:
pip install "transformers[serving]"
transformers serve ./Qwen3.8-27B-hermes-merged --dtype bfloat16 --continuous-batching --reasoning off
--reasoning off keeps thinking off, as in training. The server listens on http://localhost:8000, so the Hermes Agent
configuration from the vLLM section works as is, with default set to the name the server serves,
here ./Qwen3.8-27B-hermes-merged.
The GGUF version of Qwen3.8-27B-hermes-adapted is in harness-hub/Qwen3.8-27B-hermes-adapted-GGUF. It runs on top of a GGUF of the base model:
hf download ggml-org/Qwen3.8-27B-GGUF Qwen3.8-27B-Q8_0.gguf --local-dir .
hf download harness-hub/Qwen3.8-27B-hermes-adapted-GGUF Qwen3.8-27B-hermes-lora-F16.gguf --local-dir .
llama serve -m Qwen3.8-27B-Q8_0.gguf --lora Qwen3.8-27B-hermes-lora-F16.gguf \
--chat-template-kwargs '{"enable_thinking": false}' -c 65536 --port 8080 --alias qwen3.8-hermes
Then use the Hermes Agent configuration from the vLLM section with base_url: http://localhost:8080/v1.
The adapter was trained on the BF16 weights: the closer the base GGUF is to them, the closer you get to the trained
behavior. Q8_0 is a good default; lower-bit quants drift further. The GGUF version has not been re-evaluated.
The adapter can be merged into the base weights with PEFT. The result is a regular Qwen3.8-27B checkpoint (about 54 GB in BF16) that any engine serves without LoRA support. Merge on CPU if the GPU is needed for serving afterwards:
import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoTokenizer
base = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.8-27B", dtype=torch.bfloat16, device_map="cpu")
model = PeftModel.from_pretrained(base, "harness-hub/Qwen3.8-27B-hermes-adapted").merge_and_unload()
model.save_pretrained("Qwen3.8-27B-hermes-merged")
AutoTokenizer.from_pretrained("harness-hub/Qwen3.8-27B-hermes-adapted").save_pretrained("Qwen3.8-27B-hermes-merged")
Then serve it like the base model, without the LoRA flags:
vllm serve Qwen3.8-27B-hermes-merged --served-model-name qwen3.8-hermes \
--language-model-only --enable-prefix-caching --mamba-cache-mode align \
--enable-auto-tool-choice --tool-call-parser qwen3_xml --reasoning-parser qwen3 \
--default-chat-template-kwargs '{"enable_thinking": false}' --max-model-len 131072
The merged checkpoint can also be converted to GGUF and served with llama.cpp the same way.
| Method | AsyncGRPO (TRL, experimental), LoRA |
| Environment | Harbor tasks served by OpenEnv, rollouts in HF sandboxes, tool calls screened by safeagents |
| Harness | Hermes Agent |
| Tasks | 750 scale800 tasks interleaved with 300 TermGrade tasks |
| Reward | the task verifier's correctness (falls back to reward), plus a tool-efficiency bonus of weight 0.1 |
| Steps | 160 (this checkpoint) of 1000 planned |
| Learning rate | 2e-5 |
| LoRA | r = 32, alpha = 64, on q, k, v, o, gate, up and down projections |
| Rollouts | 8 per task, temperature 0.8, thinking off, up to 50 agent steps and 1,800 s per rollout |
| Batch | 16 micro-batches of up to 65,536 tokens per step, rollouts up to 16 policy versions stale |
| Hardware | 2× NVIDIA B200 per harness: vLLM on one, the trainer on the other |
The training script is
examples/async_grpo_harbor in TRL.
For a full write-up, please refer to the release blogpost.