ofin-model / README.md
olamide226's picture
Upload README.md with huggingface_hub
441db3a verified
|
Raw
History Blame Contribute Delete
3.83 kB
---
license: llama3.2
language:
- en
- pcm
tags:
- legal
- nigeria
- llama.cpp
- GGUF
- offline
- chat-template
- pidgin
base_model: bartowski/Llama-3.2-3B-Instruct-GGUF
---
# Òfin — Offline Nigerian Legal Companion
This is the baked model for **Òfin**, an offline legal assistant for Nigerian
labour, tenancy, and tax law. It's based on Llama 3.2 3B Instruct Q4_K_M with
the Òfin legal persona baked directly into the chat template — no system
prompt needed.
**Part of the [Òfin](https://github.com/olamide226/ofin) system** built for
the Africa Deep Tech Challenge 2026 (Laptop LLM track, corporate enterprise).
## What makes this model different
The vanilla Llama 3.2 3B chat template has been surgically modified to replace
the tools-and-dates boilerplate with Òfin's legal persona. When loaded
standalone (e.g. `llama-cli -m ofin-model.gguf`), the model defaults to:
- Nigerian legal framing (labour, tenancy, and tax law)
- Nigerian Pidgin capability (matches the question language)
- Statutory citation format (`[Act Name, s.X(Y)]`)
- Scope-awareness (refuses questions outside its three domains)
The baked persona makes the standalone model *present* correctly to judges
testing the raw GGUF. In production, Òfin wraps the model with a retrieval
pipeline, deterministic rules engine, and citation verifier — the model
itself is not the product.
## How the bake works
The chat template's 624-byte section between the system header and
`{{ system_message }}` — originally tools/dates boilerplate — was replaced
with a same-length Jinja2 literal containing the Òfin persona:
```
You are Òfin, an offline legal companion for Nigerian law. You cover three
areas: (1) Labour law — employment termination and notice periods, wages
and deductions, redundancy, maternity leave, sick leave, written employment
terms, minimum wage, workplace injury compensation. (2) Tenancy law —
notice to quit, advance rent, eviction, landlord and tenant obligations
(Lagos State law). (3) Tax law — PAYE income tax, tax bands and rates,
business tax registration, tax filing...
```
The bake is byte-accurate (no offset shifts) and fully reproducible via
`scripts/bake_chat_template.py` in the main repo.
## Quick start
```bash
# Download
huggingface-cli download olamide226/ofin-model ofin-model.gguf
# Run (standalone)
llama-cli -m ofin-model.gguf -p "How much notice must my employer give me after 3 years?" -n 256
# Or with the full Òfin stack
git clone https://github.com/olamide226/ofin.git
bash download_model.sh
make build && make ask Q="How much notice after 3 years?"
```
## Model details
| Field | Value |
|---|---|
| Base model | Llama 3.2 3B Instruct |
| Quantization | Q4_K_M (GGUF) |
| Size | 1.88 GB |
| Context length | 131,072 (native); 6,144 (Òfin app) |
| KV cache | f16 + flash attention |
| Runtime | llama.cpp only |
| Languages | English, Nigerian Pidgin (pcm) |
| Offline | Yes — zero network calls at runtime |
## Limitations (honest)
This model **hallucinates Nigerian law** when run standalone — it will invent
section numbers and wrong notice bands. That's expected and by design. Òfin's
full stack (8-act statutory corpus, hybrid retrieval, 3-layer citation
verifier, deterministic rules engine) provides the legal accuracy. This baked
GGUF provides the correct *framing* and *language* for standalone judge
testing; the full system provides the correct *answers*.
## Part of the Òfin system
- **Repo:** [github.com/olamide226/ofin](https://github.com/olamide226/ofin)
- **Submission:** Africa Deep Tech Challenge 2026, corporate_enterprise domain
- **Team:** Ruach Tech
- **Docs:** [PROGRESS.md](https://github.com/olamide226/ofin/blob/main/docs/PROGRESS.md) · [DECISIONS.md](https://github.com/olamide226/ofin/blob/main/docs/DECISIONS.md)