Quickstart
This guide will walk you through training your first specialized small language model (SLM) with distil labs in just a few steps
Prerequisites
- A distil labs account
- Python 3.7+
- tar
- Basic understanding of your task requirements
Authentication
First, set up authentication to access the distil labs API. You can get the API token using the snippet in Account and Authentication.
Data preparation
A training job requires three main components:
- Configuration file: YAML defining model and training parameters
- Job description: JSON file describing your task in plain English
- Training and testing data: Small dataset (10-50 examples) showing inputs and expected outputs. They should be tables with
question
,answer
columns as well as an optionalcontext
column. - Unstructured data: JSONL file containing unstructured text data to aid is synthetic training data generation
Step 1: Prepare and upload data
Step 2: Teacher evaluation
Before training an SLM, distil labs validates whether a large language model can solve your task:
Step 3: SLM training
Once the teacher evaluation completes successfully, start the SLM training:
Step 4: Download your model
Once training is complete, download your model for deployment:
Step 5: Deploy the model
After you download and untar the model, you can easily deploy it with any model-serving library of your choosing. The following command starts a vllm server with the fine-tuned model:
Query the model with input prompts:
Next steps
That’s it! You have successfully trained and deployed a specialized small language model that performs your specific task with high accuracy while being much smaller than general-purpose LLMs. For more advanced usage, explore our comprehensive How to documentation.