CoolFace
Modelpublic

SatyamSinghal/taskmind-1.1b-chat-lora

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
1likes11downloads
Model Card

TaskMind — TinyLlama 1.1B Chat LoRA

A LoRA adapter fine-tuned on TinyLlama/TinyLlama-1.1B-Chat-v1.0 for WhatsApp message intent classification and structured task extraction in English and Hinglish (Hindi–English code-switch).

Trained entirely on Apple Silicon MPS (M5 Max) — no cloud GPU, no cost, 2 minutes 12 seconds.

📦 Full pipeline, production API server, test suite, and deployment docs → github.com/vijendradhanotiya/taskmind-ai

What It Does

Given a raw WhatsApp team message, the model extracts structured intent as JSON — the model itself outputs valid JSON, no regex hacks needed.

Input:

@Neha the design review is pending from your end

Output:

json
{
  "intent": "TASK_ASSIGN",
  "assigneeName": "Neha",
  "project": null,
  "title": "Design review",
  "deadline": null,
  "priority": "normal",
  "progressPercent": null
}

Supported Intents

IntentTrigger PatternExample
TASK_ASSIGN@mention + action"@Rohan review the PR I just pushed"
TASK_DONEcompletion language"done bhai, merged the PR"
TASK_UPDATEprogress percentage"login page 60% ho gaya"
TASK_BLOCKEDblocker / error"CI/CD pipeline is broken again"
PROGRESS_NOTEstatus update"deployment failed on prod — rollback initiated"
GENERAL_MESSAGEno task signal"good morning team!", "okay noted"

Quick Start

python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch, json

BASE_MODEL = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
ADAPTER    = "SatyamSinghal/taskmind-1.1b-chat-lora"

tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model     = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype=torch.float32)
model     = PeftModel.from_pretrained(model, ADAPTER)
model.eval()

SYSTEM_PROMPT = (
    "You are TaskMind, an AI that reads WhatsApp messages and extracts structured task data. "
    "Always respond with valid JSON only. No explanation. No markdown."
)

def classify(message: str) -> dict:
    chat = [
        {"role": "system", "content": SYSTEM_PROMPT},
        {"role": "user",   "content": message},
    ]
    ids = tokenizer.apply_chat_template(chat, return_tensors="pt", add_generation_prompt=True)
    with torch.no_grad():
        out = model.generate(ids, max_new_tokens=150, do_sample=False, pad_token_id=tokenizer.eos_token_id)
    text = tokenizer.decode(out[0][ids.shape[-1]:], skip_special_tokens=True).strip()
    try:
        return json.loads(text)
    except json.JSONDecodeError:
        return {"raw": text, "parse_success": False}

print(classify("@Agrim fix the growstreams deck ASAP"))

Training Details

ParameterValue
Base modelTinyLlama/TinyLlama-1.1B-Chat-v1.0
MethodLoRA (Low-Rank Adaptation) via SFT
LoRA rankr = 16
LoRA alpha32
Target modulesqproj, vproj
Trainable params~4.2M / 1.1B (0.38%)
Dataset size131 training + 20 validation examples
Epochs5
Batch size4
Max sequence length512
OptimizerAdamW (paged)
Learning rate2e-4 with cosine schedule
HardwareApple M5 Max — MPS backend
Training time2 minutes 12 seconds
Training cost$0

Performance

MetricBefore Fine-tuningAfter Fine-tuning
Eval loss2.280.39
Token accuracy59%92.8%
JSON parse success~30%~97%
Correct intentOften wrongCorrect in tested cases

Before vs After — Real Examples

MessageBase ModelTaskMind
@Agrim fix deck ASAPFake deadline 2021-01-01, assignee "John Doe"TASK_ASSIGN, correct title
done bhai, merged the PRFake project "PR-123", wrong intentTASK_DONE, null fields
login page 60% ho gayaTASK_ASSIGN, hallucinated dataTASK_UPDATE, progressPercent=60
getting 500 errorHallucinated taskGENERAL_MESSAGE
Sure sir ready for itJohn Doe, fake taskGENERAL_MESSAGE, null

API Server

A production-ready FastAPI server wrapping this adapter is available in the companion repo.

bash
git clone https://github.com/vijendradhanotiya/taskmind-ai
pip install -r requirements.txt
python3 -m uvicorn api.main:app --host 0.0.0.0 --port 8001

OpenAI-compatible endpoints included:

bash
# Classify a WhatsApp message
curl -X POST http://localhost:8001/v1/classify \
  -H "Content-Type: application/json" \
  -d '{"message": "@Vijendra deploy karo production pe aaj raat tak, urgent hai!"}'

# Generic chat completion
curl -X POST http://localhost:8001/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "What is LoRA?"}], "max_tokens": 150}'

Framework Versions

LibraryVersion
PEFT0.18.1
TRL1.1.0
Transformers4.57.0
PyTorch2.2.2
Datasets4.8.4
Tokenizers0.22.1

Contributors

NameRoleGitHub
Satyam SinghalModel training, dataset curation, API development@SatyamSinghal
Vijendra DhanotiyaArchitecture, deployment, repo maintainer@vijendradhanotiya
Full source, deployment guide, hardware benchmarks, and test suite: [github.com/vijendradhanotiya/taskmind-ai](https://github.com/vijendradhanotiya/taskmind-ai)

Citation

If you use this model or the TaskMind pipeline in your work:

bibtex
@misc{taskmind2025,
  title   = {TaskMind: WhatsApp Intent Classification via LoRA Fine-tuning on TinyLlama},
  author  = {Singhal, Satyam and Dhanotiya, Vijendra},
  year    = {2025},
  url     = {https://huggingface.co/SatyamSinghal/taskmind-1.1b-chat-lora},
  note    = {LoRA adapter for TinyLlama-1.1B-Chat-v1.0, trained on Apple Silicon MPS}
}
bibtex
@software{vonwerra2020trl,
  title   = {{TRL: Transformers Reinforcement Learning}},
  author  = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward
             and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif
             and Gallouedec, Quentin},
  license = {Apache-2.0},
  url     = {https://github.com/huggingface/trl},
  year    = {2020}
}