The Librarian โ€” Curator "Grooming" LoRA for Qwen3.5-9B

A rank-8 LoRA adapter that teaches Qwen3.5-9B to run The Librarian's grooming job: periodically reviewing a slice of an agent's stored memories and improving it holistically โ€” consolidating fragments into single documents, removing stale or duplicated entries, and deciding when the right action is to do nothing.

The Librarian is an open-source durable-memory layer for coding agents (code-ministry-ltd/the-librarian). Its curator runs three jobs โ€” harvesting, intake, and grooming โ€” each with its own job section of one unified prompt. This adapter was trained for the grooming job only.

Base model

Training

  • Method: SFT (TRL via Unsloth Studio), LoRA rank 8 / alpha 8, one epoch
  • Dataset: 100 grooming cases compiled from the owner's own Librarian instance (private; not included) โ€” deliberately small, by design. On the sealed evaluation cohort, this 100-case adapter beat 250- and 500-case siblings in blind review: the larger adapters had learned to merge more aggressively, which was precisely the failure being removed.
  • Window: 8,192 tokens (prompt + completion), completion-only loss
  • Note: trained on non-thinking completions โ€” run with thinking disabled.

Results (sealed cohort, blind review)

  • Exact gold matches: 33 โ†’ 38
  • Prose drift: 43 cases โ†’ 35

Usage

PEFT / transformers

from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base = "unsloth/Qwen3.5-9B"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto", device_map="cuda")
model = PeftModel.from_pretrained(model, "code-ministry-ltd/librarian-curator-qwen35-9b-grooming")

llama.cpp (GGUF)

This repo also ships the adapter as a GGUF LoRA (curator-qwen35-9b-grooming-100-r8-lora-f16.gguf, f16). Load it on any Qwen3.5-9B GGUF (Q8_0 recommended) โ€” the scale is 1.0 by design:

llama-server -m Qwen3.5-9B-Q8_0.gguf \
  --lora-scaled curator-qwen35-9b-grooming-100-r8-lora-f16.gguf:1.0 \
  --jinja --chat-template-file <qwen3.5 chat template> \
  --chat-template-kwargs '{"enable_thinking": false}'

Notes for Librarian users

Point your curator's grooming model config at this adapter (e.g. via the per-job model settings added in the curator unification, spec 043). Leave harvesting/intake on the base model or their own adapters. Grooming remains best run with its dry-run/proposal path โ€” this adapter makes the decisions sharper, it does not make the job safe to run unattended.

License

Adapter weights: Apache-2.0 (matching the base model). Training data was private and is not redistributed.

Downloads last month
22
GGUF
Model size
14.5M params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for code-ministry-ltd/librarian-curator-qwen35-9b-grooming

Finetuned
Qwen/Qwen3.5-9B
Adapter
(110)
this model