What it does
Table with columns: Area, Examples| Area | Examples |
|---|
| Sowing | what to sow now, is it too late, seed rate, variety choice, seed quality |
| Weather | forecast, spray timing, irrigation timing, frost alert |
| Machinery | tractor choice, rent vs buy, subsidy, stubble, drone spraying |
| Money and schemes | MSP, mandi price, PM-KISAN, KCC loan, fertiliser price, crop-loss claim (PMFBY) |
| Safety | refuses OTP sharing, flags scam calls (1930), won't give pesticide doses (points to KVK / label) |
get_today_context, get_crop_calendar, get_varieties, get_weather, get_mandi_price, recommend_equipment, kb_lookup (12 fixed intents), open_page, open_dialer. Full schemas are in tools.json in the dataset repo. The app supplies the tool results (the phone kit fetches live weather from Open-Meteo); the model never invents numbers.
Results (held-out test set: unseen phrasings and unseen districts, 600 turns)
Table with columns: Base Gemma 4 E2B, Bharat Sahayak v3 | Base Gemma 4 E2B | Bharat Sahayak v3 |
|---|
| Right tool chosen | 27.3 % (v1 baseline, 200 turns) | 98.9 % |
| Correct arguments | 14.8 % | 95.1 % |
| Replies with invented numbers | 16 / 192 | 0 |
| Consent / OTP / dose violations | — | 0 |
A general tool-calling check on the public BFCL v4 data with its official AST checker (our own inference harness, so not a leaderboard entry) is in bfcl_results.json once run.
Use
from unsloth import FastModelmodel, tokenizer = FastModel.from_pretrained("joshiyash666/bharat-sahayak-gemma4-e2b", max_seq_length=2048, load_in_4bit=True)
Render with the tokenizer's chat template and pass tools= (schemas in the dataset repo). Stop generation at <turn|> or <|tool_response>, run the tool, append its response, and continue.
On a phone: download the GGUF, run llama-server -m bharat_sahayak.Q4_K_M.gguf --jinja, and use phone_agent.py from the dataset repo.
Training
- QLoRA r=16 with Unsloth on one Kaggle T4 (fp32), max length 2048. Loss only on the model's own turns; tool results are masked.
- v1/v2: 10k conversations (625 steps). v3: continued from v2 on 4k fresh conversations, lr 1e-4, 250 steps.
- Data: 14,651 synthetic multi-turn conversations, 24 intents, 6 language styles (Hindi Devanagari and Roman, Marathi Devanagari and Roman, Hinglish, English); about 40 % voice-style with ASR noise. Facts come from a sourced knowledge pack (ICAR / state agri-university crop calendars, scheme pages, helplines).
Limits
- Farming only for now (small business and daily life are next). Knowledge pack dated 2026-11-08: scheme amounts and dates change.
- Synthetic training data: real farmer speech will be messier. Please report failures.
- Known misses: drone-purchase subsidy questions sometimes go to the general machinery subsidy; occasionally calls
kb_lookup before refusing a pesticide dose.
- Not a substitute for an agronomist, KVK or official scheme portal.
Licence and attribution
Apache-2.0. This is a modified version of Gemma 4 E2B (Google DeepMind), fine-tuned with LoRA by Yash Joshi. Gemma is a trademark of Google LLC; this project is not affiliated with or endorsed by Google.
Build on it: new crops, languages, states or tools are welcome. Open a discussion on the Hub.