Text Generation
LiteRT-LM
English
agriculture
farmer-advisory
on-device
edge-ai
LiteRT-LM
LiteRT
qwen
LoRA
Indian-agriculture
Instructions to use uralstech/Qwen-2.5-1.5B-KCC-LiteRT-LM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use uralstech/Qwen-2.5-1.5B-KCC-LiteRT-LM with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli litert-lm run \ --from-huggingface-repo=uralstech/Qwen-2.5-1.5B-KCC-LiteRT-LM \ --prompt="Write me a poem"
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,105 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- agriculture
|
| 7 |
+
- farmer-advisory
|
| 8 |
+
- on-device
|
| 9 |
+
- edge-ai
|
| 10 |
+
- LiteRT-LM
|
| 11 |
+
- LiteRT
|
| 12 |
+
- text-generation
|
| 13 |
+
- qwen
|
| 14 |
+
- LoRA
|
| 15 |
+
- Indian-agriculture
|
| 16 |
+
base_model:
|
| 17 |
+
- unsloth/Qwen2.5-1.5B-Instruct
|
| 18 |
+
inference: false
|
| 19 |
+
library_name: litert-lm
|
| 20 |
+
pipeline_tag: text-generation
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Qwen-2.5-1.5B-KCC-LiteRT-LM
|
| 24 |
+
|
| 25 |
+
This is an on-device farmer advisory language model fine-tuned on cleaned Kisan Call Centre (KCC) question–answer pairs from Indian smallholder farmers, then converted and packaged for efficient offline inference using Google's LiteRT / LiteRT-LM stack.
|
| 26 |
+
|
| 27 |
+
It is intended for low-connectivity, edge scenarios — such as mobile advisory apps for Indian farmers.
|
| 28 |
+
|
| 29 |
+
## Model Details
|
| 30 |
+
|
| 31 |
+
- **Base model**: [unsloth/Qwen2.5-1.5B-Instruct](https://huggingface.co/unsloth/Qwen2.5-1.5B-Instruct)
|
| 32 |
+
- **Fine-tuning method**: LoRA (parameter-efficient) via Unsloth + TRL SFTTrainer
|
| 33 |
+
- **Dataset**: Cleaned ["Farmers Call Query Data"](https://www.kaggle.com/datasets/daskoushik/farmers-call-query-data-qa) by Das Koushik, based on data from [data.gov.in](https://www.data.gov.in/)
|
| 34 |
+
→ Only null/empty rows removed; no synthetic data, paraphrasing, or external augmentation
|
| 35 |
+
- **Training regime**: Very short, step-limited runs (max_steps=60, warmup_steps=5) on Colab Tesla T4 due to free-tier constraints
|
| 36 |
+
→ Pilot for pipeline validation, **not** full convergence
|
| 37 |
+
- **Conversion**: PyTorch → LiteRT (.tflite) using [Google AI Edge Torch](https://github.com/google-ai-edge/ai-edge-torch) (v0.7.1)
|
| 38 |
+
→ Static KV cache: 4096 tokens
|
| 39 |
+
→ Result: ~1.6 GB .tflite artifact
|
| 40 |
+
- **Packaging**: .tflite → .litertlm using [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) (v0.8.1) tools
|
| 41 |
+
- **Quantization**: Quantized graph as produced by AI Edge Torch conversion
|
| 42 |
+
- **Context length**: 4096 tokens (fixed/static KV cache)
|
| 43 |
+
- **Intended use**: Offline, interactive agricultural advisory in low-resource settings
|
| 44 |
+
- **Out-of-scope**: General-purpose chat, high-precision agronomy, multi-turn memory beyond context limit, production-grade fluency
|
| 45 |
+
|
| 46 |
+
## Performance on Consumer Hardware
|
| 47 |
+
|
| 48 |
+
Tested on Mac mini (Apple M4, 16 GB unified memory) using LiteRT-LM with GPU backend:
|
| 49 |
+
|
| 50 |
+
- **Time-to-first-token (TTFT)**: < 1 second
|
| 51 |
+
- **End-to-end response time** (50–150 token advisory answers): ~2.5–4 seconds
|
| 52 |
+
- **Throughput**: Stable incremental decoding
|
| 53 |
+
|
| 54 |
+
Suitable for real-time, offline farmer-facing tools.
|
| 55 |
+
|
| 56 |
+
## Important Limitations & Known Behaviors
|
| 57 |
+
|
| 58 |
+
**This is an early engineering validation release — not a production model.**
|
| 59 |
+
|
| 60 |
+
Due to extremely short training (Colab constraints):
|
| 61 |
+
|
| 62 |
+
- Strong mirroring of original KCC terse, bullet-list style → outputs often lack natural conversational flow
|
| 63 |
+
- Occasional near-verbatim reuse of training phrases with limited adaptation to query variations
|
| 64 |
+
- Mild repetition / incomplete reasoning (undertraining artifact)
|
| 65 |
+
|
| 66 |
+
**LiteRT-LM specific observations** (compared to PyTorch inference):
|
| 67 |
+
|
| 68 |
+
- Noticeably reduced coherence
|
| 69 |
+
- Increased repetition, fragmentation, or looping in some generations
|
| 70 |
+
- Responses sometimes feel more generic / less tightly grounded
|
| 71 |
+
|
| 72 |
+
→ These are runtime-specific behaviors (not present in original PyTorch checkpoint).
|
| 73 |
+
Root cause not yet isolated due to lack of controlled ablation; likely contributors include decoding configuration, stop-token alignment, fixed KV-cache constraints, and runtime-specific sampling behavior.
|
| 74 |
+
|
| 75 |
+
The project deliberately prioritizes **reproducible deployment path + failure mode transparency** over peak quality. Full multi-epoch training + runtime debugging expected to improve results significantly.
|
| 76 |
+
|
| 77 |
+
## Comparison with Prior Gemma-3n Effort
|
| 78 |
+
|
| 79 |
+
Compared to earlier Gemma-3n-E2B fine-tuning on the same task:
|
| 80 |
+
|
| 81 |
+
- **Qwen2.5-1.5B** wins on: conversion success, long-context stability, deployment reliability
|
| 82 |
+
- **Gemma-3n-E2B** wins on: more natural dialogue style, broader multilingual starting point
|
| 83 |
+
- Deciding factor: Gemma-3n could not be reliably converted to LiteRT-LM with public tooling → hard dead-end
|
| 84 |
+
|
| 85 |
+
See full comparison in the project documentation.
|
| 86 |
+
|
| 87 |
+
## Usage
|
| 88 |
+
|
| 89 |
+
This model is packaged in **.litertlm** format for use with **LiteRT-LM** runtime (preview stage as of Dec 2025).
|
| 90 |
+
|
| 91 |
+
Refer to:
|
| 92 |
+
|
| 93 |
+
- [LiteRT-LM GitHub](https://github.com/google-ai-edge/LiteRT-LM)
|
| 94 |
+
- Google AI Edge Gallery app (Android) for quick testing
|
| 95 |
+
- LiteRT documentation for integration into Android/iOS/macOS/Linux apps
|
| 96 |
+
- [UAI.LiteRTLM](https://github.com/Uralstech/UAI.LiteRTLM) — a Unity package wrapping LiteRT-LM inference, useful for building Android/Quest apps with this model
|
| 97 |
+
|
| 98 |
+
## Reproducibility
|
| 99 |
+
|
| 100 |
+
Full pipeline (data cleaning → LoRA fine-tuning → merge → LiteRT conversion → LiteRT-LM packaging) is documented with scripts and exact commands in the associated repository.
|
| 101 |
+
|
| 102 |
+
Conversion requires high-RAM CPU instance (~128 GB recommended). No GPUs needed for conversion/packaging.
|
| 103 |
+
|
| 104 |
+
See the project documentation for step-by-step instructions (AWS EC2 r6i instances used in original work):
|
| 105 |
+
https://uralstech.github.io/Qwen-KCC-On-Device-Pipeline
|