hkblockchaintechnology commited on
Commit
39da73b
Β·
verified Β·
1 Parent(s): 7deda91

Update model card

Browse files
Files changed (1) hide show
  1. README.md +166 -35
README.md CHANGED
@@ -2,70 +2,201 @@
2
  license: apache-2.0
3
  language:
4
  - en
 
 
 
 
5
  library_name: llama.cpp
 
 
6
  tags:
7
  - gguf
 
8
  - cpu-inference
 
9
  - qwen3
10
  - offline
11
  - local-first
12
- base_model:
13
- - Qwen/Qwen3-1.7B
14
  ---
15
 
16
- # docagent-gguf
 
 
 
 
 
 
 
 
17
 
18
- Redistributable GGUF weights for **DocAgent**, an offline document-writing agent
19
- that runs on CPU-only, no-GPU machines.
20
 
21
- ## Purpose
 
 
 
 
 
 
 
22
 
23
- DocAgent ships quantized models so a user can install the product and run it
24
- entirely offline with no cloud API and no GPU. Weights hosted here are chosen so
25
- that redistribution is legally clean: **Apache-2.0 only**.
26
 
27
- ## Planned / in progress
28
 
29
- | file | base model | quant | status |
30
- |---|---|---|---|
31
- | `qwen3-1.7b-*.gguf` | `Qwen/Qwen3-1.7B` | Q4_K_M | pending |
32
- | `qwen3-0.6b-*.gguf` | `Qwen/Qwen3-0.6B` | Q4_K_M | pending |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- Weights are prepared on a GPU-enabled build box and validated by running the
35
- DocAgent pipeline against them.
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- ## Why these models
 
 
38
 
39
- Measured on the reference low-end machine (Intel i5-4460, 4 cores, HDD):
40
 
41
- | model | cold load | generation |
42
- |---|---|---|
43
- | Qwen3-0.6B | 12.0 s | **23.6 tok/s** |
44
- | Qwen3-1.7B | 25.1 s | **10.0 tok/s** |
45
 
46
- Both are Apache-2.0. 1.7B is the practical ceiling for interactive use on this
47
- class of CPU; 0.6B is used where speed matters more than prose quality.
 
 
 
 
48
 
49
- Llama, Gemma and similar weights are deliberately **not** bundled: their
50
- licences carry redistribution conditions that are unsuitable for a product
51
- distributed to end users.
 
52
 
53
- ## Usage
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  ```bash
56
- ollama pull <this-repo>/qwen3-1.7b-Q4_K_M.gguf
57
  ```
58
 
59
- or with `llama.cpp` directly:
60
 
61
  ```bash
62
- llama-server -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 --port 8080
 
 
 
 
 
 
 
63
  ```
64
 
65
- Run with 4 threads on a 4-core CPU and a 4096-token context. Disable reasoning
66
- output (`think=false` in Ollama) β€” Qwen3 otherwise spends most of its budget on
67
- hidden thinking tokens.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  ## Related
70
 
71
- * Project artifacts, source and benchmarks: `hkblockchaintechnology/docagent`
 
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** β€” an offline agent that researches
27
+ the web and writes Word documents and PowerPoint decks on a computer with **no
28
+ GPU and no cloud API**.
29
+
30
+ These files are **quantizations of existing Apache-2.0 models**, not new models.
31
+ Nothing here is fine-tuned: we convert and quantize, so the knowledge, biases
32
+ and limitations are inherited unchanged from the base model.
33
 
34
+ ## TL;DR
 
35
 
36
+ | | |
37
+ |---|---|
38
+ | What it is | Qwen3-1.7B converted to GGUF and quantized to 4-bit |
39
+ | What it's for | Filling short, schema-constrained JSON slots in the Tiny Agent pipeline |
40
+ | Licence | Apache-2.0 β€” free to redistribute with a product |
41
+ | Runs on | CPU only, no GPU. ~1.2 GB RAM for the 4-bit build |
42
+ | Speed | ~10 tokens/second on a 2014-era 4-core desktop |
43
+ | Not for | Being asked to "write me a report" in a single prompt |
44
 
