File size: 1,682 Bytes
bdec67b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
language:
- en
license: mit
tags:
- small-language-model
- slm
- pytorch
- edge-ai
- logistics
- customer-support
- delivery-assistant
pipeline_tag: text-generation
widget:
- text: "<|user|> Customer is asking to change delivery address after order pickup. <|assistant|>"
---

# Delivery-Rider-Assistant-SLM (30.0M Parameters)

## Overview
Delivery-Rider-Assistant-SLM is a lightweight Small Language Model (SLM) trained from scratch, intended for offline use on low-power mobile devices by delivery partners and drivers (e.g., Swiggy, Zomato, Porter).

## Intended Use Case
- Offline edge execution in areas with poor connectivity.
- Quick responses for address changes, payment status checks, COD handling, and order issues.

## Model Details & Architecture
- Architecture: Decoder-only causal transformer (nanoGPT-style, flash attention)
- Parameters: ~30.0 million
- Layers: 6
- Attention heads: 8
- Embedding dimension: 384
- Context length: 256 tokens
- Tokenizer: BPE (GPT-2 encoding via tiktoken)

## Training Setup
- Hardware: Single NVIDIA Tesla T4 GPU (Google Colab Free Tier)
- Training time: ~23 minutes
- Precision: Mixed precision (float16 AMP)
- Optimizer: AdamW (lr=6e-4, weight_decay=0.1, cosine schedule with warmup)
- Best validation loss: 0.7974
- Data: Bitext customer-support instruction dataset

## How to Load in PyTorch
```python
import torch
from huggingface_hub import hf_hub_download

weights_path = hf_hub_download(repo_id="learner-subodh/Delivery-Rider-Assistant-SLM", filename="pytorch_model.bin")
# Re-create the GPT class and GPTConfig from the training notebook, then:
# model.load_state_dict(torch.load(weights_path, map_location="cpu"))
```