# Rafiki wa Biashara - Kenya MSME Advisor (ADTC 2026 Submission)
An offline, on-device advisory assistant for Kenyan MSME (micro, small, and medium enterprise) owners, covering tax, business registration, financing, and regulatory compliance. Built for the Africa Deep Tech Challenge 2026 (Corporate/Enterprise track).
## Repository Scope
This repository was adapted from my broader academic thesis project (Kenya MSME
Advisor, a RAG advisory chatbot originally using a cloud LLM). This is the project I am currently working on as my final Master's project. Files from that
earlier project that are not part of this specific ADTC submission -- data
scraping scripts, a Streamlit web application, an admin/research dashboard --
have been moved into `legacy/` for reference and are not required to run or
evaluate this submission. Everything needed for the ADTC submission (the
offline model, RAG retrieval, and web UI) lives in the repository root.
## Architecture
Browser (webui/index.html)
-- fetch --> RAG proxy (rag_server.py) on port 8091
-- TF-IDF retrieval over documents/kb1..kb9
-- forwards augmented prompt -->
llama-server (llama.cpp) on port 8090
-- loads model/msme-qwen2.5-1.5b-Q4_K_M.gguf
The fine-tuned model (msme-qwen2.5-1.5b-Q4_K_M.gguf) also runs standalone via llama-cli/llama-server with no RAG layer -- this is what the raw model evaluation tests directly.
## Requirements
- Python 3.10+
- A C++ build toolchain (for compiling llama.cpp): cmake, gcc/g++
- About 4GB free RAM to run the full stack comfortably
## Setup
### 1. Clone this repo and install Python dependencies
git clone
github.com
cd kenya-msme-adtc
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
### 2. Get the model file
Run `bash download_model.sh` -- this downloads the model automatically from Hugging Face (kathembo-tsongo/qwen-msme-gguf, idempotent, safe to re-run).
Place it at model/msme-qwen2.5-1.5b-Q4_K_M.gguf
### …