Skip to main content
API Reference: POST /fine_tuning/jobs

Provider capabilities

The table below summarizes gateway support for this endpoint by provider.
Legend:
  • Supported by Provider and Truefoundry
  • Provided by provider, but not by Truefoundry
  • Provider does not support this feature
For every gateway endpoint and provider, see Supported APIs. This guide explains how to fine-tune models using TrueFoundry’s AI Gateway with OpenAI or Vertex AI providers.

Client Setup

All providers use the OpenAI SDK with provider-specific headers. Choose your provider to get started:

Training File Format

Create a JSONL file with one JSON object per line. Each line represents a conversation pair for training:

Workflow Steps

The finetuning process follows these steps for all providers:
  1. Upload: Upload training file → Get file ID
  2. Create: Create finetune job → Get job ID
  3. Monitor: Check status until complete
  4. Use: Use the fine-tuned model for inference

Step-by-Step Examples

Status Reference

  • queued: Job is queued and waiting to start
  • running: Fine-tuning is in progress
  • succeeded: Fine-tuning completed successfully
  • failed: Fine-tuning failed

Hyperparameters

You can configure the following hyperparameters in the hyperparameters object:
  • n_epochs: Number of training epochs
  • batch_size: Batch size
  • learning_rate_multiplier: Learning rate multiplier