hkblockchaintechnology commited on
Commit
4ffbfd5
Β·
verified Β·
1 Parent(s): 6f690a9

Final 1.0.0 checksum and PDF fix note

Browse files
Files changed (1) hide show
  1. README.md +403 -402
README.md CHANGED
@@ -1,402 +1,403 @@
1
- ---
2
- license: apache-2.0
3
- language:
4
- - en
5
- - multilingual
6
- base_model:
7
- - Qwen/Qwen3-1.7B
8
- base_model_relation: quantized
9
- library_name: llama.cpp
10
- pipeline_tag: text-generation
11
- quantized_by: hkblockchaintechnology
12
- tags:
13
- - gguf
14
- - llama.cpp
15
- - cpu-inference
16
- - q4_k_m
17
- - qwen3
18
- - offline
19
- - local-first
20
- - low-end-hardware
21
- - document-generation
22
- ---
23
-
24
- # tiny-agent-gguf
25
-
26
- Quantized language models for **Tiny Agent** β€” a Windows application that gives
27
- you Word, Excel and PowerPoint with an AI assistant that runs on your own CPU,
28
- with no GPU, no cloud API and no account.
29
-
30
- **The app (1.34 GB):** [Download `TinyAgentSetup-1.0.0.exe`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgentSetup-1.0.0.exe)
31
- ([file page](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/releases/TinyAgentSetup-1.0.0.exe)).
32
- It is in the **dataset** repository, not this model repository, under
33
- `releases/`. The file browser does not preview `.exe` files, so use the direct
34
- link if you cannot see it. SHA-256:
35
- `fbdaff515097fbd1317e3c9ba169a44a6a3c7a507124793b2e95a7c5a711b735`.
36
- The installer is not code-signed; Windows SmartScreen may ask you to choose
37
- **More info -> Run anyway**. A [portable ZIP (1.44 GB)](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgent-1.0.0-portable.zip)
38
- is also published, SHA-256
39
- `0fdf56bd89b1025b8f4f03ace0003b45d46ca80b3949f6a67e67f47ef782a9c0`.
40
- All files and checksums: [`releases/README.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/releases/README.md).
41
-
42
- This repository supplies the model that installer uses β€” or that you can point any
43
- local `llama-server` at.
44
-
45
- **The signature idea:** Tiny Agent is an Office-style workspace with the assistant
46
- present in *every* workflow β€” **Create, Edit, Polish and Batch** β€” rather than a
47
- chat window bolted onto a menu. Every workflow ends in an ordinary `.docx`,
48
- `.xlsx` or `.pptx` file that real Office applications open, and every edit is
49
- verified against the file's structure before it is offered to you.
50
-
51
- **Release status, 1.0.0 (rebuilt 19 October 2026):** 4/4 AI edits verified; real
52
- Microsoft Office opened and exported all 4 outputs; 12/12 repeated plans usable;
53
- 56/56 file-level audit checks. The installer was rebuilt after PDF fixes for the
54
- page tree, list markers, table wrapping/page breaks, and spreadsheet export limits;
55
- the frozen app, portable ZIP and installer all pass their end-to-end harnesses,
56
- including a PDF export with real pages and extractable text. Measured comparison:
57
- [`docs/COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md).
58
-
59
- These files are **quantizations of existing Apache-2.0 models**, not new models.
60
- Nothing here is fine-tuned: we convert and quantize, so the knowledge, biases
61
- and limitations are inherited unchanged from the base model.
62
-
63
- ## TL;DR
64
-
65
- | | |
66
- |---|---|
67
- | What it is | Qwen3-1.7B converted to GGUF and quantized to 4-bit |
68
- | What it's for | Filling short, schema-constrained JSON slots in the Tiny Agent pipeline |
69
- | Licence | Apache-2.0 β€” free to redistribute with a product |
70
- | Runs on | CPU only, no GPU. ~1.2 GB RAM for the 4-bit build |
71
- | Speed | 6.5 tok/s on a 2014-era 4-core desktop; **11.5 tok/s** with speculative decoding |
72
- | Not for | Being asked to "write me a report" in a single prompt |
73
-
74
- ## Files in this repository
75
-
76
- | File | Size | What it is |
77
- |---|---|---|
78
- | `qwen3-1.7b-Q4_K_M.gguf` | **1.28 GB** | the default model |
79
- | `qwen3-0.6b-Q4_K_M.gguf` | **0.48 GB** | smaller and roughly 2x faster |
80
- | `qwen3-1.7b-eagle3.gguf` | **0.28 GB** | EAGLE3 speculative draft for the 1.7B model |
81
-
82
- Sizes are the real blob sizes, not estimates. All three are Apache-2.0 and safe
83
- to redistribute inside a product.
84
-
85
- SHA-256, for verifying a download:
86
-
87
- | File | SHA-256 |
88
- |---|---|
89
- | `qwen3-1.7b-Q4_K_M.gguf` | `245362960ec00bfe277c0e06ba9811a5f1a580f6238d3bc50b6fd3a82f031051` |
90
- | `qwen3-0.6b-Q4_K_M.gguf` | `e4c97785c11e2d8547a54fe104f4bedcdf3358d7e95d3f36876ed6caa96ab851` |
91
- | `qwen3-1.7b-eagle3.gguf` | `7fd1b0338f7790fa1f8b372ee72060162c4db74e4efbd89f5b28ebb9a01b4c0b` |
92
-
93
- ## What it can do
94
-
95
- Measured by actually running it β€” these are observed behaviours, not claims:
96
-
97
- | Task | Verdict | Notes |
98
- |---|---|---|
99
- | Return strictly valid JSON matching a schema | βœ… reliable | Enforced by a llama.cpp grammar, so it is structurally impossible to emit malformed JSON |
100
- | Plan a document outline (3–6 sections) | βœ… reliable | Produces sensible, ordered headings |
101
- | Write 1–3 paragraphs of grammatical prose on a topic | βœ… good | Coherent and readable; occasionally generic |
102
- | Condense source material into 3–5 short bullets | βœ… good | Best when given explicit research notes |
103
- | Follow small constraints ("under 12 words", "no markdown") | βœ… usually | Occasionally needs the constraint repeated |
104
- | Write a *whole* multi-page document in one pass | ❌ no | It drifts, repeats and loses structure β€” see the design note below |
105
- | Be factually accurate from memory alone | ❌ no | It will invent plausible specifics. Grounding in retrieved text is what makes output trustworthy |
106
- | Do arithmetic, analysis or comparisons | ❌ no | Use Python for that |
107
- | Cite its sources unprompted | ❌ no | Citations are attached by the pipeline, not the model |
108
- | Keep a consistent voice across many sections | ⚠️ partial | Sections are generated independently, so tone can drift |
109
-
110
- ## Where the assistant sits: every workflow, not a chat box
111
-
112
- The model is one component of an Office-style application, and the interface is
113
- built so the assistant is available at each step rather than in a separate tab:
114
-
115
- | Surface | The user does | The model does | Plain Python does |
116
- |---|---|---|---|
117
- | **Create** | writes a paragraph brief | plans the outline and short text slots | styles, tables, charts, pagination, file writing |
118
- | **Edit** | opens an existing file and says what changes | returns only the allowed replacement/row/slide groups | applies them to a copy and fingerprints the result |
119
- | **Polish** | asks for a review | offers editorial suggestions | finds empty slides, blank cells and other mechanical defects |
120
- | **Batch** | writes one instruction and selects files | plans each file independently | applies, verifies and reports per file |
121
-
122
- That is the signature of the product: **an Office workspace with AI in every
123
- workflow**, not an assistant that produces text for a human to paste. The local
124
- model is deliberately small because the surrounding code owns structure, file
125
- format and verification.
126
-
127
- ## Why this model, and not something bigger
128
-
129
- Tested rather than assumed. Six CPU-sized models were run through the real
130
- pipeline against identical frozen research notes, and scored on how faithfully
131
- they filled the JSON slots:
132
-
133
- | model | grounding | repetition | verdict |
134
- |---|---|---|---|
135
- | **qwen3:1.7b** | **0.460** | 0.065 | **best of the six** |
136
- | phi4-mini:3.8b | 0.375 | 0.062 | slower, grounded less |
137
- | granite4:micro | 0.353 | 0.050 | worst instruction-following on shape |
138
- | qwen3:4b | 0.327 | **0.128** | 2.4x the parameters, worst repetition |
139
- | qwen3:0.6b | 0.213 | 0.000 | thin, but ~2.4x faster |
140
- | llama3.2:3b | 0.562* | 0.000 | failed: 2 sections, 118 words, stopped |
141
-
142
- *\*tiny-sample artefact; it returned the wrong shape.*
143
-
144
- `Qwen3-1.7B` grounds retrieved facts best while staying fastest of the
145
- faithful options. On this hardware the bottleneck is **tokens per second, not
146
- parameters of world knowledge**, so a larger model buys nothing measurable and
147
- costs multiples of the time per document. Full method and raw data:
148
- [`docs/MODEL-BENCH.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/MODEL-BENCH.md).
149
-
150
- ## How Tiny Agent uses it
151
-
152
- The model is never asked to write a document, and it never touches a file. It is
153
- asked one small question at a time, and deterministic Python assembles the result:
154
-
155
- ```
156
- 1. route which KINDS of change could this instruction need?
157
- (replacements | newHeadings | newParagraphs | rows | totals
158
- | slides | charts | theme) <- deterministic
159
- 2. plan the model fills ONLY those slots, JSON enforced by a llama.cpp
160
- grammar, so a malformed plan is structurally impossible
161
- 3. apply python-docx / openpyxl / python-pptx write a NEW file <- deterministic
162
- 4. verify fingerprint the file before and after, and report anything that
163
- changed WITHOUT being asked <- deterministic
164
- ```
165
-
166
- Step 1 is what makes a model this size dependable: rather than a flat form with
167
- eight optional sections to wander around, it is handed only the two or three the
168
- instruction actually needs. Steps 3 and 4 mean its output can be *checked* rather
169
- than trusted, which is the difference between a demo and a tool you would point at
170
- real work.
171
-
172
- Measured with the real model in the product pipeline:
173
-
174
- | Run | Result |
175
- |---|---|
176
- | Competitive benchmark, i5-7200U (2 cores / 4 threads, 8 GB, no GPU) | **4 of 4** tasks verified; **13.8–34.5 s**, mean **19.8 s** |
177
- | Real Microsoft Office opened the four outputs | **4 of 4**, no repair step |
178
- | Real Microsoft Office exported them to PDF | **4 of 4**, content intact |
179
- | Repeatability harness, reference hardware | **12 of 12** plans produced a usable document (3 runs each of a Word edit, a spreadsheet edit, a deck edit and a new Word table) |
180
- | Warm plan | **2.5–5 s** typical; slowest measured 27 s (new Word table) |
181
-
182
- The detailed head-to-head, including where Office and WPS win, is in
183
- [`docs/COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md).
184
-
185
- One measured failure worth publishing, because it is the kind of thing a card
186
- usually leaves out: offered a single optional group, this model answered with prose
187
- in `summary` and left the group empty β€” twice in a row, on every run. Naming the
188
- group in the retry prompt did not fix it; making that one group **required** in the
189
- retry grammar did, immediately. That is the whole design thesis in one incident:
190
- the fix belongs in the shape of the output, not in the politeness of the request.
191
-
192
- Each step is a JSON-schema-constrained call. For example, a plan's contract is
193
- handed to llama.cpp as a grammar, so the shape is enforced by the decoder rather
194
- than requested in the prompt:
195
-
196
- ```json
197
- {
198
- "type": "object",
199
- "properties": {
200
- "newParagraphs": {
201
- "type": "array",
202
- "minItems": 1,
203
- "items": {"type": "string"}
204
- }
205
- },
206
- "required": ["newParagraphs"]
207
- }
208
- ```
209
-
210
- That is why a 1.7B model is usable for a real task: structure, formatting, file
211
- writing and verification are handled by code, and the model only supplies short
212
- strings where a small model is genuinely competent.
213
-
214
- ## Hardware and measured speed
215
-
216
- Reference machine β€” deliberately weak, and the actual development target:
217
-
218
- | | |
219
- |---|---|
220
- | CPU | Intel Core i5-4460 (Haswell, 4 cores / 4 threads, AVX2) |
221
- | RAM | 16 GB DDR3-1333 |
222
- | GPU | none used |
223
- | Storage | 7200 rpm HDD |
224
-
225
- | Model | File size | Cold load | **Generation** |
226
- |---|---|---|---|
227
- | Qwen3-1.7B Q4_K_M | 1.28 GB | ~13 s | **6.50 tok/s** |
228
- | Qwen3-1.7B Q4_K_M **+ n-gram speculation** | 1.28 GB | ~13 s | **11.46 tok/s** (1.76x) |
229
- | Qwen3-1.7B Q4_K_M + EAGLE3 draft | +0.28 GB | ~13 s | **4.00 tok/s β€” slower**, see below |
230
- | Qwen3-0.6B Q4_K_M | 0.48 GB | ~6 s | ~24 tok/s (measured via Ollama) |
231
-
232
- The generation figures were measured with the exact CPU-only `llama.cpp` build
233
- that ships in the product, 4 threads, a 4096-token context and a 220-token
234
- budget. The n-gram row is the mean of repeat runs on the same request.
235
-
236
- ### What that means in practice
237
-
238
- Measured end to end on the shipped runtime, web research enabled, 11 sources
239
- retrieved:
240
-
241
- | Job | Wall clock |
242
- |---|---|
243
- | 3-section researched Word report | **202 s** |
244
- | 3-slide deck | ~112 s |
245
-
246
- The effective rate is well below the raw tokens/second because prompt
247
- processing over injected research context dominates, and every job makes
248
- several calls in sequence. That is why the interface streams progress: two to
249
- four minutes is perfectly acceptable for a "generate document" button, but only
250
- if the user can see which stage is running.
251
-
252
- ### Speculative decoding is not optional on a CPU
253
-
254
- Speculative decoding drafts several tokens cheaply and verifies them in one
255
- forward pass of the real model. On a CPU β€” where a forward pass is expensive and
256
- a batch is comparatively cheap β€” this is the single largest speedup available,
257
- and it costs nothing in output quality.
258
-
259
- `llama-server -m qwen3-1.7b-Q4_K_M.gguf --spec-type ngram-mod` needs **no extra
260
- download** and measured **6.50 β†’ 11.46 tok/s**. It mines repeated token patterns
261
- from the context, so it is a *warm-session* win: the first request of a session
262
- gains almost nothing (7.33 tok/s) and the third reaches 11.46 tok/s as the
263
- shared hash pool fills. That suits a document generator exactly, because a job
264
- is several calls in a row sharing a long system prompt and emitting repetitive
265
- JSON.
266
-
267
- EAGLE3 is the theoretically stronger option: a one-layer draft that reads the
268
- target model's hidden states and should therefore achieve a much higher
269
- acceptance rate. This repo ships `qwen3-1.7b-eagle3.gguf` and it is used like
270
- this:
271
-
272
- ```bash
273
- llama-server -m qwen3-1.7b-Q4_K_M.gguf -md qwen3-1.7b-eagle3.gguf \
274
- --spec-type draft-eagle3 --spec-draft-n-max 8
275
- ```
276
-
277
- **It measured slower on a CPU, and this card will not pretend otherwise.**
278
-
279
- | Configuration | Speed | Draft acceptance |
280
- |---|---|---|
281
- | No speculation | 6.50 tok/s | β€” |
282
- | n-gram (`ngram-mod`) | **11.46 tok/s** | 0.53 (warm) |
283
- | EAGLE3 draft | **4.00 tok/s** | 0.089 |
284
-
285
- Acceptance was only 8.9%, and the draft shares the same 4 physical cores as the
286
- target, so it steals more throughput than it saves. EAGLE3 is a large win on a
287
- GPU β€” where the tiny draft runs nearly free beside the target β€” and a
288
- regression on a 4-thread CPU.
289
-
290
- This was re-checked on a much faster machine (a 20-core server CPU running
291
- CPU-only, 4 threads) using our own converted GGUF: baseline 21.90 tok/s, n-gram
292
- 21.60 tok/s on a cold single run, EAGLE3 **16.30 tok/s (0.74x)**. So EAGLE3 is
293
- slower regardless of target conversion, and n-gram's benefit genuinely depends
294
- on a warm, repetitive session β€” which is the normal case for this tool.
295
-
296
- **Prefer n-gram speculation on CPU; treat the EAGLE3 file as an experiment.**
297
-
298
- Practical consequences:
299
-
300
- * **Cold load costs ~13 s on a spinning disk.** Keep the model resident between
301
- requests rather than reloading per call.
302
- * Use one thread per *physical* core. More threads than physical cores is slower.
303
- * Qwen3 is a reasoning model. Left alone it spends most of its budget on hidden
304
- thinking tokens, so **disable thinking** (`think=false`, or
305
- `chat_template_kwargs={"enable_thinking": false}`).
306
- * A grounded 3-section report takes ~140 s end to end. That is acceptable for a
307
- "generate document" button, but only with progress reporting.
308
-
309
- ## Quick start
310
-
311
- **llama.cpp server** (OpenAI-compatible, supports JSON-schema constrained output):
312
-
313
- ```bash
314
- llama-server -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 --port 8080
315
- ```
316
-
317
- **llama.cpp CLI:**
318
-
319
- ```bash
320
- llama-cli -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 \
321
- -p "Return only JSON: {\"heading\": str, \"paragraphs\": [str]} for a section about heat pumps."
322
- ```
323
-
324
- **Ollama** (optional β€” the product does not need it):
325
-
326
- ```bash
327
- ollama pull hf.co/hkblockchaintechnology/tiny-agent-gguf
328
- ```
329
-
330
- The official CPU-only `llama.cpp` Windows release is an **18.8 MB** zip (a 46 MB
331
- folder unpacked) and needs no GPU, CUDA toolkit or Python environment β€” that is
332
- the intended way to ship this.
333
-
334
- ## Prompting notes for a model this size
335
-
336
- 1. **One question per call.** Asking for several things at once is where small
337
- models fall apart.
338
- 2. **Constrain the output shape.** Use a JSON schema or GBNF grammar. It removes
339
- an entire class of parsing failures.
340
- 3. **Disable thinking.** Qwen3 will otherwise spend its whole budget reasoning.
341
- 4. **Give it the facts.** Put retrieved text in the prompt; it cannot supply
342
- accurate specifics from memory.
343
- 5. **Ask for less text.** 2–3 short paragraphs per section works; "write a
344
- detailed 2000-word report" does not.
345
- 6. **Expect and clean up artefacts.** It adds list numbering to headings and
346
- sometimes leaks markdown into prose fields. Strip these deterministically
347
- during assembly rather than fighting them with prompt wording.
348
-
349
- ## Limitations
350
-
351
- * **Hallucination.** Without grounding, specifics (figures, dates, product
352
- names) are unreliable and often invented. Tiny Agent mitigates this by injecting
353
- retrieved web text and attaching a source list, but it does not eliminate it.
354
- * **Inherited knowledge cutoff and biases.** Because this is a quantization, the
355
- base model's training data, cutoff and biases apply unchanged.
356
- * **Language.** The base model is multilingual, but the pipeline prompts and all
357
- validation were done in English.
358
- * **Repetition.** Sections written in separate calls sometimes restate the same
359
- point. Human editing is expected.
360
- * **Not a general chat model.** It is tuned here for structured slot-filling, not
361
- for open-ended conversation.
362
- * **Quantization degrades quality slightly** versus the full-precision base
363
- model. 4-bit is the point where quality and speed balance best on this class
364
- of hardware.
365
-
366
- ## Training data
367
-
368
- No training or fine-tuning was performed. This repository contains quantized
369
- conversions of:
370
-
371
- * [`Qwen/Qwen3-1.7B`](https://huggingface.co/Qwen/Qwen3-1.7B)
372
- * [`Qwen/Qwen3-0.6B`](https://huggingface.co/Qwen/Qwen3-0.6B)
373
-
374
- and a converted speculative draft:
375
-
376
- * [`AngelSlim/Qwen3-1.7B_eagle3`](https://huggingface.co/AngelSlim/Qwen3-1.7B_eagle3)
377
- (Apache-2.0, Tencent AngelSlim) β€” converted to GGUF with
378
- `convert_hf_to_gguf.py --target-model-dir Qwen/Qwen3-1.7B`. It is a *draft*
379
- model: it proposes tokens that the 1.7B model verifies, and it never changes
380
- the output, only the speed. It cannot be used on its own.
381
-
382
- Refer to the base model cards for training data, evaluation results and
383
- limitations.
384
-
385
- Why these models: both are **Apache-2.0**, so they can be redistributed with a
386
- commercial product without additional conditions. Llama, Gemma and several other
387
- otherwise-capable small models are deliberately **not** bundled, because their
388
- licences carry redistribution terms that are unsuitable for shipping to end
389
- users.
390
-
391
- ## License and attribution
392
-
393
- Apache-2.0, inherited from the base models. Copyright in the base weights
394
- belongs to the Qwen team; these are derivative quantizations redistributed under
395
- the same licence.
396
-
397
- ## Related
398
-
399
- * Project source, benchmarks and generated documents: [`hkblockchaintechnology/tiny-agent`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent)
400
- * Windows installer (1.34 GB, in the dataset repository): [`TinyAgentSetup-1.0.0.exe`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgentSetup-1.0.0.exe)
401
- * User guide: [`TinyAgent-UserGuide.pdf`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/TinyAgent-UserGuide.pdf)
402
- * Measured comparison with Microsoft Office and WPS Office: [`COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md)
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - multilingual
6
+ base_model:
7
+ - Qwen/Qwen3-1.7B
8
+ base_model_relation: quantized
9
+ library_name: llama.cpp
10
+ pipeline_tag: text-generation
11
+ quantized_by: hkblockchaintechnology
12
+ tags:
13
+ - gguf
14
+ - llama.cpp
15
+ - cpu-inference
16
+ - q4_k_m
17
+ - qwen3
18
+ - offline
19
+ - local-first
20
+ - low-end-hardware
21
+ - document-generation
22
+ ---
23
+
24
+ # tiny-agent-gguf
25
+
26
+ Quantized language models for **Tiny Agent** β€” a Windows application that gives
27
+ you Word, Excel and PowerPoint with an AI assistant that runs on your own CPU,
28
+ with no GPU, no cloud API and no account.
29
+
30
+ **The app (1.34 GB):** [Download `TinyAgentSetup-1.0.0.exe`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgentSetup-1.0.0.exe)
31
+ ([file page](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/releases/TinyAgentSetup-1.0.0.exe)).
32
+ It is in the **dataset** repository, not this model repository, under
33
+ `releases/`. The file browser does not preview `.exe` files, so use the direct
34
+ link if you cannot see it. SHA-256:
35
+ `8f6f5ac3d01464ba7e1c2e4ae1ebb270a1559c26d0f94a29ae5572f067cf2503`.
36
+ The installer is not code-signed; Windows SmartScreen may ask you to choose
37
+ **More info -> Run anyway**. A [portable ZIP (1.44 GB)](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgent-1.0.0-portable.zip)
38
+ is also published, SHA-256
39
+ `82c0afa4e00d85e719c08194410858579b28e8df0646c71c6b52da28941f2419`.
40
+ All files and checksums: [`releases/README.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/releases/README.md).
41
+
42
+ This repository supplies the model that installer uses β€” or that you can point any
43
+ local `llama-server` at.
44
+
45
+ **The signature idea:** Tiny Agent is an Office-style workspace with the assistant
46
+ present in *every* workflow β€” **Create, Edit, Polish and Batch** β€” rather than a
47
+ chat window bolted onto a menu. Every workflow ends in an ordinary `.docx`,
48
+ `.xlsx` or `.pptx` file that real Office applications open, and every edit is
49
+ verified against the file's structure before it is offered to you.
50
+
51
+ **Release status, 1.0.0 (rebuilt 19 October 2026):** 4/4 AI edits verified; real
52
+ Microsoft Office opened and exported all 4 outputs; 12/12 repeated plans usable;
53
+ 56/56 file-level audit checks. The installer was rebuilt after PDF fixes for the
54
+ page tree, list markers, table wrapping/page breaks, headerless/empty tables, and
55
+ spreadsheet export limits;
56
+ the frozen app, portable ZIP and installer all pass their end-to-end harnesses,
57
+ including a PDF export with real pages and extractable text. Measured comparison:
58
+ [`docs/COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md).
59
+
60
+ These files are **quantizations of existing Apache-2.0 models**, not new models.
61
+ Nothing here is fine-tuned: we convert and quantize, so the knowledge, biases
62
+ and limitations are inherited unchanged from the base model.
63
+
64
+ ## TL;DR
65
+
66
+ | | |
67
+ |---|---|
68
+ | What it is | Qwen3-1.7B converted to GGUF and quantized to 4-bit |
69
+ | What it's for | Filling short, schema-constrained JSON slots in the Tiny Agent pipeline |
70
+ | Licence | Apache-2.0 β€” free to redistribute with a product |
71
+ | Runs on | CPU only, no GPU. ~1.2 GB RAM for the 4-bit build |
72
+ | Speed | 6.5 tok/s on a 2014-era 4-core desktop; **11.5 tok/s** with speculative decoding |
73
+ | Not for | Being asked to "write me a report" in a single prompt |
74
+
75
+ ## Files in this repository
76
+
77
+ | File | Size | What it is |
78
+ |---|---|---|
79
+ | `qwen3-1.7b-Q4_K_M.gguf` | **1.28 GB** | the default model |
80
+ | `qwen3-0.6b-Q4_K_M.gguf` | **0.48 GB** | smaller and roughly 2x faster |
81
+ | `qwen3-1.7b-eagle3.gguf` | **0.28 GB** | EAGLE3 speculative draft for the 1.7B model |
82
+
83
+ Sizes are the real blob sizes, not estimates. All three are Apache-2.0 and safe
84
+ to redistribute inside a product.
85
+
86
+ SHA-256, for verifying a download:
87
+
88
+ | File | SHA-256 |
89
+ |---|---|
90
+ | `qwen3-1.7b-Q4_K_M.gguf` | `245362960ec00bfe277c0e06ba9811a5f1a580f6238d3bc50b6fd3a82f031051` |
91
+ | `qwen3-0.6b-Q4_K_M.gguf` | `e4c97785c11e2d8547a54fe104f4bedcdf3358d7e95d3f36876ed6caa96ab851` |
92
+ | `qwen3-1.7b-eagle3.gguf` | `7fd1b0338f7790fa1f8b372ee72060162c4db74e4efbd89f5b28ebb9a01b4c0b` |
93
+
94
+ ## What it can do
95
+
96
+ Measured by actually running it β€” these are observed behaviours, not claims:
97
+
98
+ | Task | Verdict | Notes |
99
+ |---|---|---|
100
+ | Return strictly valid JSON matching a schema | βœ… reliable | Enforced by a llama.cpp grammar, so it is structurally impossible to emit malformed JSON |
101
+ | Plan a document outline (3–6 sections) | βœ… reliable | Produces sensible, ordered headings |
102
+ | Write 1–3 paragraphs of grammatical prose on a topic | βœ… good | Coherent and readable; occasionally generic |
103
+ | Condense source material into 3–5 short bullets | βœ… good | Best when given explicit research notes |
104
+ | Follow small constraints ("under 12 words", "no markdown") | βœ… usually | Occasionally needs the constraint repeated |
105
+ | Write a *whole* multi-page document in one pass | ❌ no | It drifts, repeats and loses structure β€” see the design note below |
106
+ | Be factually accurate from memory alone | ❌ no | It will invent plausible specifics. Grounding in retrieved text is what makes output trustworthy |
107
+ | Do arithmetic, analysis or comparisons | ❌ no | Use Python for that |
108
+ | Cite its sources unprompted | ❌ no | Citations are attached by the pipeline, not the model |
109
+ | Keep a consistent voice across many sections | ⚠️ partial | Sections are generated independently, so tone can drift |
110
+
111
+ ## Where the assistant sits: every workflow, not a chat box
112
+
113
+ The model is one component of an Office-style application, and the interface is
114
+ built so the assistant is available at each step rather than in a separate tab:
115
+
116
+ | Surface | The user does | The model does | Plain Python does |
117
+ |---|---|---|---|
118
+ | **Create** | writes a paragraph brief | plans the outline and short text slots | styles, tables, charts, pagination, file writing |
119
+ | **Edit** | opens an existing file and says what changes | returns only the allowed replacement/row/slide groups | applies them to a copy and fingerprints the result |
120
+ | **Polish** | asks for a review | offers editorial suggestions | finds empty slides, blank cells and other mechanical defects |
121
+ | **Batch** | writes one instruction and selects files | plans each file independently | applies, verifies and reports per file |
122
+
123
+ That is the signature of the product: **an Office workspace with AI in every
124
+ workflow**, not an assistant that produces text for a human to paste. The local
125
+ model is deliberately small because the surrounding code owns structure, file
126
+ format and verification.
127
+
128
+ ## Why this model, and not something bigger
129
+
130
+ Tested rather than assumed. Six CPU-sized models were run through the real
131
+ pipeline against identical frozen research notes, and scored on how faithfully
132
+ they filled the JSON slots:
133
+
134
+ | model | grounding | repetition | verdict |
135
+ |---|---|---|---|
136
+ | **qwen3:1.7b** | **0.460** | 0.065 | **best of the six** |
137
+ | phi4-mini:3.8b | 0.375 | 0.062 | slower, grounded less |
138
+ | granite4:micro | 0.353 | 0.050 | worst instruction-following on shape |
139
+ | qwen3:4b | 0.327 | **0.128** | 2.4x the parameters, worst repetition |
140
+ | qwen3:0.6b | 0.213 | 0.000 | thin, but ~2.4x faster |
141
+ | llama3.2:3b | 0.562* | 0.000 | failed: 2 sections, 118 words, stopped |
142
+
143
+ *\*tiny-sample artefact; it returned the wrong shape.*
144
+
145
+ `Qwen3-1.7B` grounds retrieved facts best while staying fastest of the
146
+ faithful options. On this hardware the bottleneck is **tokens per second, not
147
+ parameters of world knowledge**, so a larger model buys nothing measurable and
148
+ costs multiples of the time per document. Full method and raw data:
149
+ [`docs/MODEL-BENCH.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/MODEL-BENCH.md).
150
+
151
+ ## How Tiny Agent uses it
152
+
153
+ The model is never asked to write a document, and it never touches a file. It is
154
+ asked one small question at a time, and deterministic Python assembles the result:
155
+
156
+ ```
157
+ 1. route which KINDS of change could this instruction need?
158
+ (replacements | newHeadings | newParagraphs | rows | totals
159
+ | slides | charts | theme) <- deterministic
160
+ 2. plan the model fills ONLY those slots, JSON enforced by a llama.cpp
161
+ grammar, so a malformed plan is structurally impossible
162
+ 3. apply python-docx / openpyxl / python-pptx write a NEW file <- deterministic
163
+ 4. verify fingerprint the file before and after, and report anything that
164
+ changed WITHOUT being asked <- deterministic
165
+ ```
166
+
167
+ Step 1 is what makes a model this size dependable: rather than a flat form with
168
+ eight optional sections to wander around, it is handed only the two or three the
169
+ instruction actually needs. Steps 3 and 4 mean its output can be *checked* rather
170
+ than trusted, which is the difference between a demo and a tool you would point at
171
+ real work.
172
+
173
+ Measured with the real model in the product pipeline:
174
+
175
+ | Run | Result |
176
+ |---|---|
177
+ | Competitive benchmark, i5-7200U (2 cores / 4 threads, 8 GB, no GPU) | **4 of 4** tasks verified; **13.8–34.5 s**, mean **19.8 s** |
178
+ | Real Microsoft Office opened the four outputs | **4 of 4**, no repair step |
179
+ | Real Microsoft Office exported them to PDF | **4 of 4**, content intact |
180
+ | Repeatability harness, reference hardware | **12 of 12** plans produced a usable document (3 runs each of a Word edit, a spreadsheet edit, a deck edit and a new Word table) |
181
+ | Warm plan | **2.5–5 s** typical; slowest measured 27 s (new Word table) |
182
+
183
+ The detailed head-to-head, including where Office and WPS win, is in
184
+ [`docs/COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md).
185
+
186
+ One measured failure worth publishing, because it is the kind of thing a card
187
+ usually leaves out: offered a single optional group, this model answered with prose
188
+ in `summary` and left the group empty β€” twice in a row, on every run. Naming the
189
+ group in the retry prompt did not fix it; making that one group **required** in the
190
+ retry grammar did, immediately. That is the whole design thesis in one incident:
191
+ the fix belongs in the shape of the output, not in the politeness of the request.
192
+
193
+ Each step is a JSON-schema-constrained call. For example, a plan's contract is
194
+ handed to llama.cpp as a grammar, so the shape is enforced by the decoder rather
195
+ than requested in the prompt:
196
+
197
+ ```json
198
+ {
199
+ "type": "object",
200
+ "properties": {
201
+ "newParagraphs": {
202
+ "type": "array",
203
+ "minItems": 1,
204
+ "items": {"type": "string"}
205
+ }
206
+ },
207
+ "required": ["newParagraphs"]
208
+ }
209
+ ```
210
+
211
+ That is why a 1.7B model is usable for a real task: structure, formatting, file
212
+ writing and verification are handled by code, and the model only supplies short
213
+ strings where a small model is genuinely competent.
214
+
215
+ ## Hardware and measured speed
216
+
217
+ Reference machine β€” deliberately weak, and the actual development target:
218
+
219
+ | | |
220
+ |---|---|
221
+ | CPU | Intel Core i5-4460 (Haswell, 4 cores / 4 threads, AVX2) |
222
+ | RAM | 16 GB DDR3-1333 |
223
+ | GPU | none used |
224
+ | Storage | 7200 rpm HDD |
225
+
226
+ | Model | File size | Cold load | **Generation** |
227
+ |---|---|---|---|
228
+ | Qwen3-1.7B Q4_K_M | 1.28 GB | ~13 s | **6.50 tok/s** |
229
+ | Qwen3-1.7B Q4_K_M **+ n-gram speculation** | 1.28 GB | ~13 s | **11.46 tok/s** (1.76x) |
230
+ | Qwen3-1.7B Q4_K_M + EAGLE3 draft | +0.28 GB | ~13 s | **4.00 tok/s β€” slower**, see below |
231
+ | Qwen3-0.6B Q4_K_M | 0.48 GB | ~6 s | ~24 tok/s (measured via Ollama) |
232
+
233
+ The generation figures were measured with the exact CPU-only `llama.cpp` build
234
+ that ships in the product, 4 threads, a 4096-token context and a 220-token
235
+ budget. The n-gram row is the mean of repeat runs on the same request.
236
+
237
+ ### What that means in practice
238
+
239
+ Measured end to end on the shipped runtime, web research enabled, 11 sources
240
+ retrieved:
241
+
242
+ | Job | Wall clock |
243
+ |---|---|
244
+ | 3-section researched Word report | **202 s** |
245
+ | 3-slide deck | ~112 s |
246
+
247
+ The effective rate is well below the raw tokens/second because prompt
248
+ processing over injected research context dominates, and every job makes
249
+ several calls in sequence. That is why the interface streams progress: two to
250
+ four minutes is perfectly acceptable for a "generate document" button, but only
251
+ if the user can see which stage is running.
252
+
253
+ ### Speculative decoding is not optional on a CPU
254
+
255
+ Speculative decoding drafts several tokens cheaply and verifies them in one
256
+ forward pass of the real model. On a CPU β€” where a forward pass is expensive and
257
+ a batch is comparatively cheap β€” this is the single largest speedup available,
258
+ and it costs nothing in output quality.
259
+
260
+ `llama-server -m qwen3-1.7b-Q4_K_M.gguf --spec-type ngram-mod` needs **no extra
261
+ download** and measured **6.50 β†’ 11.46 tok/s**. It mines repeated token patterns
262
+ from the context, so it is a *warm-session* win: the first request of a session
263
+ gains almost nothing (7.33 tok/s) and the third reaches 11.46 tok/s as the
264
+ shared hash pool fills. That suits a document generator exactly, because a job
265
+ is several calls in a row sharing a long system prompt and emitting repetitive
266
+ JSON.
267
+
268
+ EAGLE3 is the theoretically stronger option: a one-layer draft that reads the
269
+ target model's hidden states and should therefore achieve a much higher
270
+ acceptance rate. This repo ships `qwen3-1.7b-eagle3.gguf` and it is used like
271
+ this:
272
+
273
+ ```bash
274
+ llama-server -m qwen3-1.7b-Q4_K_M.gguf -md qwen3-1.7b-eagle3.gguf \
275
+ --spec-type draft-eagle3 --spec-draft-n-max 8
276
+ ```
277
+
278
+ **It measured slower on a CPU, and this card will not pretend otherwise.**
279
+
280
+ | Configuration | Speed | Draft acceptance |
281
+ |---|---|---|
282
+ | No speculation | 6.50 tok/s | β€” |
283
+ | n-gram (`ngram-mod`) | **11.46 tok/s** | 0.53 (warm) |
284
+ | EAGLE3 draft | **4.00 tok/s** | 0.089 |
285
+
286
+ Acceptance was only 8.9%, and the draft shares the same 4 physical cores as the
287
+ target, so it steals more throughput than it saves. EAGLE3 is a large win on a
288
+ GPU β€” where the tiny draft runs nearly free beside the target β€” and a
289
+ regression on a 4-thread CPU.
290
+
291
+ This was re-checked on a much faster machine (a 20-core server CPU running
292
+ CPU-only, 4 threads) using our own converted GGUF: baseline 21.90 tok/s, n-gram
293
+ 21.60 tok/s on a cold single run, EAGLE3 **16.30 tok/s (0.74x)**. So EAGLE3 is
294
+ slower regardless of target conversion, and n-gram's benefit genuinely depends
295
+ on a warm, repetitive session β€” which is the normal case for this tool.
296
+
297
+ **Prefer n-gram speculation on CPU; treat the EAGLE3 file as an experiment.**
298
+
299
+ Practical consequences:
300
+
301
+ * **Cold load costs ~13 s on a spinning disk.** Keep the model resident between
302
+ requests rather than reloading per call.
303
+ * Use one thread per *physical* core. More threads than physical cores is slower.
304
+ * Qwen3 is a reasoning model. Left alone it spends most of its budget on hidden
305
+ thinking tokens, so **disable thinking** (`think=false`, or
306
+ `chat_template_kwargs={"enable_thinking": false}`).
307
+ * A grounded 3-section report takes ~140 s end to end. That is acceptable for a
308
+ "generate document" button, but only with progress reporting.
309
+
310
+ ## Quick start
311
+
312
+ **llama.cpp server** (OpenAI-compatible, supports JSON-schema constrained output):
313
+
314
+ ```bash
315
+ llama-server -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 --port 8080
316
+ ```
317
+
318
+ **llama.cpp CLI:**
319
+
320
+ ```bash
321
+ llama-cli -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 \
322
+ -p "Return only JSON: {\"heading\": str, \"paragraphs\": [str]} for a section about heat pumps."
323
+ ```
324
+
325
+ **Ollama** (optional β€” the product does not need it):
326
+
327
+ ```bash
328
+ ollama pull hf.co/hkblockchaintechnology/tiny-agent-gguf
329
+ ```
330
+
331
+ The official CPU-only `llama.cpp` Windows release is an **18.8 MB** zip (a 46 MB
332
+ folder unpacked) and needs no GPU, CUDA toolkit or Python environment β€” that is
333
+ the intended way to ship this.
334
+
335
+ ## Prompting notes for a model this size
336
+
337
+ 1. **One question per call.** Asking for several things at once is where small
338
+ models fall apart.
339
+ 2. **Constrain the output shape.** Use a JSON schema or GBNF grammar. It removes
340
+ an entire class of parsing failures.
341
+ 3. **Disable thinking.** Qwen3 will otherwise spend its whole budget reasoning.
342
+ 4. **Give it the facts.** Put retrieved text in the prompt; it cannot supply
343
+ accurate specifics from memory.
344
+ 5. **Ask for less text.** 2–3 short paragraphs per section works; "write a
345
+ detailed 2000-word report" does not.
346
+ 6. **Expect and clean up artefacts.** It adds list numbering to headings and
347
+ sometimes leaks markdown into prose fields. Strip these deterministically
348
+ during assembly rather than fighting them with prompt wording.
349
+
350
+ ## Limitations
351
+
352
+ * **Hallucination.** Without grounding, specifics (figures, dates, product
353
+ names) are unreliable and often invented. Tiny Agent mitigates this by injecting
354
+ retrieved web text and attaching a source list, but it does not eliminate it.
355
+ * **Inherited knowledge cutoff and biases.** Because this is a quantization, the
356
+ base model's training data, cutoff and biases apply unchanged.
357
+ * **Language.** The base model is multilingual, but the pipeline prompts and all
358
+ validation were done in English.
359
+ * **Repetition.** Sections written in separate calls sometimes restate the same
360
+ point. Human editing is expected.
361
+ * **Not a general chat model.** It is tuned here for structured slot-filling, not
362
+ for open-ended conversation.
363
+ * **Quantization degrades quality slightly** versus the full-precision base
364
+ model. 4-bit is the point where quality and speed balance best on this class
365
+ of hardware.
366
+
367
+ ## Training data
368
+
369
+ No training or fine-tuning was performed. This repository contains quantized
370
+ conversions of:
371
+
372
+ * [`Qwen/Qwen3-1.7B`](https://huggingface.co/Qwen/Qwen3-1.7B)
373
+ * [`Qwen/Qwen3-0.6B`](https://huggingface.co/Qwen/Qwen3-0.6B)
374
+
375
+ and a converted speculative draft:
376
+
377
+ * [`AngelSlim/Qwen3-1.7B_eagle3`](https://huggingface.co/AngelSlim/Qwen3-1.7B_eagle3)
378
+ (Apache-2.0, Tencent AngelSlim) β€” converted to GGUF with
379
+ `convert_hf_to_gguf.py --target-model-dir Qwen/Qwen3-1.7B`. It is a *draft*
380
+ model: it proposes tokens that the 1.7B model verifies, and it never changes
381
+ the output, only the speed. It cannot be used on its own.
382
+
383
+ Refer to the base model cards for training data, evaluation results and
384
+ limitations.
385
+
386
+ Why these models: both are **Apache-2.0**, so they can be redistributed with a
387
+ commercial product without additional conditions. Llama, Gemma and several other
388
+ otherwise-capable small models are deliberately **not** bundled, because their
389
+ licences carry redistribution terms that are unsuitable for shipping to end
390
+ users.
391
+
392
+ ## License and attribution
393
+
394
+ Apache-2.0, inherited from the base models. Copyright in the base weights
395
+ belongs to the Qwen team; these are derivative quantizations redistributed under
396
+ the same licence.
397
+
398
+ ## Related
399
+
400
+ * Project source, benchmarks and generated documents: [`hkblockchaintechnology/tiny-agent`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent)
401
+ * Windows installer (1.34 GB, in the dataset repository): [`TinyAgentSetup-1.0.0.exe`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/resolve/main/releases/TinyAgentSetup-1.0.0.exe)
402
+ * User guide: [`TinyAgent-UserGuide.pdf`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/TinyAgent-UserGuide.pdf)
403
+ * Measured comparison with Microsoft Office and WPS Office: [`COMPARISON-REPORT.md`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent/blob/main/docs/COMPARISON-REPORT.md)