跳到正文
DEV Community· Aghazie David·· 4 小時前AI 評分53

Kwota 將尼日利亞工匠的語音工作描述轉成 PDF 報價並透過 WhatsApp 傳送

Kwota: a Nigerian plumber talks through the job in Pidgin, and the customer gets a priced quote on WhatsApp

AI 導讀

Aghazie David 開發 Kwota,讓尼日利亞工匠以語音描述工作後生成 PDF 報價,並開啟已填妥報價內容的 WhatsApp 連結。工具支援皮欽語、約魯巴語、豪薩語、伊博語及尼日利亞英語,使用 NaijaVox-2.0 轉錄、Gemma 3 12B 配對工匠價目表中的項目;數量會從轉錄內容抽取並核對,報價只採用工匠價目表或其口述金額,不由模型生成。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

In Nigeria, if your tap is leaking, you call a plumber you know. He comes, looks under the sink, says "e no too bad", and tells you he'll "send you the price". Then the price arrives two days later, or not at all, often as a voice note or a photo of a page torn from an exercise book.

That gap between looking at the job and sending the quote is where artisans lose work. Writing quotes is unpaid evening work. A slow quote goes to the next plumber, and a handwritten one looks less trustworthy than it should.

Kwota (it's how "quote" sounds when you say it in Pidgin) closes that gap before the artisan leaves the customer's gate:

  1. The plumber, painter or tiler walks the job and talks, the way he already sends voice notes: "Madam, the kitchen tap dey leak for two points. I go change three lengths of half inch pipe, plus four elbows. Workmanship na fifteen thousand."
  2. Kwota transcribes it (Pidgin, Yoruba, Hausa, Igbo or Nigerian English) and maps it onto his own price list.
  3. It shows every number it heard and the exact words each came from, so he can confirm.
  4. One tap makes a clean PDF quote with his business name, and opens WhatsApp with the quote already typed out for the customer.

Who pays? Independent artisans: plumbers, painters, tilers, AC technicians and electricians. There are millions of them, and their whole business already runs on WhatsApp. A neat quote that lands in ten minutes wins jobs. The model I have in mind is a small monthly fee (around ₦1,500, about the cost of a recharge card), or pay-per-quote for artisans who only quote a few times a month.

Two rules shaped everything:

  • Kwota never invents a price. Every naira on the quote comes from the artisan's own editable price list, or from an amount he said out loud, and that line is flagged so he double-checks it.
  • Kwota never guesses sizes from photos. Photos help describe the scope ("water-stained ceiling, rusted pipe under the sink"), but measurements have to be spoken and confirmed.

Demo

Live on Hugging Face Spaces (free ZeroGPU): https://huggingface.co/spaces/Cipoklean/kwota

Open it, pick a trade (plumber, painter or tiler sample price lists), then record or type the job. A typed run of the voice note above gives:

Item Qty Unit price Amount Check
Leak repair labour 2 point ₦6,000 ₦12,000 ✓ heard "two points"
½ inch PVC pressure pipe 3 length ₦3,800 ₦11,400 ✓ heard "three lengths"
Elbow / bend fitting 4 pc ₦700 ₦2,800 ✓ heard "four"
Workmanship 1 job ₦15,000 ₦15,000 ⚠ price you said

Then Make the quote produces the PDF (with a proper ₦ sign, which needed a bundled font) and a wa.me link with the message ready to send.

There's also a Test the ear tab. Upload a batch of voice notes and the numbers each one should contain, and it scores how well the speech model kept them.

Code

title Kwota
emoji 🧾
colorFrom green
colorTo gray
sdk gradio
sdk_version 6.30.0
python_version 3.12
app_file app.py
pinned false
license mit
short_description Talk a job through in Pidgin, send a quote on WhatsApp

🧾 Kwota: talk your quote

Kwota turns a Nigerian artisan's walk-through voice note into a clean, priced quote they can send on WhatsApp before leaving the customer's gate.

A plumber, painter or tiler inspects the job, takes a few photos and talks "Madam, the kitchen tap dey leak for two points. I go change three lengths of half inch pipe, four elbows." Kwota hears it, maps it onto the artisan's own price list, shows every number it heard for a quick check, then makes a PDF and opens WhatsApp with the quote typed out.

Why

Quoting is unpaid evening work. Slow quotes lose jobs, and handwritten ones look less trustworthy than they should. Most artisans already run…

Plain Python and Gradio: kwota/asr.py (speech), kwota/numbers.py (quantity extraction), kwota/quote.py (price lists, the Gemma draft and its validator), kwota/llm.py (Gemma backends), kwota/document.py (PDF and WhatsApp). 15 tests cover the number and quote logic.

How I Built It

voice note ──► NaijaVox-2.0 (open ASR: Pidgin, Yoruba, Hausa, Igbo, Nigerian English)
                    │
photos ──► Gemma 3 (multimodal) ──► one-line job scope (never sizes, never prices)
                    │
transcript ──► Gemma 3 12B ──► line items chosen from YOUR price list, as JSON
                    │
          numbers.py ──► every quantity actually heard, plus the words it came from
                    │
    confirm screen: anything unheard is flagged, and everything is editable
                    │
            PDF quote + wa.me link

Listening: NaijaVox-2.0. An open speech model trained on Nigerian speech. Whisper-style models trained mostly on global English fall apart on "e dey leak for two points". Long voice notes get cut into 28-second chunks with overlap, so nothing falls between the cracks.

Thinking: Gemma 3 12B (unsloth/gemma-3-12b-it, an ungated mirror), running on the Space's ZeroGPU. Gemma gets the transcript and the price list (ids, units, aliases, but no prices) and returns JSON: which item ids were mentioned, the quantity, and the exact words it came from. It also writes the one-sentence job description, and reads photos when they're attached. The same code runs offline through Ollama (gemma3:4b) on a laptop, which matters for an artisan who doesn't want his customers' data on someone else's server.

Not trusting the model: validate() + numbers.py. This is the part I'm proudest of, because speech recognition will get words wrong. NaijaVox's own benchmark puts Pidgin word error at roughly one word in seven, and a misheard number costs the artisan real money. So:

  • numbers.py deterministically pulls out every quantity in the transcript: digits, English number words, Yoruba, Hausa and Igbo counting words (eeji = 2, biyu = 2, biyar = 5...), units like lengths, bags, cartons and buckets, and dimensions like "twelve by fifteen feet" (read as 180 sq ft).
  • "Half inch pipe" is a size, not a quantity of 0.5, so pipe sizes are excluded.
  • "Thirteen" and "thirty" are kept strictly apart, because they're the classic mishearing.
  • Gemma's quantity has to match a number that was actually heard. If it doesn't, the line is flagged ⚠ check qty. If Gemma picks an id that isn't on the list, it's dropped. Prices are always looked up, never generated.
  • If Gemma is down or returns junk, a rule-based alias matcher (with fuzzy matching for NaijaVox spelling drift like "cistan" and "emulshon") drafts the quote instead, and the UI says why.

A bug worth telling. During the final test, "Workmanship na fifteen thousand" produced a quote of ₦150,000,000. The matcher read "fifteen thousand" as fifteen thousand call-outs at ₦10,000 each. That's exactly the failure this whole design exists to catch, and it slipped through anyway. Now a bare amount of a thousand or more is treated as naira, never as a count. On a per-job line it becomes the price the artisan said, flagged for him to confirm, and a test pins it down. Any plumber who saw a ₦150m quote would have closed the app forever.

Memory without a server. The business name, phone number and edited price list live in the artisan's own browser (Gradio BrowserState). Kwota has no database and no account to create.

Why Does Open Innovation Matter?

Because the people Kwota serves are exactly who closed AI handles worst, and can least afford.

  • Language. The voice notes are in Pidgin, with Yoruba and Hausa numbers mixed in. NaijaVox exists because people trained an open model on Nigerian speech and published it. I couldn't fine-tune a closed API to tell eeji from eeta, but I can build on a model the community already tuned.
  • Cost. A ₦1,500-a-month product can't pay per-token cloud bills on every voice note. Open weights let Kwota run on free ZeroGPU today, on a cheap GPU later, or fully offline on a laptop with Ollama, at zero marginal cost per quote. That's the difference between a business that works in naira and one that doesn't.
  • Data. Quotes contain customers' names, phone numbers and what's broken in their homes. With an open model, the artisan can keep all of that on his own machine.
  • Trust and control. With a model I can run and inspect, I could wrap it in deterministic checks and decide exactly what it's allowed to touch: item ids, never prices. With an open model, the guardrails are mine to build, not a black box's promise.
  • No lock-in. If Gemma 4 or a better Nigerian ASR model ships next month, it's one environment variable to switch.

Prize Categories

  • Best Use of Gemma: Gemma 3 12B drafts every quote, as structured JSON constrained to the artisan's price list, and reads job photos for scope. The same pipeline runs on Ollama with gemma3:4b for offline use.

Built solo in Nigeria. If you know an artisan who quotes by voice note, send them the link. I'd love to hear what they'd want next.

來源:DEV Community · dev.to