File size: 6,020 Bytes
1fa7463
7b396b6
 
 
 
 
 
 
 
 
 
1fa7463
 
 
 
 
 
7b396b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fa7463
 
7b396b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef5b470
 
 
 
 
 
 
 
 
7b396b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fa7463
7b396b6
1fa7463
7b396b6
 
 
 
 
1fa7463
7b396b6
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
base_model:
- unsloth/Qwen3-8B-unsloth-bnb-4bit
datasets:
- Softsasi/Commerce-1-Order-AI-Dataset
library_name: peft
pipeline_tag: text-generation
license: apache-2.0
language:
- en
- bn
tags:
- text-generation-inference
- transformers
- unsloth
- qwen3
- trl
- qlora
- tool-calling
- function-calling
- ecommerce
- restaurant
- food-delivery
- order-automation
- bangla
- banglish
- conversational
---

# Commerce-1-Order-AI (8B LoRA Adapter)

**Commerce-1-Order-AI** (`Softsasi/Commerce-1-Order-AI`) is an enterprise-grade **8B-parameter autonomous ordering, customer support, and reservation AI agent** fine-tuned by **[Softsasi](https://huggingface.co/Softsasi)** on [`unsloth/Qwen3-8B-unsloth-bnb-4bit`](https://huggingface.co/unsloth/Qwen3-8B-unsloth-bnb-4bit).

Built for restaurant delivery chains (grounded in `101` real menu dishes and policies) and multi-vendor e-commerce storefronts, it emits deterministic `<tool_call>` JSON actions, computes exact BDT subtotals/coupons/delivery charges, enforces kitchen & stock guardrails, and operates seamlessly across **English (`en`)**, **Bangla (`bn`)**, and **Banglish**.

> **Live ZeroGPU Demo:** [`Softsasi/Commerce-1-Order-AI-Demo`](https://huggingface.co/spaces/Softsasi/Commerce-1-Order-AI-Demo)  
> **GGUF (`Q4_K_M`, 5.03 GB) for Ollama / llama.cpp:** [`Softsasi/Commerce-1-Order-AI-GGUF`](https://huggingface.co/Softsasi/Commerce-1-Order-AI-GGUF)  
> **Training Dataset (`1,900` Conv):** [`Softsasi/Commerce-1-Order-AI-Dataset`](https://huggingface.co/datasets/Softsasi/Commerce-1-Order-AI-Dataset)

---

## Key Capabilities

1. **Autonomous Multi-Turn Ordering & Cart Management** — Resolves dishes/SKUs, emits `<tool_call>` JSON for `add_to_cart`, `update_cart`, `remove_from_cart`, `apply_coupon`, and `place_order`, verifies exact itemized totals + delivery fees, and confirms address, phone, and payment (`COD`, `bKash`, `Nagad`, `Rocket`, `Upay`, `Visa/Mastercard`, `Wallet`).
2. **Trilingual Support (`English` / `Bangla` / `Banglish`)** — Understands native Bengali script and Romanized Banglish ordering chats while keeping structured JSON schema strict.
3. **Order Tracking & 5-Minute Cancellation Guardrails** — Supports `track_order` via Order ID or phone number, enforces pre-kitchen cancellation windows (`cancel_order` ≤ 5 mins), and escalates post-preparation requests or duplicate payment debits via `escalate_to_human`.
4. **Stock & Operating-Hours Safety** — Blocks out-of-stock SKUs (`search_products`) with closest alternatives, enforces `11:00 AM–11:00 PM` dining hours (`book_table`), and flags severe food allergy queries for immediate chef/human review.
5. **Structured NLU Webhook Router** — Extracts `intent`, `language`, `items`, `delivery_info`, `payment_method`, and `tool_suggestion` as strict JSON.

---

## Training Telemetry & Performance Summary

| Metric / Parameter | Observed Value |
| :--- | :--- |
| **Base Model** | `unsloth/Qwen3-8B-unsloth-bnb-4bit` (`8.2B` / `8.4B` Qwen3, `36` layers, `4096` hidden) |
| **Fine-Tuning Method** | QLoRA (4-bit NF4, `r=16`, `lora_alpha=32`, `lora_dropout=0.05`, all 7 linear layers) |
| **Training Run Dataset** | `1,600` train + `80` eval conversations (`3,386` validated `<tool_call>` JSONs, avg `7.0` turns/conv) |
| **Public Hub Dataset (`v1.1`)** | [`Softsasi/Commerce-1-Order-AI-Dataset`](https://huggingface.co/datasets/Softsasi/Commerce-1-Order-AI-Dataset) (`1,800` train + `100` eval, `3,826` validated tool calls + `update_cart`/`remove_from_cart`) |
| **Schedule / Context** | `45` steps, Context `1,536`, Effective Batch `8` (`1 × 8`), Cosine LR `2e-4` (`6` warmup) |
| **Hardware** | NVIDIA Tesla T4 (`15 GiB` VRAM, peak `11.43 GiB`) via [Unsloth](https://github.com/unslothai/unsloth) |

### Observed Loss Progression
- **Training Loss**: `1.9767` (Step 1) → `1.6048` (Step 2) → **`0.0538`** (Step 33) · `Grad Norm: 2.355 → 0.203`
- **Validation Loss** (`80` held-out conversations): `0.42558` (Step 15) → **`0.1258`** (Step 30)

### Verified Live ZeroGPU Output (`Structured NLU Order Router`)
**Input (Banglish):**
> `2ta Cheese Volcano Pizza pathan Court Para te, COD, 01711223344.`

**Output:**
```json
{"intent": "place_order", "language": "banglish", "items": [{"product_id": 13, "slug": "cheese-volcano-pizza", "name": "Cheese Volcano Pizza", "quantity": 2}], "delivery_info": {"area": "Court Para", "phone": "01711223344"}, "payment_method": "cash_on_delivery", "order_ref": null, "requires_confirmation": true, "requires_human": false, "tool_suggestion": "add_to_cart"}
```

---

## Quick Start (Python / Transformers + PEFT)

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

base_id = "Qwen/Qwen3-8B"
adapter_id = "Softsasi/Commerce-1-Order-AI"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(base_id, dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter_id)
```

---

## Softsasi Enterprise Model Suite

| Tier | Model Name | Size | Focus | Repositories |
| :--- | :--- | :---: | :--- | :--- |
| **Verify** | **Neural-1-Verify** | 1.5B | Fact-checking & claim verification | [`Softsasi/Neural-1-Verify`](https://huggingface.co/Softsasi/Neural-1-Verify) |
| **Insight** | **Insight-1-ERP-Analytics** | 4B | ERP BI, Benford forensics & Text-to-SQL | [`LoRA`](https://huggingface.co/Softsasi/Insight-1-ERP-Analytics) · [`GGUF`](https://huggingface.co/Softsasi/Insight-1-ERP-Analytics-GGUF) · [`Demo`](https://huggingface.co/spaces/Softsasi/Insight-1-ERP-Analytics-Demo) |
| **Commerce** | **Commerce-1-Order-AI** | 8B | Autonomous restaurant & e-commerce ordering | [`LoRA`](https://huggingface.co/Softsasi/Commerce-1-Order-AI) · [`GGUF`](https://huggingface.co/Softsasi/Commerce-1-Order-AI-GGUF) · [`Demo`](https://huggingface.co/spaces/Softsasi/Commerce-1-Order-AI-Demo) |

- **Developed by:** [Softsasi](https://huggingface.co/Softsasi) · **License:** Apache-2.0