Africa grows some of the world's finest coffee, yet across its origins the same gap repeats: agronomic knowledge is concentrated in thinly-spread extension services, and the farmers who need it most are the least connected. We run a grafted coffee seedling nursery in Kenya, and we built for the gap we know first-hand as the first deployment of a design meant to travel.

What it does

Kahawa Advisor answers coffee agronomy questions nursery practice, varieties, pests, diseases, pruning, harvest, marketing rules in English and Kiswahili, entirely on-device on an ordinary 8 GB laptop with zero network calls. It is deliberately opinionated about safety: it refuses to name pesticide products or doses (pointing to the extension officer and the PCPB register instead), won't diagnose definitively from vague symptoms, treats reported pesticide exposure as a medical emergency, and declines price forecasting.

How we built it

Gemma 3 4B (Q4_K_M GGUF) on llama.cpp, CPU-only, chosen by measurement: we benchmarked a faster 1B alternative and rejected it after it invented a pesticide dose in testing and failed Kiswahili comprehension for an advisory tool, model choice is itself a safety decision. Behaviour comes from a hand-built system prompt iterated against our own evaluation set: 81 field-grounded questions across 12 categories drawn from real nursery enquiries, including deferral traps and Kiswahili items. We ran the set grounded vs bare: the bare model attempted coffee price forecasts, embraced inappropriate Brazilian practices, and told a Kiswahili speaker that Ruiru 11 and Batian were "areas of Nairobi."

Challenges we ran into

Language control at 4B scale — the model could not reliably detect query language from a system-prompt rule, so we moved language routing into the application layer. Throughput versus judgment — the 1B was twice as fast and scored better on the contest's speed metrics; we shipped the slower model that refuses to invent doses, and documented the trade-off with the measurements in our report.

What we learned

Safety behaviour cannot be assumed from a system prompt it has to be tested per model, and small models fail it in surprising ways. Scoring formulas reward reading the source: the official profiler caps the throughput score at 15 tok/s, which changes the model-size calculus entirely. And a field-grounded evaluation set built from real farmer enquiries catches failures that generic benchmarks never would.

What's next

Kenya first, then the continent. The design is corpus-driven: every behaviour is grounded in a replaceable corpus and evaluation set, so adapting it to Uganda, Ethiopia, Tanzania or Rwanda means swapping in that origin's institutions, varieties, disease profile and marketing rules — not rebuilding the system. Immediate roadmap: retrieval over licence-cleared Kenyan institutional guidance (CRI/KALRO, AFA Coffee Directorate, KEPHIS) plus our nursery's field records, speculative decoding to recover throughput, and verification of every reference answer against published guidance. On market information: the advisor deliberately refuses to forecast prices offline — the honest roadmap item is surfacing official current market and regulatory information when a connection is available, never speculation.

Built With

Share this project:

Updates

Submission history