File size: 28,377 Bytes
e1fa6c7
 
 
 
 
83d8cfa
2e2357e
 
90f10d2
e1fa6c7
 
 
 
 
 
 
fc59aec
 
e1fa6c7
 
 
7a6f2a3
e1fa6c7
 
 
 
 
 
 
 
 
128fdff
 
fa53502
9f5fbb5
fa53502
e1fa6c7
 
 
 
90f10d2
 
 
 
 
 
e1fa6c7
 
 
 
 
271bd15
e1fa6c7
 
 
 
 
 
 
 
7b9216f
3354101
128fdff
e1fa6c7
 
 
9f5fbb5
 
 
 
 
 
 
 
 
 
 
e1fa6c7
 
1d6e33e
d091bde
a9c50f2
d091bde
a9c50f2
d091bde
a9c50f2
d091bde
a9c50f2
128fdff
d091bde
 
1d6e33e
3cf77b0
1d6e33e
3cf77b0
1d6e33e
3cf77b0
1d6e33e
3cf77b0
1d6e33e
 
 
 
90f10d2
1d6e33e
3cf77b0
1d6e33e
3cf77b0
1d6e33e
3cf77b0
90f10d2
 
 
 
 
 
 
 
 
 
 
 
 
 
3cf77b0
e1fa6c7
 
 
 
3cf77b0
 
e1fa6c7
 
 
 
 
 
 
128fdff
e1fa6c7
 
 
 
 
 
 
 
a9c50f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1fa6c7
 
 
 
7a6f2a3
1d6e33e
 
 
271bd15
1d6e33e
 
 
 
 
 
8fceaaa
90f10d2
7a6f2a3
 
1d6e33e
 
 
 
 
 
 
 
 
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7a6f2a3
58ebced
e1fa6c7
 
a9c50f2
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
0f38a12
 
e1fa6c7
0f38a12
 
 
 
e1fa6c7
0f38a12
e1fa6c7
 
 
1d6e33e
 
e1fa6c7
 
 
 
 
0f38a12
 
 
 
 
 
271bd15
0f38a12
 
 
271bd15
 
 
0f38a12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1fa6c7
9f5fbb5
 
e1fa6c7
 
 
 
a9c50f2
e1fa6c7
271bd15
e1fa6c7
 
 
 
 
 
 
 
 
 
 
a9c50f2
0f38a12
 
 
 
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3cf77b0
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
90f10d2
e1fa6c7
 
 
 
 
1d6e33e
e1fa6c7
1d6e33e
 
 
e1fa6c7
 
 
 
 
 
 
 
128fdff
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f429d7c
 
 
e1fa6c7
 
1d6e33e
e1fa6c7
1d6e33e
e1fa6c7
 
 
128fdff
e1fa6c7
128fdff
e1fa6c7
 
 
 
 
 
 
 
 
1d6e33e
e1fa6c7
 
 
 
 
 
 
 
 
a9c50f2
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
f429d7c
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8fceaaa
e1fa6c7
8fceaaa
e1fa6c7
 
 
 
8fceaaa
e1fa6c7
 
8fceaaa
e1fa6c7
 
 
 
 
 
 
 
 
90f10d2
e1fa6c7
 
 
 
 
 
 
 
1d6e33e
e1fa6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83d8cfa
e1fa6c7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
---
pipeline_tag: text-generation
library_name: gguf
language:
  - en
license: apache-2.0
base_model:
  - google/gemma-4-26B-A4B-it
base_model_relation: finetune
tags:
  - gemma
  - moe
  - text-generation
  - style-transfer
  - gguf
  - voice
  - arxiv:2607.02770
  - arxiv:2503.19786
datasets:
  - gryphe/styletune-roleplay-200
---
> **New in v3.1** — `voice graft` (DELLA single graft, pulse→donor) and `voice chorus` (blend pulse + support + lead, `--config` stages knob screens per graft with an auditionable duet). 14 commands, `voice --help` is truth.

<p align="center"><img src="./lockup-circle-wordmark-2-refined.png" width="360" alt="Voice" /></p>

