Cookbooks

# Cookbooks

Pick what you want to build. Follow the steps, run the Python file, then make it yours.

## Find your recipe

Each recipe is one Python file that uses the OpenAI client. Follow it from sample data to jobs to printed results.

What you need: Python, a terminal, a Gridline token and credits. Each script waits for its jobs to finish; time estimates are not available. Job counts below show what you will run. [Set up before you start](https://gridlinegpu.com/docs/cookbooks#before).

-
  - Fine-tuning
  - Batch inference

### [Fine-tune a classifier](https://gridlinegpu.com/docs/cookbooks/fine-tune-a-classifier)

Build a support-ticket classifier and compare it with its base model.

Comfort with

Python and terminal basics

Creates

one fine-tuning job and one batch
-
  - Distillation
  - Fine-tuning
  - Batch inference

### [Distill a large model into a small one](https://gridlinegpu.com/docs/cookbooks/distill-a-large-model)

Train a smaller model on a teacher's answers, then check their agreement.

Comfort with

Python, JSON and terminal basics

Creates

two batches and one fine-tuning job
-
  - Structured outputs
  - Batch inference

### [Extract structured data in bulk](https://gridlinegpu.com/docs/cookbooks/structured-extraction)

Turn order emails into JSON records and read any request errors.

Comfort with

Python, JSON and terminal basics

Creates

one batch
-
  - Embeddings
  - Batch inference

### [Embed text and search it](https://gridlinegpu.com/docs/cookbooks/embeddings-search)

Find passages closest in meaning to your questions using text vectors.

Comfort with

Python and terminal basics

Creates

one batch
-
  - Evals
  - Batch inference

### [Evaluate a fine-tune](https://gridlinegpu.com/docs/cookbooks/evaluate-a-fine-tune)

Compare your fine-tune with its base and inspect the tickets it missed.

Run [Fine-tune a classifier](https://gridlinegpu.com/docs/cookbooks/fine-tune-a-classifier) first, in the same folder: it writes `test.jsonl` and prints your model. Set `FT_MODEL` to that model's id.

Comfort with

Python and terminal basics; classifier recipe first

Creates

two eval runs, each of them one batch

## Before you start

You need a Gridline token and credits: the [quickstart](https://gridlinegpu.com/docs#access) shows how to get both. Then install the OpenAI client and put the token in your shell:

```
python -m pip install -U openai
export GRIDLINE_TOKEN="gla_..."
```

A recipe creates real jobs. Fine-tuning and batch jobs are paid for from your prepaid credits. A fine-tuning job prints its quote, the most it can cost, as soon as it is created.

What a credit is worth, the credit packs and each model's rates are on the [pricing page](https://gridlinegpu.com/pricing).

---

Source: https://gridlinegpu.com/docs/cookbooks
