Welcome to distil labs

distil labs provides a platform for training task-specific small language models (SLMs) with just a prompt and a few dozen examples. Our platform handles the complex machine learning processes behind the scenes. This allows you to focus on your use-case instead of managing large datasets and infrastructure.

Why distil labs?

  • Train Specialized Models with Minimal Data: Train specialized SLMs with just a prompt and a few dozen examples.
  • Full Ownership of Your Models: Download and deploy your models anywhere - your servers, applications, or at the edge. No vendor lock-in for inference.
  • Fully Automated ML Pipeline: No ML expertise required, we handle the technical complexity.
  • High Performance with Smaller Footprint: Get LLM-level accuracy with models up to 400x smaller. Run locally on affordable hardware.

Minimal example

Here’s how simple it is to train a specialized model with distil labs (get YOUR_API_KEY):

1import json
2import requests
3
4# Upload your task description and examples
5data = {
6 "config.yaml": open("data/config.yaml").read(),
7 "job_description.json": open("data/job_description.json").read(),
8 "test.jsonl": open("data/test.jsonl").read(),
9 "train.jsonl": open("data/train.jsonl").read(),
10 "unstructured.jsonl": open("data/unstructured.jsonl").read()
11}
12auth_header = {"Authorization": f"Bearer {distil_bearer_token()}"}
13response = requests.post(
14 "https://api.distillabs.ai/uploads",
15 headers={"Content-Type": "application/json", **auth_header},
16 data=json.dumps(data),
17)
18upload_id = response.json()["id"]
19
20# Start SLM training
21response = requests.post(
22 f"https://api.distillabs.ai/trainings/{upload_id}",
23 headers=auth_header,
24)
25slm_training_job_id = response.json()["id"]
26
27# When training completes, get your model download link
28response = requests.get(
29 f"https://api.distillabs.ai/trainings/{slm_training_job_id}/model",
30 headers=auth_header,
31)
32print(response.json())

Next steps

Ready to build your own specialized models? Continue to our How to train your SLM guide, see more detailed examples, or jump straight into the API reference.