# Voice

Gemma 4 · 26B MoE · StyleTune · GGUF Q8_0

Your model, in your voice. One file to run—nothing extra to set up.

A full model is 26GB. A voice is 1.4GB — smaller models even less. You download the voice, not the model.

> This is a tool — no `.gguf` is included. You *create* the voiced model locally with `voice cast`.
> If you're the skeptical type, you're in good company — [start with the scores](#evaluation): 314 benchmark items and 32 writing pairs, every one reproducible from the archived runs.

---

## Two steps to start

```bash
curl -sSL https://huggingface.co/Wiself/voice/resolve/main/voice-cli.tar.gz | tar -xz
cd voice-cli && python3 voice.py path  # once - adds voice to PATH
```

Then two commands. One model, one voice:

```bash
voice get Gryphe/Gemma-4-26B-A4B-StyleTune-V2
# Name it styletune-v2 when prompted
voice cast ./model.gguf styletune-v2 --out ./voiced/
voice cast ./model.gguf styletune-v2 --speak --out ./voiced/  # voice speaks through output.weight (invented if absent; GGUF only)
```

Run it:

```bash
llama serve -m ./voiced/model.gguf
```

> **We tried it on Orion:** full comparison (314 benchmark items, 32 writing pairs) in [Evaluation](#evaluation). Same cast on its abliterated sibling [llmfan46/gemma-4-26B-A4B-it-qat-q4_0-unquantized-uncensored-heretic](https://huggingface.co/llmfan46/gemma-4-26B-A4B-it-qat-q4_0-unquantized-uncensored-heretic) looped; re-cast as `delta` stopped looping and kept the voice — one file out, same family/shape required.

No adapter at runtime. `voice cast` bakes the voice into a complete `.gguf` — the head at `Q8_0`, everything else untouched. Just `llama serve -m`.

> Example voice shown. Any compatible `safetensors` voice works the same way. Names are lowercased on disk—`styletune-v2` is the stored form. Model and voice names here are examples; use any compatible pair that shares the same architecture and vocabulary.

## Audition your voice

Cast it, then audition it — two one-command checks that tell you what you actually made:

```bash
python3 audition/voice-check.py --label my-model  # can it still reason? (ARC, MMLU, GSM8K → scorecard)
python3 audition/voice-taste.py a.jsonl b.jsonl   # how does it sound? (divergence, clichés, blind pairs)
```

No judges, no verdicts — numbers, exhibits, and full reasoning traces, all reproducible. See [`results.md`](./results.md) for what ours showed.

---

## Not just Gemma — any compatible model *within the same family and shape*

**Voice is not tied to Gemma.**

Same architecture, same vocab — the voice transfers. **Qwen → Qwen, Gemma → Gemma, Llama → Llama.** Take the voice from a finetune and cast it onto the stronger base you already have — reasoning stays, only how it sounds changes. Shape must match (we try `[vocab, hidden]` → `[hidden, vocab]`), GGUF head is `Q8_0` when `last dim %32==0` else `F16` fallback (larger, compatible).

For example, a voice from [Wiself/Holodeck-Lounge-MTP](https://huggingface.co/Wiself/Holodeck-Lounge-MTP) casts onto any `qwen3.5-9b` base, [ReadyArt/For-Her-Darkside-12B-v1.4](https://huggingface.co/ReadyArt/For-Her-Darkside-12B-v1.4) onto any `gemma4 12b` base — even mixed with [ReadyArt/Serenity-12B](https://huggingface.co/ReadyArt/Serenity-12B) to see what happens. `Gemma 4 26B MoE` above is just one illustration. Mix and match *within that family and shape*: keep the more performant base, keep the better voice.

*Qwen, Llama, Gemma, GLM, DeepSeek — if it has a voice, you can move it within that family and shape.*

---

## The Idea — a scalpel

One tensor holds voice. We lift it. We place it. Transpose and dtype handled. Nothing else changes.

Voice is a **scalpel, not a pipeline** — one idea made trivial: lift a model's character and place it elsewhere.

**Backed by proven ideas:** QAT-aware bases (Google: 5k steps, 54% less drop at Q4_0) stay intact; `lm_head` carries style (MythoMax, Gryphe StyleTune). We just make it portable.

<details>
<summary>What it trivializes (power users, same family & shape)</summary>

* **Same family, any container:** `voice get` from any `safetensors` repo / `.gguf` / URL via range requests; `voice cast` onto any compatible `.gguf` or `.safetensors` — same `vocab` + same `head shape` required, transposes `BF16/F16/F32→Q8_0` auto (`last dim %32==0` else `F16` fallback).
* **Any single tensor, precisely:** `voice get <repo> <tensor>` / `voice cast <target> <voice> [tensors...]` for any named tensor — bit-exact when quant types match, validated offsets, otherwise `F32` round-trip.
* **No surprises:** atomic writes, validated header, ETag-aware resume, `0600` token, symlink-safe — resumes or fails cleanly.

</details>

Keep the stronger model for reasoning, the better voice for style. `llama serve -m` ready.

## One voice, several writers

Where the voice lands changes how the model sounds. We cast one voice (Scarlett) onto one base (Orion) five ways and read every word — same voice, different slots, different writing. The slot is a second dial next to the choice of voice. Full data: [`creative-bench/runs/tensorwars.md`](./creative-bench/runs/tensorwars.md) (one prompt, five builds, single draws — a first probe, more coming).

Every build is Orion with something swapped:

- nothing (the base as it ships),
- Orion reading through Scarlett's embedding,
- Orion speaking through Scarlett's head (`--speak`),
- both slots,
- one Scarlett tensor serving both slots.

Default cast puts the voice onto `output.weight`, else the embed slot — a target with neither fails loud instead of guessing.


## How it works

Two benefits, no extras to learn:

- **Get what you need:** Light and fast — pulled with range requests in seconds, saved as one tensor (`voice.safetensors` or `voice.gguf` for quant passthrough + `voice.json`). `voice list` to see, `voice info` to inspect.
- **Run fused:** Cast writes a complete model you can run anywhere. No extra setup. Quant voices stay bit-exact `Q8_0`→`Q8_0`.

You will see each step as it happens and get a ready-to-run file at the end.

Take the voice of any compatible model or finetune and cast it onto the file you already have. Mix and match. Keep the stronger model for reasoning and the better voice for style. You choose—no extra steps at runtime.

### When you need a delta

Direct cast is the default. If an abliterated target loops, try delta — it blends only the difference, so the MoE router stays calm.

<details>
<summary>Why a delta helps when looping</summary>

A delta carries only the difference from its base, so it blends more gently with the target. On some abliterated targets, a tiny shift can change behavior. MoE routing is discrete, so a small change in the residual stream can tip which expert fires next. If direct casting loops, the delta path often avoids it.

</details>

## You tried it. Leave a breadcrumb?

No one knows what Voice X does on Base Y until someone tries. You just tried.

`voice report` saves your note privately first. Then it shows you exactly what would be shared — and asks once.

```bash
voice report --voice styletune-v2 --target ./model.gguf -m "delta fixed loop, 1.6% shared"
```

```text
Thanks for noting — saved locally (a3f8…) → ~/.voices/reports.jsonl (private)
Will share: voice: styletune-v2, tensor: lm_head.weight [262144,2816] BF16, target: model.gguf
Leave a breadcrumb to help the next person? [y/N] (N):  ← Enter = No
```

* Private by default. Your note stays in `~/.voices/reports.jsonl` and `~/.voices/outbox/` until *you* say yes. `N` default. We never ask again for this report.
* If you say `y`, it shares to [`Wiself/voice-reports`](https://huggingface.co/datasets/Wiself/voice-reports). We send your one-line note + preview + source/shape/arch we auto-pull + basic env. That's it. Preview is truth before you decide.
* Why bother? Voices are 1.4GB, models are 26GB. Trying is cheap, but someone else is about to waste an hour re-learning what you already learned — "sings" or "loops." One line saves them.

The notebook is still mostly empty. That's why the next line matters most.

---

## Commands

Three you need daily — rest in [`DOCS.md`](./DOCS.md) (`voice --help` is truth, 14 commands `v3.1`):

| Command | What it does |
|---|---|
| `voice cast <target> <voice> [tensors...]` | Cast it onto `.gguf` or `.safetensors` of same shape/vocab (`Q8_0` once for safetensors lm_head, else keep target quant incl. all GGML quants; `--quant keep\|target\|any quant` (safetensors: keep\|target\|f32\|f16\|bf16); `--speak` for output.weight on GGUF (invented if absent); `--exclude` to skip) |
| `voice report -m "note"` | Save a one-line note locally, optionally share to community — small file, big iteration (we pull source/tensor/shape) |

### Extra commands

| Command | What it does |
|---|---|
| `voice add <safetensors> <json>` | Add local `voice.safetensors` + `voice.json` to `~/.voices/` (both required, asks name) |
| `voice get <repo> [tensors...]` | Extract head (default) or named tensors (`--multi` → `voicepack.safetensors` + json, BF16 preserved) |
| `voice graft <pulse> [donor]` | Graft one voice onto another (DELLA single graft, `--density/--epsilon/--lambda/--rescale/--seed/--out`) |
| `voice chorus [pulse] [donors...]` | Blend pulse + support + lead (0.8 first graft, 0.9 lead; support Enter-to-skip → duet; `--config` stages knobs with auditionable duet) |
| `voice list [base]` | List voices or cached bases |
| `voice info <voice>` | Show voice details |
| `voice remove <voice>` | Remove a voice |
| `voice cleanup [--force]` | Remove incomplete `.parts` |
| `voice auth [--show\|--clear]` | Save HF token (0600) |
| `voice path` | Put `voice` on PATH |
| `voice doctor` | Check setup |

Full reference: [`DOCS.md`](./DOCS.md) · `voice --help`

Example:

```bash
voice get Gryphe/Gemma-4-26B-A4B-StyleTune-V2
# Name it styletune-v2 when prompted
voice list
#   Name               Source                                  Type
#   ────────────────── ─────────────────────────────────────── ────────
#   styletune-v2       Gryphe/Gemma-4-26B-A4B-StyleTune-V2      voice
#   delta-styletune-v2 Gryphe/Gemma-4-26B-A4B-StyleTune-V2      delta

voice info styletune-v2
voice list base
voice cast ./model.gguf styletune-v2 --out ./voiced/
```

> `delta-` is reserved. Voice names cannot start with it. Deltas always do. Full CLI reference: [`DOCS.md`](./DOCS.md) (generated from `voice --help`, 14 commands). Names are lowercased when saved.

## What StyleTune showed

Gryphe reports for StyleTune-V2—on their private 200-prompt roleplay eval (private regex, certified cliché-free, 1–20 turns, greedy 0.0)—52% fewer clichés per 100 words (1.141 → 0.551) and 19.9% shared trigram vocabulary vs base instruct.[^1]

[^1]: Source: [Gryphe/Gemma-4-26B-A4B-StyleTune-V2](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2) model card and [discussion #1](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2/discussions/1). We cite their numbers, not ours. No `model-index` is published here—this is a private metric, not a reproducible Hub leaderboard.

<details>
<summary>How Gryphe tested</summary>

- Single epoch, 100% narrative data; prompts certified cliché-free and not seen in training.
- 200 prompts sampled at intervals 1 to 20 turns, each ending on a user turn.
- Run at `temperature 0.0` greedy deterministic.
- Clichés via their private regex (for example, `calculating` and `predatory`) counted per 100 words; phrasing via shared trigram vocabulary.

</details>

<details>
<summary>Footnote: our first quick check (heuristic, n=10)</summary>

Before the full evaluation above, we ran 10 roleplay prompts at `temp 1.0`
and greedy `0.0` with our own 50-phrase list: 1.6% overlap at 1.0, 3.2% at
greedy, every prompt under 5%. Direction only, not comparable to anything.
Details: [`benchmark.md`](./benchmark.md).

</details>

---

## A smarter base: QAT
Google's QAT (5k steps, fake-quant + KL to BF16) cuts perplexity drop 54% at Q4_0 vs PTQ — we keep your QAT base intact. Love StyleTune-V2 but want QAT? Keep the QAT model, cast any voice onto it.

---

## Evaluation

File A (unmodified Orion-26B) vs. file B (same file, `lm_head` replaced).
Temperature 0.0, same prompts, budgets, and extraction both sides:

| Task | n | A | B |
|---|---|---|---|
| ARC-Challenge | 100 | 94 | 95 |
| MMLU (2 × 57 subjects) | 114 | 101 | 103 |
| GSM8K | 100 | 76 | 92 |

Unanswered (empty after thought ran out, never scored as wrong) — A: 0, 8,
23 · B: 0, 4, 6. Answered-accuracy — ARC 0.940/0.950, MMLU 0.953/0.936,
GSM8K 0.987/0.979. Thinking lengths roughly match (no pairing script was
archived, so no median is claimed).

Writing voice, 32 prompts at temp 0.7, same neutral discipline:

| Measure | A | B |
|---|---|---|
| Shared trigram vocab, mean (pair metric) | 0.013 | — |
| Cliché hits per 100 words | 0.141 | 0.075 |
| Lexical diversity | 0.444 | 0.505 |

Audition your own model the same way:
[`audition/voice-check.py`](./audition/voice-check.py) (capability),
[`audition/voice-taste.py`](./audition/voice-taste.py) (voice). Full
tables, method, and every prompt/answer/trace: [`results.md`](./results.md).

Gryphe (n=200): 52% fewer clichés (1.141 → 0.551) + 19.9% shared vocab at greedy 0.0 — their numbers, cited from their card. Ours are in the tables above.

> Still skeptical? Honestly, good — that's exactly who this section is for. Every number above reproduces with the commands in [`benchmarking.md`](./benchmarking.md) and [`creative-bench.md`](./creative-bench.md), and if anything doesn't check out we'd genuinely like to know. The traces are on disk waiting.

---

## Limitations

- **Heuristic mismatch:** Our 50-phrase list misses Gryphe's private regex (`calculating xx`, `predatory xx`, and others), so absolute 0.10–0.18 vs 1.141 → 0.551 is not comparable—only direction and low shared vocabulary are signal.
- **Sample size and prompts:** 10 single-turn prompts vs Gryphe's 200 multi-turn certified set (intervals 1–20, ends on user turn). Small sample, higher variance.
- **Thinking overhead:** Gemma 4 thinking mode (`<|channel>thought`) adds roughly 3k characters (~600–700 tokens) of thinking trace in our probes. Gryphe's eval predates thinking configs and did not report this split.
- **Determinism:** Greedy 0.0 reduces variance but still yields more canonical phrasing (shared 1.6%→3.2%)—expected, not a failure.
- **If you see looping, use the delta path** (`voice delta` → `voice cast … delta-…`). Tiny shifts can affect behavior on abliterated targets. See “Why a delta helps when looping” above.
- **Scope:** Style transfer changes phrasing and voice, not knowledge or factuality. Not evaluated for safety, bias, or instruction following. See Gemma 4 model card Limitations.

---


## References

- **Gemma 4 Technical Report**—Gemma Team, 2026. [arXiv:2607.02770](https://arxiv.org/abs/2607.02770)—base model `google/gemma-4-26B-A4B-it` (MoE 26B A4B, 256K context, 262K vocab).
- **Gemma 3 Quantization-Aware Training**—Google Developers Blog, Apr 18, 2025: [State-of-the-art AI to consumer GPUs](https://developers.googleblog.com/en/gemma-3-quantized-aware-trained-state-of-the-art-ai-to-consumer-gpus/)—QAT recipe (5k steps, fake-quant + KL to BF16 teacher, 54% less perplexity drop at Q4_0).
- **Gryphe StyleTune-V2**—[Model card](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2) and [discussion #1](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2/discussions/1)—200-prompt eval, private regex, 1.141 → 0.551 and 19.9% shared vocabulary.
- **lm-evaluation-harness**—[EleutherAI](https://github.com/EleutherAI/lm-evaluation-harness)—the engine behind our capability runs (ARC, MMLU, GSM8K task definitions and scoring flow).
- **tinyBenchmarks**—[Felipe Maia Polo et al.](https://github.com/felipemaiapolo/tinyBenchmarks)—the 100-item calibrated slices that made CPU-side benchmarking practical.
- **EQ-Bench Creative Writing v3**—[Samuel J. Paech](https://github.com/EQ-bench/creative-writing-bench)—our 32 writing prompts (vendored with citation); we use the prompts only, scored our own way, no judge model.
- **OpenAI simple-evals**—the precedent for generative letter-answer scoring, which our multiple-choice method follows.

---

## Use with Hugging Face

### GGUF (this repo—local with llama.cpp)

This is the native path for the fused model above—no Python, no adapter at runtime:

```bash
llama serve -m ./voiced/model.gguf --jinja
curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"voiced","messages":[{"role":"user","content":"Write a tavern scene, no clichés."}],"temperature":1.0}'
```

### Transformers (HF-native snippet—for the base or other safetensors voices)

The Voice tool extracts the output-projection tensor (`lm_head` and friends) from safetensors or GGUF models. For any HF `transformers` model (including the base below), the canonical snippet is:

```python
from transformers import pipeline

# Base model—valid, lowercased HF ID (link verified, HF is case-insensitive)
# https://huggingface.co/google/gemma-4-26b-a4b-it
pipe = pipeline("text-generation", model="google/gemma-4-26b-a4b-it")
print(pipe("Write a short tavern scene with varied diction:")[0]["generated_text"])

# For a StyleTune finetune example (illustrative):
# pipe = pipeline("text-generation", model="gryphe/gemma-4-26b-a4b-styletune-v2")
```

> **Base-model note:** `google/gemma-4-26b-a4b-it` is the lowercased form of the real HF ID [`google/gemma-4-26B-A4B-it`](https://huggingface.co/google/gemma-4-26B-A4B-it) (verified live, Apache-2.0 via Gemma license). `gryphe/gemma-4-26b-a4b-styletune-v2` is the lowercased illustrative voice source—replace with any compatible `safetensors` model that shares architecture and vocab. Relation: `base_model_relation: finetune` (the voice is lifted from a finetune of this base).

---

## Demo

Local demo — same one-file run:

```bash
llama serve -m ./voiced/model.gguf
```

---

## Choosing a style

Pick the voice you like. Cast it directly. That is the default. Make a delta only when you need it:

- **Full voice:** The exact voice from the source model. Use it when you want that model's voice, exactly. Two steps: get and cast.
- **Delta:** Make once — casts onto any compatible target of that family. One style, all your bases.

Both fuse the same way into the output file. Small, sharp, and complete.

If you are not sure, start direct:

```bash
voice cast ./model.gguf styletune-v2 --out ./voiced/
```

If a model loops, try delta:

```bash
voice delta styletune-v2
voice cast ./model.gguf delta-styletune-v2 --out ./voiced/
```

Niche combinations (delta-as-base, delta-on-delta) ask for a typed phrase to
confirm, and fail fast under `--yes`/non-interactive — re-run on a TTY to proceed.

---

## Compatibility — scalpel needs the same cut

Runs with compatible models that share the same architecture and vocabulary. Check shape before you cast — same family, same shape, or it won't fit. *This is why voicepacks are inevitable: one tensor is one cast, so trying is cheap — what you mix is up to you.*

**Works with:**

- Hugging Face `safetensors` models that expose an output projection — `lm_head.weight`, `output.weight`, or tied `embed_tokens.weight` auto-found
- GGUF models of the same architecture and vocab size—the rest of the model stays exactly as it was
- Transposed heads and `BF16`/`F16`/`F32` — handled, no flag needed
- `llama.cpp` and anything that reads GGUF—run with `llama serve -m <voiced.gguf>`

**Does not work with:**

- Mismatched architectures or vocab sizes—shape must match
- Missing output projection

Your voiced GGUF is standalone. No extra files. No extra steps to run.

**Split—quantized vs full precision:** The source `safetensors` voice is full precision (`BF16`/`F16`/`F32`), full shape. The fused GGUF keeps **all tensors at their original quantization except the output head, which is written at `Q8_0`** when `last dim %32==0` (true for Gemma 4 26B: hidden 2816, vocab 262144) — otherwise it falls back to `F16` (larger, ~2× Q8_0, but compatible; human-in-loop warned). For deltas, the math is `abliterated_head (dequantized to F32) + delta (F16→F32)` then quantized. All other tensors and metadata (tokenizer, vocab, arch) are byte-copied.

**Disclosures:** `get` and `delta` fetch from Hugging Face and need network access. `cast` writes a new GGUF to disk, so ensure you have free space for a full model copy.

---

## Your files, where they are

Your library lives at `~/.voices/`:

```text
~/.voices/
  styletune-v2/voice.safetensors      # your voice, single tensor
  styletune-v2/voice.json             # metadata for that voice
  delta-styletune-v2/                 # portable style for reuse
  delta-styletune-v2/voice.safetensors
  delta-styletune-v2/voice.json
  base/<org>/<model>.safetensors      # cached base head
  base/<org>/<model>.json             # metadata for the base
```

Notes:

- Names are lowercased when saved (`StyleTune-V2` → `styletune-v2`) and allow letters, numbers, hyphens, underscores — no spaces, `/`, `\`, dots, colons, and never starting with `delta-` (reserved for deltas). When no name is given, the default is slugified from the source (`./my model.gguf` → `my-model`).
- `voice list` shows voices and deltas. `voice list base` shows cached bases. `voice info <name>` shows details for any entry.

---

## Troubleshooting

**Voice not found:**

Use `voice list` to see what is saved. Names match case-insensitively. `StyleTune-V2` and `styletune-v2` resolve to the same entry.

**Shape mismatch. Does not fit this model:**

The voice and the target must share the same head shape. A 26B head will not fit a 12B model. Try a voice from the same architecture and vocab size.

**Tied weights:**

Some models tie the output projection to the embedding. Voice finds the correct tensor automatically. You do not need to specify it.

**Could not reach the model:**

Check the `org/model` name and your connection. Voice fetches the header first and will tell you if the model is not accessible.

**Output folder not writable / want a different location:**

`voice cast` without `--out` saves to `~/Voiced/<voice>-<model>/<voice>-<model>.gguf` (sane, no overwrite of your input). Want elsewhere?

```bash
voice cast ./model.gguf styletune-v2 --out ./voiced/
voice cast ./model.gguf styletune-v2 --out ./voiced/model.gguf
voice cast ./model.gguf styletune-v2 --out ~/my-voices/
```

Every wait shows a bar — `→ lm_head.weight 42% · 604/1437 MB · 87 MB/s · 9s`; if it hits the net, you get `MB/s` + `ETA`. `delta` crafting shows `→ crafting delta 50% · 744/1476 MB · 420 MB/s` too. Add `-v` for more detail. You can pass a direct `.safetensors` path to `cast` instead of a saved name when needed.

---

## Details

<details>
<summary>What is inside the files</summary>

- Voice: single-tensor `safetensors`, `lm_head.weight` or `output.weight`, original dtype (`BF16`/`F16`/`F32`), full shape.
- Delta: single-tensor `safetensors` + tiny marker `delta.voice.marker` (`U8 [1]`) + `__metadata__ {"type":"delta"}`, `F16`, same shape, `voice − base`. Marker lets `voice cast model.gguf delta.safetensors` auto-detect and fuse (just works, no flag, 1 byte overhead, ignored except creation/cast); old `delta-` folders without marker still work via `voice.json type:delta`. Custom `style.delta` (like `Lora/StyleTune/style.safetensors`) is not our marker — intentionally not auto-fused (use `delta-` folder or `voice cast <target> <voice> <tensor>` explicit if you want it).
- Voiced GGUF: copy of your model with the output head replaced and quantized to `Q8_0`. All other tensors and metadata are preserved. Vocab, tokenizer, and architecture stay exactly as they were.

How it works under the hood:

- `get` downloads only the head bytes with range requests, not the whole file, then saves to `~/.voices/<name>/`.
- `delta` subtracts the base head from the voice head (`voice − base`) and saves an `F16` delta as `delta-<name>`. The base head is cached once at `~/.voices/base/<org>/<model>.safetensors`.
- `cast` replaces the head and writes a new GGUF with the head at `Q8_0` (`delta to Q8_0` for deltas, direct fuse for full voices). The result is a complete model.

A voice lives in the last layer. Changing that layer changes how the model sounds. Voice saves that layer and casts it onto a compatible model you already have—fused, standalone, and ready to run. Transposition between `[vocab, hidden]` and `[hidden, vocab]` is handled automatically. So is `BF16 to F32` for the math and `F32 to Q8_0` for the result (`last dim %32==0` else `F16` fallback, still compatible).

**Scope:** This card documents the Voice tool (adapter extraction) and its quantized GGUF output (head at `Q8_0`). Base weights remain under their source license; tool code is Apache-2.0—see [License](#license).

</details>

---

## Collection

This voice builds on **Gemma 4**. Find all Gemma 4 models in the official collection:

- **Google Gemma 4 Collection:** [https://huggingface.co/collections/google/gemma-4](https://huggingface.co/collections/google/gemma-4)—includes `google/gemma-4-26B-A4B-it` (this card's `base_model`) and `google/gemma-4-26B-A4B`.

Related StyleTune voices (examples, any compatible `safetensors` works):

- StyleTune: [12B](https://huggingface.co/Gryphe/Gemma-4-12B-StyleTune) · [26B](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune) · [26B V2](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2) · [31B](https://huggingface.co/Gryphe/Gemma-4-31B-StyleTune)

---

## Credits

[Gryphe](https://huggingface.co/Gryphe) proved one tensor changes everything. [Anthracite](https://huggingface.co/Anthracite) and [Latitude](https://huggingface.co/Latitude) helped make it happen. The MythoMax lineage found that `lm_head` carries style. [Hugging Face](https://huggingface.co/docs/safetensors) made the format portable. [llama.cpp](https://github.com/ggerganov/llama.cpp) made it runnable.

StyleTune: [12B](https://huggingface.co/Gryphe/Gemma-4-12B-StyleTune) · [26B](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune) · [26B V2](https://huggingface.co/Gryphe/Gemma-4-26B-A4B-StyleTune-V2) · [31B](https://huggingface.co/Gryphe/Gemma-4-31B-StyleTune)

> All StyleTune links are examples. Replace with any compatible voice you prefer.

---

## License

**Voice tooling** in this repository is **Apache-2.0**—see [`LICENSE`](https://www.apache.org/licenses/LICENSE-2.0). This covers the `voice` code and packaging only.

**Voices, deltas, and base heads keep their source model license.** When you run `voice get` or `voice delta`, the saved `voice.json` records the source license for your reference. For example, `google/gemma-4-26b-a4b-it` (display: `google/gemma-4-26B-A4B-it`) remains under its Gemma license (Apache-2.0 with Gemma terms—see [google/gemma-4-26B-A4B-it](https://huggingface.co/google/gemma-4-26B-A4B-it) and [ai.google.dev/gemma/docs/gemma_4_license](https://ai.google.dev/gemma/docs/gemma_4_license)). Check the Hugging Face model card before you share a voiced model. The `google/gemma-4-26b-a4b-it` name in the frontmatter is the lowercased, verifiable HF ID (link lives, case-insensitive); `gryphe/gemma-4-26b-a4b-styletune-v2` and other StyleTune names are illustrative examples—use any compatible model you have access to.