Fine-tune a model
Klu can submit a Dataset to a connected model provider, track training progress, and expose the resulting model for evaluation. Fine-tuning is available only for providers and models supported by your workspace connection.
Before you begin
You need:
- an App with a training Dataset
- enough data points to meet the minimum shown in the form
- a provider connection that uses your provider API key
- a base model that the selected provider allows you to fine-tune
The available providers and base models depend on your workspace connection, provider account, and region. Choose from the options shown after selecting a provider connection.
Prepare the Dataset
Open Logs, filter or select high-quality generations, and select Save Dataset. Choose a training split or Optimize (80/20) if you also want held-out evaluation items.
Open the Dataset from Datasets and review every item. Correct outputs that do not represent the target behavior, remove unusable rows, and confirm that the Dataset has enough items. A larger clean Dataset is generally more useful than one padded with duplicates or low-quality examples.
Start the fine-tune
- Open the App and select Finetune in the sidebar.
- Select Fine-tune Model.
- Choose Finetune Provider. If no eligible connection exists, select Connect LLM Provider and add your provider credential.
- Choose the Dataset and Base Model.
- Enter Fine-tune Name. For OpenAI jobs, the UI enforces a maximum of 18 characters.
- Optionally enter Override System Message.
- Review the estimated training cost and select Submit.
You can also start from an individual Dataset page by selecting Fine-tune Model. Klu submits the request and lists it under Finetune; submission does not mean training has completed.
Monitor the job
Open the fine-tune from Finetune to inspect its event history, Dataset, base model, provider job state, and resulting model name. Provider jobs can remain queued or validating before training begins. They can also fail or be cancelled because of provider validation, account access, quota, region, or training-data requirements.
Wait until Klu shows that the fine-tune succeeded before using the resulting model. A displayed estimated cost is based on Dataset tokens and model assumptions; the provider's final charge is authoritative.
Evaluate the result
Use a held-out Dataset that was not used to train the model. Create an Eval under Evaluate, select the same evaluators used for your baseline, and compare the fine-tuned Action version with the original. Review item-level failures as well as aggregate pass rates before changing production traffic.
SDK support
Create fine-tunes in the Klu UI. After a fine-tune exists, use the SDK examples below to read its status.
After a job exists, both SDKs can read its status asynchronously:
Read fine-tune status
import asyncio
from klu import Klu
async def main() -> None:
klu = Klu("YOUR_API_KEY")
status = await klu.finetune.read_status("YOUR_FINETUNE_GUID")
print(status.status)
asyncio.run(main())
Treat the fine-tune as pending until its status shows that it succeeded or failed.