45
+ ## What it can do
 
 
46
 
47
+ Measured by actually running it β€” these are observed behaviours, not claims:
48
 
49
+ | Task | Verdict | Notes |
50
+ |---|---|---|
51
+ | Return strictly valid JSON matching a schema | βœ… reliable | Enforced by a llama.cpp grammar, so it is structurally impossible to emit malformed JSON |
52
+ | Plan a document outline (3–6 sections) | βœ… reliable | Produces sensible, ordered headings |
53
+ | Write 1–3 paragraphs of grammatical prose on a topic | βœ… good | Coherent and readable; occasionally generic |
54
+ | Condense source material into 3–5 short bullets | βœ… good | Best when given explicit research notes |
55
+ | Follow small constraints ("under 12 words", "no markdown") | βœ… usually | Occasionally needs the constraint repeated |
56
+ | Write a *whole* multi-page document in one pass | ❌ no | It drifts, repeats and loses structure β€” see the design note below |
57
+ | Be factually accurate from memory alone | ❌ no | It will invent plausible specifics. Grounding in retrieved text is what makes output trustworthy |
58
+ | Do arithmetic, analysis or comparisons | ❌ no | Use Python for that |
59
+ | Cite its sources unprompted | ❌ no | Citations are attached by the pipeline, not the model |
60
+ | Keep a consistent voice across many sections | ⚠️ partial | Sections are generated independently, so tone can drift |
61
+
62
+ ## How Tiny Agent uses it
63
+
64
+ The model is never asked to write a document. It is asked one small question at
65
+ a time, and deterministic Python assembles the result:
66
+
67
+ ```
68
+ 1. interpret "what does the user want?" -> RequestKind
69
+ 2. plan "what sections, covering what?" -> ReportPlan
70
+ 3. research "what do the sources actually say?" -> retrieved text (not the model)
71
+ 4. draft "write just this section, given facts" -> SectionDraft (one call per section)
72
+ 5. assemble deterministic Python -> .docx / .pptx
73
+ ```
74
 
75
+ Each step is a JSON-schema-constrained call. For example, step 4's contract is
76
+ literally this, handed to llama.cpp as a grammar:
77
+
78
+ ```json
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "paragraphs": {
83
+ "type": "array",
84
+ "items": {"type": "string"}
85
+ }
86
+ },
87
+ "required": ["paragraphs"]
88
+ }
89
+ ```
90
 
91
+ This is why a 1.7B model is usable for a real task: the hard part (structure,
92
+ formatting, document assembly) is handled by code, and the model only supplies
93
+ short strings where a small model is genuinely competent.
94
 
95
+ ## Hardware and measured speed
96
 
97
+ Reference machine β€” deliberately weak, and the actual development target:
 
 
 
98
 
99
+ | | |
100
+ |---|---|
101
+ | CPU | Intel Core i5-4460 (Haswell, 4 cores / 4 threads, AVX2) |
102
+ | RAM | 16 GB DDR3-1333 |
103
+ | GPU | none used |
104
+ | Storage | 7200 rpm HDD |
105
 
106
+ | Model | Quant | File size | Cold load | Prompt eval | **Generation** |
107
+ |---|---|---|---|---|---|
108
+ | Qwen3-1.7B | Q4_K_M | ~1.1 GB | 25.1 s | 444 tok/s | **10.0 tok/s** |
109
+ | Qwen3-0.6B | Q4_K_M | ~0.5 GB | 12.0 s | 994 tok/s | **23.6 tok/s** |
110
 
111
+ Practical consequences:
112
+
113
+ * **Cold load is expensive on a spinning disk** (~25 s for 1.7B). Keep the model
114
+ resident between requests rather than reloading per call.
115
+ * Use `-t 4` on a 4-core CPU. More threads than physical cores makes it slower.
116
+ * Qwen3 is a reasoning model. Left alone it spends most of its budget on hidden
117
+ thinking tokens, so **disable thinking** (`think=false`, or `--reasoning-budget 0`).
118
+ * A grounded 3-section report takes ~140 s end to end. That is acceptable for a
119
+ "generate document" button, but only with progress reporting.
120
+
121
+ ## Quick start
122
+
123
+ **llama.cpp server** (OpenAI-compatible, supports JSON-schema constrained output):
124
 
