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 key using the snippet in Account and Authentication.
Data Preparation
A training job requires three main components:
- 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. - Configuration file: YAML defining model and training parameters
A simple example dataset for a question-answering task:
Step 1: Upload and Validate 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 4: 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.