File size: 1,493 Bytes
7b88c3e
60a1507
 
 
 
 
 
 
 
 
 
 
7b88c3e
 
60a1507
7b88c3e
60a1507
7b88c3e
60a1507
7b88c3e
60a1507
7b88c3e
60a1507
 
 
 
 
7b88c3e
60a1507
7b88c3e
60a1507
 
 
 
 
 
 
 
7b88c3e
60a1507
7b88c3e
60a1507
 
 
7b88c3e
60a1507
7b88c3e
60a1507
 
7b88c3e
60a1507
 
 
 
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
---
language: en
license: apache-2.0
base_model: distilbert/distilbert-base-uncased
tags:
  - text-classification
  - intent-classification
  - onnx
  - triton-inference-server
datasets:
  - custom
pipeline_tag: text-classification
---

# distilbert-intent-sql-creative-general

Fine-tuned [distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-base-uncased) for 3-class intent routing in an LLM inference pipeline.

## Purpose

Routes user prompts to the appropriate vLLM LoRA adapter on a Triton Inference Server:

| Label | ID | Routes to |
|---|---|---|
| `GENERAL` | 0 | Qwen2.5-7B-Instruct (no LoRA) |
| `SQL` | 1 | `sql-expert` LoRA adapter |
| `CREATIVE` | 2 | `creative` LoRA adapter |

## Training

- **Base model**: `distilbert/distilbert-base-uncased`
- **Dataset**: 84 hand-curated examples (SQL=30, CREATIVE=23, GENERAL=31)
- **Epochs**: 5
- **Learning rate**: 2e-5
- **Batch size**: 16
- **Max sequence length**: 128
- **Optimizer**: AdamW (weight_decay=0.01)
- **Val split**: 20% stratified

## Deployment

Exported to ONNX (opset 17) via [optimum](https://github.com/huggingface/optimum) and served
as an ONNX Runtime backend model inside NVIDIA Triton Inference Server on GKE Autopilot
(NVIDIA L4 GPU).

## Usage

```python
from transformers import pipeline

classifier = pipeline("text-classification", model="xczou/distilbert-intent-sql-creative-general")
classifier("Write a SQL query to find all orders above 100")
# [{'label': 'SQL', 'score': 0.98}]
```