TerraPulse AI small language model, LoRA adapter (PEFT). A LoRA fine-tune of Qwen/Qwen3-1.7B
(Apache-2.0, 1.72 B parameters with tied input/output embeddings, under the hackathon's 3 B limit), built for the
GeoAI Hackathon @ CSRE, IIT Bombay: an assistant that recommends where and when to head outdoors.
| Code (API, pipeline, verifier, training notebooks) | https://github.com/aaron43210/GeoAI_Hackathon |
| Adapter / merged / GGUF | -lora · merged · -GGUF |
| Training data | aaronr43210/terrapulse-sft-data |
| Files in this repo | adapter_model.safetensors, adapter_config.json (base: Qwen/Qwen3-1.7B, r=16, α=32), tokenizer. |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-1.7B", torch_dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(base, "aaronr43210/terrapulse-qwen3-1.7b-lora")
tok = AutoTokenizer.from_pretrained("aaronr43210/terrapulse-qwen3-1.7b-lora")
# or load the adapter straight away: AutoModelForCausalLM.from_pretrained("aaronr43210/terrapulse-qwen3-1.7b-lora")
The model handles two language tasks inside a deterministic system:
[E4].It holds no weather or place knowledge of its own. Dates, scores and safety limits are computed by code, and every answer is checked by a deterministic verifier (numbers + units, times, place names, citation ids and values, severity wording). An answer that fails is repaired once or replaced by a data template.
Measured bake-off on CPU (Q4_K_M, 24 hand-written questions): Qwen3-1.7B scored activity 0.917, location 1.0, profiles 0.958, scope 0.917 at 2.2 s per intent; Qwen3.5-2B scored 0.875 / 0.958 / 0.958 / 0.958 at 4.9 s. Excluded on size or licence: Phi-3/Phi-4-mini (3.8 B), Ministral-3-3B (3.85 B), Granite-4.0-micro (3.4 B), Llama-3.2-3B (3.21 B, non-OSI licence), Qwen2.5-3B (research licence), SmolLM3 (3.08 B), Gemma-3n-E2B (5.4 B).
Qwen/Qwen3-4B and kept only
because they passed the verifier, plus 16 template answers.<think></think> block, identical in training and inference.Intent extraction, 24 hand-written questions not in the training data (Q4_K_M, CPU):
| metric | base Qwen3-1.7B | TerraPulse fine-tune |
|---|---|---|
| activity | 0.917 | 1.0 |
| location | 1.0 | 0.958 |
| people profiles | 0.958 | 1.0 |
| in/out of scope | 0.917 | 0.958 |
| valid JSON | 1.0 (grammar-constrained) | 1.0 |
End to end, live data, questions never seen in training (full API with verifier):
| test | base | fine-tune |
|---|---|---|
| answer drafts passing the verifier first time (20-question set) | 4 / 13 | 12 / 14 |
| correct status (answer / clarify / decline / not available), 20 questions | 18 / 20 | 19 / 20 |
| correct status, 24 further scenarios | — | 23 / 24 (the miss was a parser bug, since fixed) |
| activity and profile extraction (44 questions) | 100 % | 100 % |
The training notebook also reported a grounding pass rate of 1.0 vs 0.55. Those 20 fact sheets were part of the training data in that run, so treat that figure as optimistic; the live first-draft numbers above are the clean ones.
Research and demonstration inside an outdoor-activity assistant that supplies live data. Health-related limits are conservative heuristics based on US EPA AQI guidance and heat-index bands; this is not medical advice.
Apache-2.0, the same as the base model. Map data © OpenStreetMap contributors; weather data by Open-Meteo.com (CC BY 4.0).
Qwen/Qwen3-1.7B