125
  ```bash
126
+ llama-server -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 --port 8080
127
  ```
128
 
129
+ **llama.cpp CLI:**
130
 
131
  ```bash
132
+ llama-cli -m qwen3-1.7b-Q4_K_M.gguf -c 4096 -t 4 \
133
+ -p "Return only JSON: {\"heading\": str, \"paragraphs\": [str]} for a section about heat pumps."
134
+ ```
135
+
136
+ **Ollama** (point it at the local file):
137
+
138
+ ```bash
139
+ ollama pull <this-repo>/qwen3-1.7b-Q4_K_M.gguf
140
  ```
141
 
142
+ A CPU-only `llama.cpp` Windows build is about **19 MB** and needs no GPU, CUDA
143
+ toolkit or Python environment β€” that is the intended way to ship this.
144
+
145
+ ## Prompting notes for a model this size
146
+
147
+ 1. **One question per call.** Asking for several things at once is where small
148
+ models fall apart.
149
+ 2. **Constrain the output shape.** Use a JSON schema or GBNF grammar. It removes
150
+ an entire class of parsing failures.
151
+ 3. **Disable thinking.** Qwen3 will otherwise spend its whole budget reasoning.
152
+ 4. **Give it the facts.** Put retrieved text in the prompt; it cannot supply
153
+ accurate specifics from memory.
154
+ 5. **Ask for less text.** 2–3 short paragraphs per section works; "write a
155
+ detailed 2000-word report" does not.
156
+ 6. **Expect and clean up artefacts.** It adds list numbering to headings and
157
+ sometimes leaks markdown into prose fields. Strip these deterministically
158
+ during assembly rather than fighting them with prompt wording.
159
+
160
+ ## Limitations
161
+
162
+ * **Hallucination.** Without grounding, specifics (figures, dates, product
163
+ names) are unreliable and often invented. Tiny Agent mitigates this by injecting
164
+ retrieved web text and attaching a source list, but it does not eliminate it.
165
+ * **Inherited knowledge cutoff and biases.** Because this is a quantization, the
166
+ base model's training data, cutoff and biases apply unchanged.
167
+ * **Language.** The base model is multilingual, but the pipeline prompts and all
168
+ validation were done in English.
169
+ * **Repetition.** Sections written in separate calls sometimes restate the same
170
+ point. Human editing is expected.
171
+ * **Not a general chat model.** It is tuned here for structured slot-filling, not
172
+ for open-ended conversation.
173
+ * **Quantization degrades quality slightly** versus the full-precision base
174
+ model. 4-bit is the point where quality and speed balance best on this class
175
+ of hardware.
176
+
177
+ ## Training data
178
+
179
+ No training or fine-tuning was performed. This repository contains quantized
180
+ conversions of:
181
+
182
+ * [`Qwen/Qwen3-1.7B`](https://huggingface.co/Qwen/Qwen3-1.7B)
183
+ * [`Qwen/Qwen3-0.6B`](https://huggingface.co/Qwen/Qwen3-0.6B)
184
+
185
+ Refer to the base model cards for training data, evaluation results and
186
+ limitations.
187
+
188
+ Why these models: both are **Apache-2.0**, so they can be redistributed with a
189
+ commercial product without additional conditions. Llama, Gemma and several other
190
+ otherwise-capable small models are deliberately **not** bundled, because their
191
+ licences carry redistribution terms that are unsuitable for shipping to end
192
+ users.
193
+
194
+ ## License and attribution
195
+
196
+ Apache-2.0, inherited from the base models. Copyright in the base weights
197
+ belongs to the Qwen team; these are derivative quantizations redistributed under
198
+ the same licence.
199
 
200
  ## Related
201
 
202
+ * Project source, benchmarks and generated documents: [`hkblockchaintechnology/tiny-agent`](https://huggingface.co/datasets/hkblockchaintechnology/tiny-agent)