Search
⌃K

Fine-tune

Start fine-tuning jobs to train a model on your dataset.
The following APIs can be used to fine-tune any model on the Forefront platform. For more information on fine-tuning, see our guide.

Upload dataset

Use the following cURL command to upload your dataset. The server will respond with the Dataset object. You will need to use the Dataset ID to start a fine-tuning job.
Example request
Example response
curl \
-F [email protected] http://beta-api.forefront.ai/api/upload/v1/{team_id}/datasets \
-H "Authorization: Bearer <api_key>"
{
"data":{
"id":"{dataset_id}",
"name":"dataset.jsonl",
"size":60626026,
"orgId":"{org_id}",
"createdBy":"6154b531eae00108bf4b4434",
"createdAt":"2022-08-04T19:18:18.084Z",
"numSamples":64679,
"validatedAt":"2022-08-04T19:18:22.944Z",
"issues":{
"errors":"0"
}
}
}

Get models

Next, you'll need to get the ID of the model that you want to fine-tune.
get
https://beta-api.forefront.ai
/api/v1/{team_id}/models/listPublic
Get models
Return a list of models and their associated IDs.
Parameters
Header
Authorization*
Bearer <YOUR_PLATFORM_KEY>
Platform keys can be found in Settings -> API Keys
Responses
200: OK
Models successfully returned.

Create fine-tuning job

Once you have your dataset and model ID, you can start a fine-tuning job.
get
https://beta-api.forefront.ai
/api/v1/{team_id}/fine-tune/create
Create fine-tuning job
Use your dataset and model ID to start a fine-tuning job.
Parameters
Header
Authorization*
String
Body
name*
String
A name for your fine-tuning job.
description
String
A description for your fine-tuning job.
modelId*
String
The ID of the model you want to fine-tune.
datasetId*
String
The dataset ID you want to use to fine-tune.
numEpochs*
Integer
Learn more about epochs.
numCheckpoints*
Integer
Learn more about checkpoints.
learningRateMultiplier
Number
Learn more about learning rate multiplier.
batchSize
Integer
Learn more about batch size.
promptLoss
Number
Learn more about prompt loss.
prompts*
Array of objects
Test prompts for your model checkpoints to provide completions for. It accepts an array of objects with each object being a valid Completions body. Learn more about test prompts.
Responses
200: OK
Fine-tuning job successfully started