The Problem

Smallholder farmers across sub-Saharan Africa face a critical bottleneck: no reliable access to crop disease expertise. When a pest or disease strikes a maize, pepper, or tomato plant, farmers often have no way to diagnose it or find treatment advice. Poor internet connectivity rules out cloud-based AI services. High API costs make subscription models unrealistic for farmers earning $2-5 per day.

The result? Entire harvests lost to preventable diseases.

The Solution

RK AgriDig is an offline crop disease diagnostic and advisory system that runs entirely on a farmer's own laptop — no internet required, no API bills, no cloud dependency.

Built on the GhanaAgricVOA dataset (2,361 Q&A pairs from Ghana), the model provides:

  • Disease identification — "What's affecting my crop?"
  • Treatment advice — "What can I do to fix it?"
  • Prevention guidance — "How do I avoid this next season?"

All in English and Twi, grounded in expert agricultural knowledge.

How It Works

  1. Model: Phi-3-mini quantized to Q4_K_M GGUF format (~2.3GB)
  2. Inference: Ollama + llama.cpp on Ubuntu 22.04 with CPU-only execution
  3. UI: Gradio interface — farmer describes symptoms, gets actionable advice
  4. Hardware: Runs on commodity 8GB laptops (Intel Core i5 10th-12th gen, integrated graphics)

The Challenge

Fitting a capable language model into 7GB RAM while maintaining >90% accuracy and hitting 15+ tokens/second throughput required aggressive optimization:

  • Quantization strategy selection (Q4_K_M as the accuracy/speed/memory sweet spot)
  • Memory-mapped model loading to avoid preloading full weights
  • Prompt engineering for domain-specific accuracy on crop diseases
  • Thermal management to stay under the 85°C disqualification threshold

Why This Matters for Africa

This isn't a hypothetical problem — it's the reality for millions of farmers across West Africa who own $150 refurbished laptops but can't afford $20/month cloud API subscriptions. RK AgriDig democratizes access to AI-powered agricultural expertise at scale.

Built With

  • gguf-quantization
  • ghanaagricvoa-dataset
  • gradio
  • hugging-face
  • llama.cpp
  • machine-learning
  • ollama
  • on-device-ai
  • phi-3-mini
  • python
Share this project:

Updates

Submission history