File size: 21,396 Bytes
4cff36c
cee9674
 
 
 
a8ec721
 
477dd13
a8ec721
 
4cff36c
cee9674
477dd13
cee9674
477dd13
 
 
 
cee9674
a8ec721
cee9674
477dd13
a8ec721
477dd13
a8ec721
 
f319e82
a8ec721
 
 
477dd13
 
f319e82
477dd13
523673b
f319e82
523673b
477dd13
a8ec721
 
 
 
477dd13
523673b
f319e82
523673b
f319e82
4cff36c
 
523673b
4cff36c
523673b
4cff36c
523673b
4cff36c
523673b
4cff36c
523673b
4cff36c
523673b
4cff36c
523673b
654b762
523673b
654b762
523673b
 
 
 
 
654b762
523673b
a8ec721
523673b
654b762
523673b
 
 
 
 
 
 
 
cee9674
523673b
f319e82
523673b
cee9674
 
a8ec721
 
cee9674
 
a8ec721
cee9674
523673b
 
 
f319e82
cee9674
523673b
f319e82
a8ec721
 
cee9674
 
523673b
cee9674
a8ec721
 
 
 
 
 
 
 
 
 
 
523673b
a8ec721
 
 
 
 
477dd13
cee9674
523673b
cee9674
523673b
f319e82
523673b
 
 
 
cee9674
523673b
fe74fb5
523673b
fe74fb5
523673b
fe74fb5
523673b
fe74fb5
523673b
f319e82
523673b
 
 
fe74fb5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523673b
 
 
fe74fb5
 
 
 
 
 
 
 
 
 
 
523673b
fe74fb5
 
 
 
523673b
fe74fb5
 
 
 
 
 
 
 
523673b
f319e82
523673b
 
 
fe74fb5
523673b
fe74fb5
523673b
f319e82
523673b
 
 
 
 
fe74fb5
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
f319e82
523673b
 
 
 
 
cee9674
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
cee9674
523673b
a8ec721
523673b
a8ec721
523673b
 
 
 
 
 
a8ec721
523673b
a8ec721
523673b
f319e82
523673b
 
cee9674
523673b
f319e82
523673b
f319e82
523673b
f319e82
523673b
f319e82
523673b
f319e82
523673b
cee9674
477dd13
a8ec721
f319e82
a8ec721
 
 
 
 
477dd13
 
cee9674
523673b
477dd13
523673b
477dd13
523673b
cee9674
523673b
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
---
language:
  - he
  - en
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
base_model: unsloth/gemma-4-E2B-it
datasets:
  - BrainboxAI/legal-training-il
tags:
  - legal
  - law
  - israel
  - hebrew
  - court-rulings
  - kol-zchut
  - gguf
  - llama.cpp
  - ollama
  - unsloth
  - gemma4
  - qlora
  - conversational
  - text-generation
  - on-device
pretty_name: bx-legal-kochav (law-il-E2B)
model-index:
  - name: law-il-E2B
    results: []
---

# bx-legal-kochav

### Repository id: `BrainboxAI/law-il-E2B`

**A small Hebrew-first model for Israeli law that runs entirely on your own machine. No question ever leaves it.**

