EryriLabs commited on
Commit
ea67aa4
Β·
verified Β·
1 Parent(s): cf0a736

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -51
README.md CHANGED
@@ -20,15 +20,10 @@ model-index:
20
  - name: dutybot-GGUF
21
  results: []
22
  ---
23
-
24
  # DutyBot GGUF
25
-
26
  **A domain-adapted language model for UK policing β€” offences, points to prove, PACE powers, and operational guidance.**
27
-
28
  Built for the [DutyBot](https://github.com/dwain-barnes/dutybot) Docker application. For training and educational purposes only.
29
-
30
  ## Model Details
31
-
32
  | | |
33
  |---|---|
34
  | **Base model** | [unsloth/gpt-oss-20b](https://huggingface.co/unsloth/gpt-oss-20b) |
@@ -40,26 +35,19 @@ Built for the [DutyBot](https://github.com/dwain-barnes/dutybot) Docker applicat
40
  | **Quantisation** | Q4_K_M |
41
  | **File size** | ~14.7 GB |
42
  | **Chat template** | ChatML (`<\|im_start\|>` / `<\|im_end\|>`) |
43
-
44
  ## How to Use
45
-
46
  ### With DutyBot (recommended)
47
-
48
  The easiest way to use this model is with the [DutyBot Docker app](https://github.com/dwain-barnes/dutybot) which provides a full chat UI, conversation history, memory, and automatic legislation verification:
49
-
50
  ```bash
51
  git clone https://github.com/dwain-barnes/dutybot.git
52
  cd dutybot
53
  docker compose up
54
  # Open http://localhost:5000
55
  ```
56
-
57
  ### With llama.cpp directly
58
-
59
  ```bash
60
  # Download
61
  huggingface-cli download EryriLabs/dutybot-GGUF domain_adapted-Q4_K_M.gguf --local-dir ./models
62
-
63
  # Run server
64
  llama-server \
65
  --model ./models/domain_adapted-Q4_K_M.gguf \
@@ -68,9 +56,7 @@ llama-server \
68
  --n-gpu-layers 999 \
69
  --chat-template chatml
70
  ```
71
-
72
  Then query the OpenAI-compatible API:
73
-
74
  ```bash
75
  curl http://localhost:8080/v1/chat/completions \
76
  -H "Content-Type: application/json" \
@@ -86,19 +72,15 @@ curl http://localhost:8080/v1/chat/completions \
86
  "frequency_penalty": 0.6
87
  }'
88
  ```
89
-
90
  ### With Python (llama-cpp-python)
91
-
92
  ```python
93
  from llama_cpp import Llama
94
-
95
  llm = Llama(
96
  model_path="./models/domain_adapted-Q4_K_M.gguf",
97
  n_ctx=4096,
98
  n_gpu_layers=-1,
99
  chat_format="chatml",
100
  )
101
-
102
  response = llm.create_chat_completion(
103
  messages=[
104
  {"role": "system", "content": "You are DutyBot, a UK Police Duty Assistant for training purposes."},
@@ -111,23 +93,16 @@ response = llm.create_chat_completion(
111
  )
112
  print(response["choices"][0]["message"]["content"])
113
  ```
114
-
115
  ## Training Details
116
-
117
  ### Corpus
118
-
119
  The training corpus covers UK criminal law across these domains:
120
-
121
  - **Criminal offences** β€” definitions, elements, and points to prove for offences under major UK statutes (Theft Act 1968, Offences Against the Person Act 1861, Criminal Damage Act 1971, Sexual Offences Act 2003, Misuse of Drugs Act 1971, and others)
122
  - **PACE** β€” Police and Criminal Evidence Act 1984 codes of practice (stop and search, arrest, detention, investigation, identification)
123
  - **Sentencing** β€” Sentencing Council guidelines and magistrates' court sentencing guidelines
124
  - **CPS guidance** β€” Crown Prosecution Service charging standards and legal guidance
125
  - **Operational policing** β€” powers, procedures, and general policing knowledge
126
-
127
  The corpus was structured as 10,511 text chunks, totalling approximately 10.7 million tokens.
128
-
129
  ### Method
130
-
131
  - **Continued pretraining (CPT)** β€” the model was exposed to the full corpus to inject domain knowledge, rather than instruction-tuning for a specific format
132
  - **QLoRA** β€” 4-bit quantised base weights with rank-64 LoRA adapters in bf16, reducing GPU memory requirements
133
  - **Hyperparameters:**
@@ -138,9 +113,7 @@ The corpus was structured as 10,511 text chunks, totalling approximately 10.7 mi
138
  - Total steps: 1,971
139
  - **Hardware:** 2x NVIDIA RTX 3090 (24GB each)
140
  - **Software:** [Unsloth](https://github.com/unslothai/unsloth) + HuggingFace Transformers + TRL
141
-
142
  ### Loss Curve
143
-
144
  | Step | Training Loss |
145
  |------|--------------|
146
  | 0 | 3.90 |
@@ -148,40 +121,28 @@ The corpus was structured as 10,511 text chunks, totalling approximately 10.7 mi
148
  | 500 | 1.80 |
149
  | 670 | 1.73 |
150
  | 1000 | ~1.65 |
151
-
152
  The loss showed healthy, monotonic decline indicating successful knowledge injection without catastrophic forgetting.
153
-
154
  ## Intended Use
155
-
156
  ### In scope
157
-
158
  - Police training exercises and scenario planning
159
  - Educational materials about UK criminal law
160
  - Studying offence definitions, points to prove, and powers
161
  - Building training tools for police forces and law enforcement academies
162
-
163
  ### Out of scope
164
-
165
  - **Live operational policing decisions** β€” this model is not a substitute for professional legal advice, force policy, or the judgement of trained officers
166
  - **Legal advice** β€” the model may produce inaccurate or incomplete legal information
167
  - **Jurisdictions outside England & Wales** β€” the training data is primarily based on English and Welsh law; Scottish and Northern Irish law differ significantly
168
-
169
  ## Limitations
170
-
171
  - **May fabricate legal definitions** β€” like all language models, DutyBot can generate plausible-sounding but incorrect legal information. Always verify against official sources.
172
  - **Training data currency** β€” the corpus reflects law as of the training date. Legislation changes frequently.
173
  - **Repetition** β€” the model can sometimes repeat itself, especially on longer generations. Using `frequency_penalty: 0.6` and `max_tokens: 512` helps mitigate this.
174
  - **No case law** β€” the training data focuses on statute law and guidance rather than case law precedents.
175
-
176
  ## System Prompt
177
-
178
  For best results, use this system prompt:
179
-
180
  ```
181
  You are DutyBot, a UK Police Duty Assistant. You help police officers with
182
  operational guidance, definitions of offences, points to prove, and general
183
  policing knowledge based on UK law.
184
-
185
  IMPORTANT CONSTRAINTS:
186
  - You are for TRAINING AND EDUCATIONAL PURPOSES ONLY β€” never for live operational use
187
  - Always encourage officers to verify guidance against local force policy and official sources
@@ -189,9 +150,7 @@ IMPORTANT CONSTRAINTS:
189
  - If unsure, say so clearly β€” never fabricate legal definitions
190
  - When legislation lookup results are provided, use them to ground your answer
191
  ```
192
-
193
  ## Recommended Inference Parameters
194
-
195
  | Parameter | Value | Notes |
196
  |-----------|-------|-------|
197
  | `temperature` | 0.3 | Low temperature for factual responses |
@@ -200,19 +159,14 @@ IMPORTANT CONSTRAINTS:
200
  | `presence_penalty` | 0.3 | Encourages topic diversity |
201
  | `stop` | `["<\|im_end\|>", "<\|im_start\|>"]` | Proper turn boundaries |
202
  | `ctx_size` | 4096 | Good balance of context and speed |
203
-
204
  ## Hardware Requirements
205
-
206
  | Setup | VRAM | Speed |
207
  |-------|------|-------|
208
  | 2x RTX 3090 (full offload) | ~16GB total | Fast |
209
  | 1x RTX 3090/4090 (partial offload) | 24GB | Moderate |
210
  | CPU only | 0 (uses RAM) | Slow (~1-2 tok/s) |
211
-
212
  Minimum 16GB system RAM recommended. The GGUF file itself is 14.7GB.
213
-
214
  ## Citation
215
-
216
  ```bibtex
217
  @misc{dutybot2026,
218
  title={DutyBot: A Domain-Adapted Language Model for UK Police Training},
@@ -221,17 +175,22 @@ Minimum 16GB system RAM recommended. The GGUF file itself is 14.7GB.
221
  url={https://huggingface.co/EryriLabs/dutybot-GGUF}
222
  }
223
  ```
 
224
 
225
- ## License
226
 
227
- **CC-BY-NC-ND-4.0** β€” Non-commercial use only. No derivatives without permission.
 
 
 
 
 
228
 
 
 
229
  The training corpus contains Crown copyright material used under the Open Government Licence.
230
-
231
  ## Acknowledgements
232
-
233
  - [GPT-OSS 20B](https://huggingface.co/unsloth/gpt-oss-20b) base model
234
  - [Unsloth](https://github.com/unslothai/unsloth) for efficient QLoRA training
235
  - [llama.cpp](https://github.com/ggml-org/llama.cpp) for GGUF inference
236
  - UK legislation sourced from [legislation.gov.uk](https://www.legislation.gov.uk/)
237
-
 
20
  - name: dutybot-GGUF
21
  results: []
22
  ---
 
23
  # DutyBot GGUF
 
24
  **A domain-adapted language model for UK policing β€” offences, points to prove, PACE powers, and operational guidance.**
 
25
  Built for the [DutyBot](https://github.com/dwain-barnes/dutybot) Docker application. For training and educational purposes only.
 
26
  ## Model Details
 
27
  | | |
28
  |---|---|
29
  | **Base model** | [unsloth/gpt-oss-20b](https://huggingface.co/unsloth/gpt-oss-20b) |
 
35
  | **Quantisation** | Q4_K_M |
36
  | **File size** | ~14.7 GB |
37
  | **Chat template** | ChatML (`<\|im_start\|>` / `<\|im_end\|>`) |
 
38
  ## How to Use
 
39
  ### With DutyBot (recommended)
 
40
  The easiest way to use this model is with the [DutyBot Docker app](https://github.com/dwain-barnes/dutybot) which provides a full chat UI, conversation history, memory, and automatic legislation verification:
 
41
  ```bash
42
  git clone https://github.com/dwain-barnes/dutybot.git
43
  cd dutybot
44
  docker compose up
45
  # Open http://localhost:5000
46
  ```
 
47
  ### With llama.cpp directly
 
48
  ```bash
49
  # Download
50
  huggingface-cli download EryriLabs/dutybot-GGUF domain_adapted-Q4_K_M.gguf --local-dir ./models
 
51
  # Run server
52
  llama-server \
53
  --model ./models/domain_adapted-Q4_K_M.gguf \
 
56
  --n-gpu-layers 999 \
57
  --chat-template chatml
58
  ```
 
59
  Then query the OpenAI-compatible API:
 
60
  ```bash
61
  curl http://localhost:8080/v1/chat/completions \
62
  -H "Content-Type: application/json" \
 
72
  "frequency_penalty": 0.6
73
  }'
74
  ```
 
75
  ### With Python (llama-cpp-python)
 
76
  ```python
77
  from llama_cpp import Llama
 
78
  llm = Llama(
79
  model_path="./models/domain_adapted-Q4_K_M.gguf",
80
  n_ctx=4096,
81
  n_gpu_layers=-1,
82
  chat_format="chatml",
83
  )
 
84
  response = llm.create_chat_completion(
85
  messages=[
86
  {"role": "system", "content": "You are DutyBot, a UK Police Duty Assistant for training purposes."},
 
93
  )
94
  print(response["choices"][0]["message"]["content"])
95
  ```
 
96
  ## Training Details
 
97
  ### Corpus
 
98
  The training corpus covers UK criminal law across these domains:
 
99
  - **Criminal offences** β€” definitions, elements, and points to prove for offences under major UK statutes (Theft Act 1968, Offences Against the Person Act 1861, Criminal Damage Act 1971, Sexual Offences Act 2003, Misuse of Drugs Act 1971, and others)
100
  - **PACE** β€” Police and Criminal Evidence Act 1984 codes of practice (stop and search, arrest, detention, investigation, identification)
101
  - **Sentencing** β€” Sentencing Council guidelines and magistrates' court sentencing guidelines
102
  - **CPS guidance** β€” Crown Prosecution Service charging standards and legal guidance
103
  - **Operational policing** β€” powers, procedures, and general policing knowledge
 
104
  The corpus was structured as 10,511 text chunks, totalling approximately 10.7 million tokens.
 
105
  ### Method
 
106
  - **Continued pretraining (CPT)** β€” the model was exposed to the full corpus to inject domain knowledge, rather than instruction-tuning for a specific format
107
  - **QLoRA** β€” 4-bit quantised base weights with rank-64 LoRA adapters in bf16, reducing GPU memory requirements
108
  - **Hyperparameters:**
 
113
  - Total steps: 1,971
114
  - **Hardware:** 2x NVIDIA RTX 3090 (24GB each)
115
  - **Software:** [Unsloth](https://github.com/unslothai/unsloth) + HuggingFace Transformers + TRL
 
116
  ### Loss Curve
 
117
  | Step | Training Loss |
118
  |------|--------------|
119
  | 0 | 3.90 |
 
121
  | 500 | 1.80 |
122
  | 670 | 1.73 |
123
  | 1000 | ~1.65 |
 
124
  The loss showed healthy, monotonic decline indicating successful knowledge injection without catastrophic forgetting.
 
125
  ## Intended Use
 
126
  ### In scope
 
127
  - Police training exercises and scenario planning
128
  - Educational materials about UK criminal law
129
  - Studying offence definitions, points to prove, and powers
130
  - Building training tools for police forces and law enforcement academies
 
131
  ### Out of scope
 
132
  - **Live operational policing decisions** β€” this model is not a substitute for professional legal advice, force policy, or the judgement of trained officers
133
  - **Legal advice** β€” the model may produce inaccurate or incomplete legal information
134
  - **Jurisdictions outside England & Wales** β€” the training data is primarily based on English and Welsh law; Scottish and Northern Irish law differ significantly
 
135
  ## Limitations
 
136
  - **May fabricate legal definitions** β€” like all language models, DutyBot can generate plausible-sounding but incorrect legal information. Always verify against official sources.
137
  - **Training data currency** β€” the corpus reflects law as of the training date. Legislation changes frequently.
138
  - **Repetition** β€” the model can sometimes repeat itself, especially on longer generations. Using `frequency_penalty: 0.6` and `max_tokens: 512` helps mitigate this.
139
  - **No case law** β€” the training data focuses on statute law and guidance rather than case law precedents.
 
140
  ## System Prompt
 
141
  For best results, use this system prompt:
 
142
  ```
143
  You are DutyBot, a UK Police Duty Assistant. You help police officers with
144
  operational guidance, definitions of offences, points to prove, and general
145
  policing knowledge based on UK law.
 
146
  IMPORTANT CONSTRAINTS:
147
  - You are for TRAINING AND EDUCATIONAL PURPOSES ONLY β€” never for live operational use
148
  - Always encourage officers to verify guidance against local force policy and official sources
 
150
  - If unsure, say so clearly β€” never fabricate legal definitions
151
  - When legislation lookup results are provided, use them to ground your answer
152
  ```
 
153
  ## Recommended Inference Parameters
 
154
  | Parameter | Value | Notes |
155
  |-----------|-------|-------|
156
  | `temperature` | 0.3 | Low temperature for factual responses |
 
159
  | `presence_penalty` | 0.3 | Encourages topic diversity |
160
  | `stop` | `["<\|im_end\|>", "<\|im_start\|>"]` | Proper turn boundaries |
161
  | `ctx_size` | 4096 | Good balance of context and speed |
 
162
  ## Hardware Requirements
 
163
  | Setup | VRAM | Speed |
164
  |-------|------|-------|
165
  | 2x RTX 3090 (full offload) | ~16GB total | Fast |
166
  | 1x RTX 3090/4090 (partial offload) | 24GB | Moderate |
167
  | CPU only | 0 (uses RAM) | Slow (~1-2 tok/s) |
 
168
  Minimum 16GB system RAM recommended. The GGUF file itself is 14.7GB.
 
169
  ## Citation
 
170
  ```bibtex
171
  @misc{dutybot2026,
172
  title={DutyBot: A Domain-Adapted Language Model for UK Police Training},
 
175
  url={https://huggingface.co/EryriLabs/dutybot-GGUF}
176
  }
177
  ```
178
+ ## Disclaimer
179
 
180
+ This model and associated software are provided strictly for **research and educational purposes only**. They are **not intended for production use, operational deployment, or commercial purposes**.
181
 
182
+ - **No warranty**: This model is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, or non-infringement.
183
+ - **No liability**: The author(s) accept no responsibility or liability for any errors, omissions, or outcomes arising from the use of this model or its outputs.
184
+ - **Not legal advice**: Nothing produced by this model constitutes legal, professional, or operational advice. Outputs may be inaccurate, incomplete, or outdated. Always consult qualified professionals and official sources.
185
+ - **Not for operational policing**: This model must not be used for live operational decision-making. It is not a substitute for professional judgement, force policy, or official legal guidance.
186
+ - **Non-commercial use only**: The model weights are licensed under CC-BY-NC-ND-4.0 and must not be used for commercial purposes.
187
+ - **Use at your own risk**: You are solely responsible for how you use this model and any decisions made based on its output.
188
 
189
+ ## License
190
+ **CC-BY-NC-ND-4.0** β€” Non-commercial use only. No derivatives without permission.
191
  The training corpus contains Crown copyright material used under the Open Government Licence.
 
192
  ## Acknowledgements
 
193
  - [GPT-OSS 20B](https://huggingface.co/unsloth/gpt-oss-20b) base model
194
  - [Unsloth](https://github.com/unslothai/unsloth) for efficient QLoRA training
195
  - [llama.cpp](https://github.com/ggml-org/llama.cpp) for GGUF inference
196
  - UK legislation sourced from [legislation.gov.uk](https://www.legislation.gov.uk/)