What is fine-tuning? More training on your examples

By

Fine-tuning trains an existing model a little more on your examples, for a narrow job. OpenAI's platform is closed to new users. The local path is posted here.

Fine-tuning means you train an existing model a little more on specific data, so it gets better at a narrow job.

A longer prompt shows a few examples for one chat. A fine-tune changes the weights, and later requests use that updated model.

Build an LLM from scratch and Language Model Builder are the hands-on versions on this site. This entry is the definition, and what the four coding tools do not offer.

How fine-tuning works

You start from a model that already finished its main training. You give it examples of the input and the output you want. Training updates the weights. The next request can go to that customized model.

Fine-tuning updates a trained modelA trained model reads your examples. Training updates the weights. Later requests use that updated model.Trained modelYour examplesUpdated weightsLater requests

Supervised fine-tuning is the common form. Each example is a prompt and the answer you wanted. The OpenAI guide calls the result a customized model for your use case.

Fine-tuning in each tool

None of the four coding-agent CLIs documents a fine-tune command. The OpenAI API still has a guide, and that platform is closing.

Claude Code Codex Cursor Grok
A fine-tune command Not documented Not documented in the Codex app or CLI Not documented Not documented on the models index
An API No fine-tuning page on the Claude docs index this pass The API guide is winding down. GPT-6.1 Terra’s card says the fine-tuning endpoint is not supported Not documented Not documented

Claude Code

The docs index this pass used has no fine-tuning page, and the CLI reference has no fine-tune flag. See the Claude Code docs index.

OpenAI Codex

Codex does not document a fine-tune command. The API does, under supervised fine-tuning, and the guide says OpenAI is winding down that platform.

The platform is no longer accessible to new users. Eligible existing customers can create training jobs until January 6, 2027, unless the base model shuts down earlier. Fine-tuned models remain available for inference until their base model shuts down.

The same guide says gpt-4.1-nano-2025-04-14 and its fine-tuned versions shut down on October 23, 2026. gpt-4.1-2025-04-14, gpt-4.1-mini-2025-04-14, and their fine-tuned versions shut down on January 14, 2027.

The training file is JSONL, one chat on each line, in the chat completions format, with at least 10 lines. The API model card for gpt-6.1-terra says the fine-tuning endpoint is not supported. See Supervised fine-tuning.

Cursor

The agent page and the models page do not document training or a fine-tune. You pick a model Cursor already hosts. See Models and pricing.

Grok

The models index does not mention fine-tuning. Grok Build’s command list has no fine-tune command. See the models index.

Details checked against each vendor’s documentation in November 2026.

A real example

This is one line from the OpenAI guide’s sample file. The sample is a weather tool call, and the file has to contain at least 10 lines:

{"messages":[{"role":"user","content":"What is the weather in San Francisco?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"San Francisco, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Francisco, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}

New users cannot start that job. The guide says so.

The path that does not depend on that platform is local. Language Model Builder is the Mac app, and the post walks through supervised fine-tuning on a small model. Build an LLM from scratch is the same idea from the training loop up.

When to use fine-tuning

Use it when one narrow format has to hold across many requests, and a few examples in the prompt are not enough. The OpenAI guide is for existing customers who can still create a job, on a base model that has not shut down.

For a fact the model never saw, a fine-tune on old examples does not add it. Read the file, or use RAG when the text lives in a collection. Open-weight models is the post on running weights yourself.

Pitfalls

A fine-tune is not a newer model. It is the base model, nudged toward your examples. If the base model shuts down, the guide says the fine-tune shuts down with it.

Ten lines is the file minimum in that guide. It is not a promise that the model learned the job. The guide’s own next step is to evaluate the result. Evals is that idea in the coding tools.

GPT-6.1 Terra cannot be fine-tuned through the endpoint on its model card. A job against a model whose card says the endpoint is not supported will not run.

  • Training data: Training data is what a model learned from, and it stops at a cutoff. Dates on the Grok 4.7, GPT-6.1 Terra and Claude cards, and how an agent reads your repo.
  • RAG: RAG fetches relevant passages and puts them in the prompt so the model answers from those passages. How that differs from search in the coding agents.
  • Evals: An eval is a fixed prompt, a real agent run, and a check you can repeat. How Claude Code, Codex, Cursor and the Grok API score that run.

All AI glossary entries →

Want me to talk about your product? You can sponsor this site.