[![HF Model](https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Model-yellow)](https://huggingface.co/BrainboxAI/law-il-E2B)
[![Dataset](https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Dataset-blue)](https://huggingface.co/datasets/BrainboxAI/legal-training-il)
[![Safetensors](https://img.shields.io/badge/Format-Safetensors-green)](https://huggingface.co/BrainboxAI/law-il-E2B-safetensors)
[![License](https://img.shields.io/badge/License-Apache_2.0-lightgrey)](https://www.apache.org/licenses/LICENSE-2.0)

> **About the name.** `bx-legal-kochav` is this model's name under the BrainboxAI naming convention: `bx` for the lab, `legal` for the domain, and `kochav` (Hebrew for "star") for the smallest size tier. **The repository id stays `BrainboxAI/law-il-E2B` and will not change.** Every link, script and pull command you already have keeps working exactly as before.

> **About version stability.** Retraining on the same task is pushed to the same repository and updates the weights in place. Someone who downloads today and again in two months may get different weights under the same name. If you need absolute stability, pin yourself to a specific commit rather than to the main branch.

---

## What it is

A **small** language model trained on Israeli legal material. It answers legal questions in Hebrew in a fixed shape: which statute applies, what it says in plain language, a real-world example, case law if there is any, and a closing caveat.

It is built on Google's [`unsloth/gemma-4-E2B-it`](https://huggingface.co/unsloth/gemma-4-E2B-it) and fine-tuned on top of it with QLoRA on 17,613 curated legal examples.

**What "small" means here.** The whole thing fits in one file of about 3.4 GB. It runs on an ordinary laptop or a consumer GPU. It is not in the same league as GPT or Claude and it is not trying to be. It does one job, in one place: yours.

## Why it exists

Most Hebrew legal work today flows through cloud models. For a law firm that is a real problem. Client material leaves the office, attorney-client privilege is exposed, and Amendment 13 to Israel's Protection of Privacy Law attached penalties to getting it wrong.

A model that runs on the machine itself removes the problem at the root. The weights sit on the user's own hardware. Nothing is transmitted and nothing is logged anywhere else.

## What it is for

- Legal questions from ordinary citizens: employment, tenancy, family, consumer rights.
- A first research pass for a trainee or a junior associate, before the real check rather than instead of it.
- Reading and comparing contract clauses.
- Explaining rights pages (Kol-Zchut) for social-sector organisations.
- Deployment inside a firm that holds privileged material and cannot send it out.

## What it is not, and what you must not do with it

This is the important part of the card. A small model presented as capable of everything is worthless. A model that says what it cannot do can be relied on.

- **It is not a lawyer, and its answers must not be used as legal advice.** Every answer needs a person to read it and check it before anyone acts on it.
- **It fabricates section numbers and case citations.** This is not a rare glitch. It is known behaviour in every language model, and it is more frequent at this size. **Verify every citation** against an authoritative source (Nevo, Psakdin, Takdin). The system prompt below reduces this. It does not eliminate it.
- **It knows Israeli law only.** Not US, not EU, not UK, and no international or comparative law.
- **It has a knowledge cutoff.** The material was collected in early 2026. A law that changed after that is unknown to it, and it does not know that it does not know.
- **It does not check anything against a live database.** It has no internet access and no connection to case-law repositories. It answers from memory alone.
- **It is weak on criminal and administrative law.** Most of the training material is civil, employment and family law. For complex criminal matters, do not use it at all.
- **It is not for live courtroom use**, or for any situation where a wrong answer costs something and nobody reads the answer first.
- **It has no score.** See the Evaluation section. There is no measured evidence that it is better than its base model at anything.

## How to run it

### Ollama

```bash
ollama pull hf.co/BrainboxAI/law-il-E2B:Q4_K_M
ollama run hf.co/BrainboxAI/law-il-E2B:Q4_K_M
```

### llama.cpp

The file inside the repository is named `gemma-4-E2B-it.Q4_K_M.gguf`. The name is left over from the build step. It is the **fine-tuned** model, not the base model.

The prompt below is in Hebrew because that is the language this model works in. The English gloss is for readers who do not read Hebrew.

```bash
# Prompt: "What is an employee entitled to when dismissed without notice?"
./llama-cli -m gemma-4-E2B-it.Q4_K_M.gguf \
  -p "ืžื”ืŸ ื–ื›ื•ื™ื•ืช ื”ืขื•ื‘ื“ ื‘ืคื™ื˜ื•ืจื™ื ืœืœื ื”ื•ื“ืขื” ืžื•ืงื“ืžืช?" \
  --temp 0.3 --top-p 0.9 -n 512
```

### Python, through the safetensors repository

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("BrainboxAI/law-il-E2B-safetensors")
model = AutoModelForCausalLM.from_pretrained(
    "BrainboxAI/law-il-E2B-safetensors",
    torch_dtype="auto",
    device_map="auto",
)

messages = [
    # "I was fired without notice. What am I entitled to?"
    {"role": "user", "content": "ืคื™ื˜ืจื• ืื•ืชื™ ื‘ืœื™ ื”ื•ื“ืขื” ืžื•ืงื“ืžืช. ืžื” ืžื’ื™ืข ืœื™?"},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.3, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

### Recommended generation parameters

| Parameter | Value | Why |
|---|---|---|
| `temperature` | 0.3 | Low creativity. Legal work wants facts, not original phrasing |
| `top_p` | 0.9 | Standard nucleus sampling |
| `max_new_tokens` | 512 | Enough for a full five-step answer with citations |
| `repetition_penalty` | 1.05 | Stops the model looping on a citation |

> **A mismatch worth knowing about.** The `Modelfile` sitting in this repository sets `temperature 0.7` and `repeat_penalty 1.3`, which are not the values in the table. The table is the recommendation. If you run through the `Modelfile`, change them yourself.

## The recommended system prompt, which matters more than anything else here

A model this size performs **much** better when it is given a structured reasoning template instead of an open question. The prompt below forces it through five explicit steps before it answers, and at each step tells it what is allowed and what is not.

**Why this matters.** A small model handed an open legal question tends to invent: a section number that sounds right, a case name that does not exist. A structured template makes it write "check the exact section in Nevo" instead of guessing a number, and makes a caveat mandatory at the end of every answer.

**And this is an impression, not a measurement.** No numerical comparison was run between the model with this prompt and without it.

**The prompt itself is written in Hebrew.** That is deliberate: the model answers in Hebrew, and instructions in the answer's own language hold better at this size. Copy it as it is. The section headings (`DEFINITIONS`, `PREMISES`, `REQUIREMENTS`, `EDGE_CASES`, `OUTPUT_FORMAT`, `VERIFICATION`) are in English and mark, in order: the vocabulary, the assumptions, the hard rules, the awkward cases, the shape of the answer, and the self-check.

### The system prompt (copy as-is)

```text
DEFINITIONS:
  ื”ืฆืœื—ื”: ืชืฉื•ื‘ื” ืžืฉืคื˜ื™ืช ืžื•ื‘ื ื™ืช ื‘ื›ืœ 5 ืฆืขื“ื™ ื”ื—ืฉื™ื‘ื”, ืœืœื ื”ืžืฆืืช ื—ื•ืงื™ื, ื‘ืฉืคื” ื‘ืจื•ืจื” ืœืื–ืจื— ืœื-ืžืฉืคื˜ืŸ, ืขื ืกื™ื™ื’ ืžืคื•ืจืฉ ืฉื–ื” ืื™ื ื• ื™ื™ืขื•ืฅ ืžืฉืคื˜ื™.
  scope: in-scope - ืฉืืœื•ืช ืขืœ ื“ื™ื ื™ ืขื‘ื•ื“ื”, ื ื“ืœ"ืŸ, ื—ื•ื–ื™ื, ื ื–ื™ืงื™ืŸ, ืžืฉืคื—ื”, ืฆืจื›ื ื•ืช, ืžืกื—ืจ, ื•ื–ื›ื•ื™ื•ืช ื‘ืกื™ืกื™ื•ืช ื‘ื™ืฉืจืืœ. out-of-scope - ื™ื™ืขื•ืฅ ืžืฉืคื˜ื™ ืžื—ื™ื™ื‘, ื™ื™ืฆื•ื’ ื‘ื‘ื™ืช ืžืฉืคื˜, ืฉืืœื•ืช ืคืœื™ืœื™ื•ืช ืžื•ืจื›ื‘ื•ืช, ืžืงืจื™ื ืกืคืฆื™ืคื™ื™ื ืฉื“ื•ืจืฉื™ื ื‘ื“ื™ืงืช ืžืกืžื›ื™ื.
  ืกืขื™ืฃ ื—ื•ืงื™ ืจืœื•ื•ื ื˜ื™: ืฆื™ื˜ื•ื˜ ืžื“ื•ื™ืง ืฉืœ ืžืกืคืจ ื—ื•ืง, ืคืจืง ื•ืกืขื™ืฃ ืกืคืฆื™ืคื™. ืื ืœื ื™ื“ื•ืข ื‘ืžื“ื•ื™ืง - ืืกื•ืจ ืœืฆื™ื™ืŸ ืžืกืคืจ.
  ืคืกื™ืงื” ืจืœื•ื•ื ื˜ื™ืช: ื”ืคื ื™ื” ืœืคืกืง ื“ื™ืŸ ืžื•ื›ืจ. ืื ืœื ื™ื“ื•ืข ื‘ืžื“ื•ื™ืง - ืœื›ืชื•ื‘ "ืคืกื™ืงื” ืจืœื•ื•ื ื˜ื™ืช ืงื™ื™ืžืช ื‘ื ื•ืฉื, ืžื•ืžืœืฅ ืœื‘ื“ื•ืง ื‘ืžืื’ืจ ื ื‘ื•".

PREMISES:
  - ื”ืžืฉืชืžืฉ ืฉื•ืืœ ืฉืืœื” ืžืฉืคื˜ื™ืช ื‘ืขื‘ืจื™ืช, ื‘ื“ืจืš ื›ืœืœ ื‘ื ื•ื’ืข ืœืžืฆื‘ ื—ื™ื™ื• ื”ืื™ืฉื™.
  - ื”ืžื•ื“ืœ ืื•ืžืŸ ืขืœ 17,613 ืžืกืžื›ื™ื: 7,960 ืคืกืงื™ ื“ื™ืŸ ื™ืฉืจืืœื™ื™ื, 2,353 ื“ืคื™ ื›ืœ-ื–ื›ื•ืช, 300 ื—ื•ืงื™ื, 7,000 ืกืขื™ืคื™ ื—ื•ื–ื™ื.
  - ื”ืžื•ื“ืœ ื‘ื’ื•ื“ืœ 2B ืคืจืžื˜ืจื™ื, ื ื•ื˜ื” ืœื”ื–ื™ื•ืช ืื ืœื ืžื•ื’ื‘ืœ ื‘ืžื‘ื ื” ืชืฉื•ื‘ื”.
  - ื”ืงื”ืœ: ืขื•ืจื›ื™ ื“ื™ืŸ ืžืชื—ื™ืœื™ื, ื™ื–ืžื™ื, ืื–ืจื—ื™ื. ืจื•ื‘ื ืœื ื™ื•ื“ืขื™ื ืœื‘ื“ื•ืง ื”ืื ืชืฉื•ื‘ื” ืžืฉืคื˜ื™ืช ื ื›ื•ื ื”.
  - ื—ื•ืกืจ ื™ื“ืข ืžืกื•ื›ืŸ ื™ื•ืชืจ ืž"ืื ื™ ืœื ื™ื•ื“ืข".

REQUIREMENTS:
  1. ื›ืœ ืชืฉื•ื‘ื” ื—ื™ื™ื‘ืช ืœื”ื›ื™ืœ ื‘ื“ื™ื•ืง 5 ืฆืขื“ื™ื, ื‘ืกื“ืจ ื”ื–ื”: ืกืขื™ืฃ ื—ื•ืงื™, ื”ืกื‘ืจ ืคืฉื•ื˜, ื“ื•ื’ืžื”, ืคืกื™ืงื”, ืกื™ื™ื’.
  2. ืื ืœื ื™ื“ื•ืข ืกืขื™ืฃ ืกืคืฆื™ืคื™ ื‘ืžืืช ื”ืื—ื•ื–ื™ื - ื—ื•ื‘ื” ืœื›ืชื•ื‘ "ื”ื—ื•ืง ื”ืจืœื•ื•ื ื˜ื™ ื”ื•ื [ืฉื ื”ื—ื•ืง] - ืœื‘ื“ื•ืง ืืช ื”ืกืขื™ืฃ ื”ืžื“ื•ื™ืง ื‘ืžืื’ืจ ื ื‘ื•". ืืกื•ืจ ืœื ื—ืฉ ืžืกืคืจ ืกืขื™ืฃ.
  3. ื”ื”ืกื‘ืจ ื”ืคืฉื•ื˜ ื—ื™ื™ื‘ ืœื”ื™ื•ืช ื‘ืฉืคื” ื™ื•ืžื™ื•ืžื™ืช, ืœืœื ื–'ืจื’ื•ืŸ ืžืฉืคื˜ื™. ืื ืžืฉืชืžืฉื™ื ื‘ืžื•ื ื— ืžืฉืคื˜ื™ - ื—ื™ื™ื‘ ืœื”ื•ืคื™ืข ื”ืกื‘ืจ ื‘ืกื•ื’ืจื™ื™ื.
  4. ื”ื“ื•ื’ืžื” ื”ืžืขืฉื™ืช ื—ื™ื™ื‘ืช ืœื”ื™ื•ืช ืกื™ื˜ื•ืืฆื™ื” ืจื™ืืœื™ืกื˜ื™ืช ื‘ื™ืฉืจืืœ, ืœื ื”ื™ืคื•ืชื˜ื™ืช.
  5. ื”ืกื™ื™ื’ ื‘ืกื•ืฃ ื—ื™ื™ื‘ ืœื”ื•ืคื™ืข ื‘ื›ืœ ืชืฉื•ื‘ื” ืœืœื ื™ื•ืฆื ืžืŸ ื”ื›ืœืœ, ื’ื ืื ื”ืฉืืœื” ืคืฉื•ื˜ื”.
  6. ืืกื•ืจ ืœืชืช ื”ืžืœืฆื” ืกืคืฆื™ืคื™ืช "ืžื” ืœืขืฉื•ืช" - ืจืง ืœื”ืกื‘ื™ืจ ืžื” ื”ื—ื•ืง ืื•ืžืจ ื•ืžื” ื”ืืคืฉืจื•ื™ื•ืช.
  7. ืืกื•ืจ ืœื”ืžืฆื™ื ืคืกืงื™ ื“ื™ืŸ. ืื ืœื ื™ื“ื•ืขื” ืคืกื™ืงื” ืกืคืฆื™ืคื™ืช - ืœื›ืชื•ื‘ "ืคืกื™ืงื” ืจืœื•ื•ื ื˜ื™ืช ืงื™ื™ืžืช ื‘ื ื•ืฉื, ืžื•ืžืœืฅ ืœื‘ื“ื•ืง ื‘ืžืื’ืจ ื ื‘ื•".
  8. ืืกื•ืจ ืœืกืคืง ืžืกืคืจื™ื (ืกื›ื•ืžื™ ืคื™ืฆื•ื™, ื™ืžื™ ื—ื•ืคืฉ, ืื—ื•ื–ื™ ืžืก) ื‘ืœื™ ืœืฆื™ื™ืŸ ืฉื”ื ื ื›ื•ื ื™ื ื ื›ื•ืŸ ืœืชืืจื™ืš ืžืกื•ื™ื ื•ื™ื›ื•ืœื™ื ืœื”ืฉืชื ื•ืช.
  9. ืื ื”ืฉืืœื” ืื™ื ื” ืžืฉืคื˜ื™ืช - ืœื”ื—ื–ื™ืจ "ืื ื™ ืžื•ื“ืœ ืžืฉืคื˜ื™, ื”ืฉืืœื” ื”ื–ื• ืื™ื ื” ื‘ืชื—ื•ืžื™. ืื ื ืคื ื” ืœืžื•ืžื—ื” ืจืœื•ื•ื ื˜ื™."
  10. ืืกื•ืจ ืœื”ืฉืชืžืฉ ื‘ืžื™ื“ืข ืžื—ื•ืฅ ืœ-training data. ืื ื”ืฉืืœื” ื“ื•ืจืฉืช ื—ื•ืง ืฉื ื—ืงืง ืื—ืจื™ 2026 - ืœืฆื™ื™ืŸ ื–ืืช ื‘ืžืคื•ืจืฉ.

EDGE_CASES:
  - ืฉืืœื” ืคืœื™ืœื™ืช ืžื•ืจื›ื‘ืช -> "ืžืงืจื™ื ืคืœื™ืœื™ื™ื ื“ื•ืจืฉื™ื ื™ื™ืขื•ืฅ ืžืฉืคื˜ื™ ืžืกื•ื ื›ืŸ ืขื ืขื•ืจืš ื“ื™ืŸ ืคืœื™ืœื™. ืื ื™ ื™ื›ื•ืœ ืœื”ืกื‘ื™ืจ ืืช ื”ืขืงืจื•ื ื•ืช ื”ื›ืœืœื™ื™ื ืื ืชืจืฆื”."
  - ืฉืืœื” ืขืœ ืžืงืจื” ืกืคืฆื™ืคื™ ืขื ืคืจื˜ื™ื ืื™ืฉื™ื™ื -> "ืื ื™ ื™ื›ื•ืœ ืœื”ืกื‘ื™ืจ ืืช ื”ื—ื•ืง ื‘ืื•ืคืŸ ื›ืœืœื™, ืืš ื”ืชืืžื” ืœืžืงืจื” ืฉืœืš ื“ื•ืจืฉืช ืคื’ื™ืฉื” ืขื ืขื•ืจืš ื“ื™ืŸ ืฉื™ื‘ื—ืŸ ืืช ื›ืœ ื”ืžืกืžื›ื™ื."
  - ืฉืืœื” ืœื ื‘ืจื•ืจื” -> "ื›ื“ื™ ืœืชืช ืœืš ืชืฉื•ื‘ื” ืžื“ื•ื™ืงืช, ืื ื™ ืฆืจื™ืš ืœื“ืขืช [ืฉืืœื” ืกืคืฆื™ืคื™ืช]. ืชื•ื›ืœ ืœืคืจื˜?"
  - ืฉืืœื” ื‘ืฉืคื” ืื—ืจืช -> ืœืขื ื•ืช ื‘ืขื‘ืจื™ืช: "ืื ื™ ืžื•ื“ืœ ื‘ืขื‘ืจื™ืช. ืื ื ืฉืืœ ืืช ืฉืืœืชืš ื‘ืขื‘ืจื™ืช."
  - ื‘ืงืฉื” ืœื—ื•ื•ืช ื“ืขืช ืื™ืฉื™ืช -> "ืื ื™ ืžืกืคืง ืžื™ื“ืข ืžืฉืคื˜ื™, ืœื ื—ื•ื•ืช ื“ืขืช ืื™ืฉื™ืช. ื”ื—ื•ืง ืื•ืžืจ X."
  - ืฉืืœื” ืขืœ ื“ื™ื ื™ ื—ื•ืฅ (ืœื ื™ืฉืจืืœ) -> "ืื ื™ ืžืชืžื—ื” ื‘ืžืฉืคื˜ ื™ืฉืจืืœื™. ืœืฉืืœื•ืช ืขืœ ื“ื™ืŸ ื‘ืžื“ื™ื ื” ืื—ืจืช ืžื•ืžืœืฅ ืœืคื ื•ืช ืœืžื•ืžื—ื” ืžืงื•ืžื™."
  - ื—ื•ืง ืฉื”ืฉืชื ื” ืœืื—ืจื•ื ื” -> "ื”ื—ื•ืง ืขื•ื“ื›ืŸ ืœืื—ืจื•ื ื” ื‘[ืชืืจื™ืš ืื ื™ื“ื•ืข]. ืžื•ืžืœืฅ ืœื•ื•ื“ื ื‘ืžืงื•ืจ ื”ืจืฉืžื™."

OUTPUT_FORMAT:
  format: ื˜ืงืกื˜ ืžื•ื‘ื ื” ืขื ื›ื•ืชืจื•ืช ืžืžื•ืกืคืจื•ืช
  structure: |
    1. ื”ืกืขื™ืฃ ื”ื—ื•ืงื™ ื”ืจืœื•ื•ื ื˜ื™:
    [ืฉื ื”ื—ื•ืง ื”ืžืœื + ืคืจืง + ืกืขื™ืฃ ืื ื™ื“ื•ืข ื‘ืžื“ื•ื™ืง. ืื—ืจืช ืจืง ืฉื ื”ื—ื•ืง ืขื ื”ืคื ื™ื” ืœื‘ื“ื•ืง ื‘ืžืื’ืจ ื ื‘ื•]

    2. ื”ืกื‘ืจ ืคืฉื•ื˜:
    [ืคืกืงื” ืื—ืช ื‘ืขื‘ืจื™ืช ื™ื•ืžื™ื•ืžื™ืช, ืžืกื‘ื™ืจื” ืืช ื”ืขื™ืงืจื•ืŸ ื‘ืœื™ ื–'ืจื’ื•ืŸ]

    3. ื“ื•ื’ืžื” ืžืขืฉื™ืช:
    [ืกื™ื˜ื•ืืฆื™ื” ืจื™ืืœื™ืกื˜ื™ืช ืžื™ื•ื-ื™ื•ื ื‘ื™ืฉืจืืœ, 2-3 ืžืฉืคื˜ื™ื]

    4. ืคืกื™ืงื” ืจืœื•ื•ื ื˜ื™ืช:
    [ืฉื ืคืกืง ื“ื™ืŸ + ืฉื ื” ืื ื™ื“ื•ืข. ืื—ืจืช: "ืคืกื™ืงื” ืจืœื•ื•ื ื˜ื™ืช ืงื™ื™ืžืช ื‘ื ื•ืฉื, ืžื•ืžืœืฅ ืœื‘ื“ื•ืง ื‘ืžืื’ืจ ื ื‘ื•."]

    5. ืฉื™ื ืœื‘:
    "ื”ืžื™ื“ืข ื”ื–ื” ื”ื•ื ื”ืกื‘ืจ ื›ืœืœื™ ื‘ืœื‘ื“ ื•ืื™ื ื• ืžื”ื•ื•ื” ื™ื™ืขื•ืฅ ืžืฉืคื˜ื™. ื›ืœ ืžืงืจื” ื”ื•ื ื™ื™ื—ื•ื“ื™ ื•ื“ื•ืจืฉ ื‘ื—ื™ื ื” ืคืจื˜ื ื™ืช. ืœืคื ื™ ืงื‘ืœืช ื”ื—ืœื˜ื” ืžืฉืคื˜ื™ืช, ืคื ื” ืœืขื•ืจืš ื“ื™ืŸ ืžื•ืกืžืš."
  language: ืขื‘ืจื™ืช
  length: 200-400 ืžื™ืœื™ื ื‘ืกืš ื”ื›ืœ

VERIFICATION:
  - ื”ืื ื›ืœ 5 ื”ืฆืขื“ื™ื ืงื™ื™ืžื™ื ื‘ืชืฉื•ื‘ื”? (ื›ืŸ/ืœื)
  - ื”ืื ืฆื•ื™ืŸ ืžืกืคืจ ืกืขื™ืฃ ืกืคืฆื™ืคื™? ืื ื›ืŸ - ื”ืื ื”ื•ื ืงื™ื™ื ื‘ื—ื•ืง ื”ืืžื™ืชื™? (ืœื ืœื”ืžืฆื™ื)
  - ื”ืื ื”ื•ื–ื›ืจ ืคืกืง ื“ื™ืŸ? ืื ื›ืŸ - ื”ืื ื”ื•ื ืืžื™ืชื™?
  - ื”ืื ื”ืกื™ื™ื’ ื‘ืกื•ืฃ ืžื•ืคื™ืข ื‘ืžืœื•ืื•?
  - ื”ืื ื ืžื ืขื” ื”ืžืœืฆื” ืื™ืฉื™ืช "ืžื” ืœืขืฉื•ืช"?
  - regression check: ืœื ืœื”ื—ื–ื™ืจ ืชืฉื•ื‘ื” ืœืœื 5 ื”ืฆืขื“ื™ื ื’ื ืื ื”ืฉืืœื” ืคืฉื•ื˜ื”.
```

**What the five steps are, in English:** (1) the applicable statute, (2) a plain-language explanation, (3) a realistic Israeli example, (4) relevant case law, and (5) a mandatory caveat saying this is not legal advice. Rule 2 forbids guessing a section number. Rule 7 forbids inventing a ruling. Rule 6 forbids telling the reader what to do, as opposed to what the law says.

### Usage example with the system prompt

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("BrainboxAI/law-il-E2B-safetensors")
model = AutoModelForCausalLM.from_pretrained(
    "BrainboxAI/law-il-E2B-safetensors",
    torch_dtype="auto",
    device_map="auto",
)

# Paste the full prompt from the code block above.
SYSTEM_PROMPT = """[paste the full prompt from the code block above]"""

messages = [
    {"role": "system", "content": SYSTEM_PROMPT},
    # "How many vacation days is an employee working a 4-day week entitled to?"
    {"role": "user", "content": "ื›ืžื” ื™ืžื™ ื—ื•ืคืฉื” ืžื’ื™ืขื™ื ืœืขื•ื‘ื“ ืฉืžื•ืขืกืง 4 ื™ืžื™ื ื‘ืฉื‘ื•ืข?"},
]

inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=600, temperature=0.3, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

### Customisation

- Want answers in English or Arabic? Change rule 9.
- Need JSON for an application? Replace the `OUTPUT_FORMAT` section with your schema.
- Building for lawyers rather than citizens? Drop rule 6, which forbids tactical recommendations.

## Training details

| Attribute | Value |
|---|---|
| **Base model** | [`unsloth/gemma-4-E2B-it`](https://huggingface.co/unsloth/gemma-4-E2B-it) |
| **Method** | QLoRA. The base model is loaded in 4 bits during training |
| **Framework** | Unsloth |
| **Training rows** | 17,613 |
| **Hyperparameters, hardware, wall time and cost** | Not stated here. See the note below |

> **Why numbers are missing.** The training records for this model survived in two versions that contradict each other. They disagree on the LoRA rank, on the number of epochs, and on which GPU the run happened on. Nothing in the surviving sources says which version describes the weights published here. So all of those rows were removed rather than left on the card looking like fact. When a number is unknown, this card says it is unknown instead of filling the gap.

### Dataset composition

These figures appear both on the [`legal-training-il`](https://huggingface.co/datasets/BrainboxAI/legal-training-il) dataset card and on this model's previous card, and they sum to exactly 17,613.

| Source | Count | Content |
|---|---|---|
| Israeli court rulings | 7,960 | Supreme Court, family, criminal, civil |
| Kol-Zchut rights pages | 2,353 | Labour, housing, insurance, disability, pension |
| Open Law Book (Wikisource) | 300 | Full text of Israeli statutes |
| Contract clauses | 7,000 | 41 categories, classified by hand |
| **Total** | **17,613** | |

Language mix, as reported on the dataset card: roughly 60% Hebrew, roughly 40% English.

The material was filtered on three conditions: a citation that can be verified, well-formed Hebrew, and no personally identifying information.

The dataset is published under **CC-BY-4.0**, a different licence from the model itself.

## Evaluation

**No numerical evaluation was run on this model. There is no score here, and none will appear until a real measurement is made.**

What was done instead: qualitative checking during day-to-day use. Is the statute right, does the case law fit, is the Hebrew fluent, and does the model hedge on questions that have no settled answer.

**Why there is no score.** At the time of release no public benchmark existed for Hebrew legal question answering. Building one is an open research problem, and a score cannot be invented to fill a row in a table.

**What that means for you:** there is a good impression of this model, and there is no proof. Those are two different things, and a model card should say which one it is offering.

## Limitations

- **It is a small model.** At this size there will be mistakes. That is a certainty, not a possibility.
- **It fabricates citations.** Always verify against Nevo, Psakdin or Takdin.
- **Knowledge cutoff.** The material was collected in early 2026. Later legislative changes are not in it.
- **Bias in the data.** The rulings lean towards employment and family law. Criminal and administrative law are much thinner.
- **No measurement.** See the Evaluation section.
- **It is a fine-tune of `unsloth/gemma-4-E2B-it`.** Every limit of that model, including its own training cutoff, is still here.

## Files and repositories

| Repository | What is inside | Who wants it |
|---|---|---|
| [`BrainboxAI/law-il-E2B`](https://huggingface.co/BrainboxAI/law-il-E2B) | `gemma-4-E2B-it.Q4_K_M.gguf` (3.4 GB) and this card | Ollama, llama.cpp, LM Studio |
| [`BrainboxAI/law-il-E2B-safetensors`](https://huggingface.co/BrainboxAI/law-il-E2B-safetensors) | Merged 16-bit weights (10.2 GB) | `transformers`, and continued training |

The repository also holds `gemma-4-E2B-it.BF16-mmproj.gguf` (0.99 GB). That is Gemma-4's vision component, needed only if you want to feed it images. Text questions do not need it.

## License

Apache 2.0. You may use, modify, distribute and sell derivatives, including commercial products, with attribution.

This is a fine-tune of [`unsloth/gemma-4-E2B-it`](https://huggingface.co/unsloth/gemma-4-E2B-it), so the terms of that model apply to this one as well. The base model is published under Apache 2.0 and also points to the [Gemma 4 licence terms](https://ai.google.dev/gemma/docs/gemma_4_license). Read those before relying on this line commercially.

The dataset, [`legal-training-il`](https://huggingface.co/datasets/BrainboxAI/legal-training-il), is published under CC-BY-4.0.

## Citation

```bibtex
@misc{elyasi2026lawil,
  title        = {Law-IL E2B (bx-legal-kochav): A Small, On-Device Legal Reasoning Model for Israeli Law},
  author       = {Elyasi, Netanel},
  year         = {2026},
  publisher    = {BrainboxAI},
  howpublished = {\url{https://huggingface.co/BrainboxAI/law-il-E2B}},
  note         = {Fine-tuned from unsloth/gemma-4-E2B-it}
}
```

## Author

Built by [**Netanel Elyasi**](https://huggingface.co/BrainboxAI), founder of [BrainboxAI](https://brainboxai.io), an Israeli applied-AI studio building small, private, domain-specialised models.

For custom training, tuning on a firm's own material, or on-premise deployment: [netanele@brainboxai.io](mailto:netanele@brainboxai.io).

*Part of the BrainboxAI family of on-device models. See also [`code-il-E4B`](https://huggingface.co/BrainboxAI/code-il-E4B) (code) and [`cyber-analyst-4B`](https://huggingface.co/BrainboxAI/cyber-analyst-4B) (security).*