Use
from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel base_id = "Qwen/Qwen3-14B"tokenizer = AutoTokenizer.from_pretrained(base_id)base = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")model = PeftModel.from_pretrained( base, "Om22s/alexandria-qwen3-14b-rightsclean-speaker-attribution")
This adapter targets Alexandria's structured attribution prompt, not ordinary
chat. Require one JSON {"n","speaker"} object per input entry and reject
malformed or incomplete responses. The included rightsclean-attrv1.f16.gguf is a
runtime export for compatible llama.cpp workflows.
The exact prompt used for training and evaluation is included in
default_prompts_attribute.txt.
Evaluation
Four-book product-window evaluation (temperature 0, batch 25, 4096-token
budget; 768 paired gold rows):
- Base model: 61.7% (474/768)
- This adapter: 73.4% (564/768)
- Paired changes: 137 improved, 52 regressed; exact paired p=5.1e-10
The result is an aggregate measurement from the in-repository evaluator. No
source text, raw model responses, or copyrighted evaluation rows are included.
Training and rights
The training mixture was rights-reviewed and selected from sources with
documented redistribution terms (PDNC, RiQuA, and DraCor prose). This release
contains the adapter weights and recipe summary only; it does not redistribute
the source datasets. Review each source's current license and the base model's
terms before redistribution or commercial use.
LoRA recipe: rank 16, alpha 32, dropout 0.05, two epochs, learning rate
1e-4, maximum sequence length 2048, seed 20260914.
Limitations
Performance is measured on the Alexandria four-book gold fixture and may not
generalize to other genres, languages, prompts, or roster construction rules.
The adapter does not provide speaker diarization, voice synthesis, or a
general-purpose conversational model.
Intended use
For: assigning a speaker name to each already-segmented line of an
English novel, given a roster, inside Alexandria Audiobook's structured
attribution prompt (default_prompts_attribute.txt).
Validate every reply: one {"n","speaker"} object per entry, every index
once, speakers from the roster plus NARRATOR/UNKNOWN.
Not for: chat, summarisation, translation, other languages (untested),
texts without a roster, or decisions about real people. The adapter inherits
the base model's limitations and does not change its safety behaviour.
Requirements
Qwen/Qwen3-14B (bf16 ≈ 30 GB, or the Q4_K_M GGUF ≈ 9 GB); an r16 LoRA in safetensors plus an f16 GGUF export for llama-server --lora; 32k context, one slot. Loading with transformers/PEFT was written against transformers
4.57, peft 0.18, torch 2.10 (examples/infer.py); the scores were produced
with llama.cpp serving at temperature 0 (examples/serve_llamacpp.sh).
License and versioning
Adapter weights: Apache-2.0 (LICENSE). Base model: Qwen/Qwen3-14B,
Apache-2.0. v1.0.0 tags the state described here; main will not move.
Source and issues: on22s/alexandria-audiobook2.