Train Your SLM with the distil CLI Claude Skill
Train a specialized small language model for text-to-SQL conversion — entirely from within Claude Code using the distil labs CLI skill.
What is distil labs?
distil labs is a platform for training task-specific small language models. We use knowledge distillation to compress what large models know into tiny, specialized models — 50-400x smaller than current state-of-the-art LLMs — that maintain comparable accuracy and run entirely on your machine.
Getting Started
Install the CLI
curl -fsSL https://cli-assets.distillabs.ai/install.sh | sh
distil login # or distil signup if you're new
Add the Claude Code Skill
/plugin marketplace add https://github.com/distil-labs/distil-cli-skill
/plugin install distil@distil-cli-skill
Training a Text2SQL Model
The workflow involves seven core steps:
- Model creation via CLI
- Task type selection (Question Answering for text-to-SQL)
- Data file preparation
- Data upload
- Teacher evaluation validation
- Model training
- Model download and deployment
Required Data Files
| File | Purpose |
|---|---|
job_description.json | Task objectives and configuration |
config.yaml | Task type and model settings |
train.csv | 20+ labeled (question, SQL) pairs |
test.csv | Held-out evaluation set |
Teacher Evaluation Results
| Metric | Score |
|---|---|
| ROUGE | 89.36% |
| METEOR | 88.31% |
| Binary (Exact Match) | 52.00% |
| LLM-as-a-Judge | 80.00% |
The 80% semantic correctness score indicated a green light to proceed with training.
Final Model Performance
| Metric | Teacher (DeepSeek-V3) | Base Model | Fine-tuned Model |
|---|---|---|---|
| LLM-as-a-Judge | 80% | 36% | 74% |
| Exact Match | 38% | 24% | 40% |
| ROUGE | 88.3% | 69.3% | 88.5% |
Downloaded Model Contents
downloaded-model/
├── model.gguf (2.2 GB) - Quantized model for Ollama
├── Modelfile (1.6 KB) - Ollama configuration
├── model_client.py (2.6 KB) - Python client to invoke
├── README.md (2.4 KB) - Deployment instructions
├── model/ # Full precision model (HuggingFace format)
└── model-adapter/ # LoRA adapter only (35 MB)
Example Results
Query: “Which artists have total album sales over 1 million?”
- Base model: Returns hallucinated query ignoring the question entirely
- Fine-tuned model: Returns correct JOIN, GROUP BY, and HAVING clause
What We Built
Conversational AI can guide users through a complete machine learning workflow — from prompt to production-ready model — without requiring traditional ML expertise, GPU infrastructure, or extensive data labeling.