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 in synthetic training data generation
Step 1: Register a model
The first component of the workflow is registering a new model - this helps us keep track of all our experiments down the line.
You can inspect your models with
Step 2: Prepare and upload data
Step 3: Teacher evaluation
Before training an SLM, distil labs validates whether a large language model can solve your task:
Step 4: SLM training
Once the teacher evaluation completes successfully, start the SLM training:
You can check the status of your training with
When the training completes, check performance with
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. You can find more information in model-deployment but for now, the following command starts an ollama 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.