curl --request POST \
--url https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset": "<string>",
"evaluator": "<string>",
"displayName": "<string>",
"evaluationDataset": "<string>",
"evalAutoCarveout": true,
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": true
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": [
"<string>"
]
},
"wandbConfig": {
"enabled": true,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": {
"lambda": 123
}
},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}
'import requests
url = "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs"
payload = {
"dataset": "<string>",
"evaluator": "<string>",
"displayName": "<string>",
"evaluationDataset": "<string>",
"evalAutoCarveout": True,
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": True
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": ["<string>"]
},
"wandbConfig": {
"enabled": True,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": { "lambda": 123 }
},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset: '<string>',
evaluator: '<string>',
displayName: '<string>',
evaluationDataset: '<string>',
evalAutoCarveout: true,
trainingConfig: {
outputModel: '<string>',
baseModel: '<string>',
warmStartFrom: '<string>',
jinjaTemplate: '<string>',
learningRate: 123,
maxContextLength: 123,
loraRank: 123,
epochs: 123,
batchSize: 123,
gradientAccumulationSteps: 123,
learningRateWarmupSteps: 123,
batchSizeSamples: 123,
optimizerWeightDecay: 123,
trainerShardingScheme: {
tensorParallelism: 123,
pipelineParallelism: 123,
contextParallelism: 123,
expertParallelism: 123,
sequenceParallelism: true
},
loraAlpha: 123,
loraDropout: 123,
loraTargetModules: ['<string>']
},
wandbConfig: {
enabled: true,
apiKey: '<string>',
project: '<string>',
entity: '<string>',
runId: '<string>'
},
awsS3Config: {credentialsSecret: '<string>', iamRoleArn: '<string>'},
azureBlobStorageConfig: {
credentialsSecret: '<string>',
managedIdentityClientId: '<string>',
tenantId: '<string>'
},
inferenceParameters: {
maxOutputTokens: 123,
temperature: 123,
topP: 123,
responseCandidatesCount: 123,
extraBody: '<string>',
topK: 123
},
chunkSize: 123,
maxInferenceReplicaCount: 123,
nodeCount: 123,
lossConfig: {
method: 'METHOD_UNSPECIFIED',
klBeta: 123,
dpo: {beta: 123, refCacheConcurrency: 123, refCacheBatchSize: 123},
orpo: {lambda: 123}
},
maxConcurrentRollouts: 123,
maxConcurrentEvaluations: 123,
purpose: 'PURPOSE_UNSPECIFIED'
})
};
fetch('https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataset' => '<string>',
'evaluator' => '<string>',
'displayName' => '<string>',
'evaluationDataset' => '<string>',
'evalAutoCarveout' => true,
'trainingConfig' => [
'outputModel' => '<string>',
'baseModel' => '<string>',
'warmStartFrom' => '<string>',
'jinjaTemplate' => '<string>',
'learningRate' => 123,
'maxContextLength' => 123,
'loraRank' => 123,
'epochs' => 123,
'batchSize' => 123,
'gradientAccumulationSteps' => 123,
'learningRateWarmupSteps' => 123,
'batchSizeSamples' => 123,
'optimizerWeightDecay' => 123,
'trainerShardingScheme' => [
'tensorParallelism' => 123,
'pipelineParallelism' => 123,
'contextParallelism' => 123,
'expertParallelism' => 123,
'sequenceParallelism' => true
],
'loraAlpha' => 123,
'loraDropout' => 123,
'loraTargetModules' => [
'<string>'
]
],
'wandbConfig' => [
'enabled' => true,
'apiKey' => '<string>',
'project' => '<string>',
'entity' => '<string>',
'runId' => '<string>'
],
'awsS3Config' => [
'credentialsSecret' => '<string>',
'iamRoleArn' => '<string>'
],
'azureBlobStorageConfig' => [
'credentialsSecret' => '<string>',
'managedIdentityClientId' => '<string>',
'tenantId' => '<string>'
],
'inferenceParameters' => [
'maxOutputTokens' => 123,
'temperature' => 123,
'topP' => 123,
'responseCandidatesCount' => 123,
'extraBody' => '<string>',
'topK' => 123
],
'chunkSize' => 123,
'maxInferenceReplicaCount' => 123,
'nodeCount' => 123,
'lossConfig' => [
'method' => 'METHOD_UNSPECIFIED',
'klBeta' => 123,
'dpo' => [
'beta' => 123,
'refCacheConcurrency' => 123,
'refCacheBatchSize' => 123
],
'orpo' => [
'lambda' => 123
]
],
'maxConcurrentRollouts' => 123,
'maxConcurrentEvaluations' => 123,
'purpose' => 'PURPOSE_UNSPECIFIED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs"
payload := strings.NewReader("{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}"
response = http.request(request)
puts response.read_body{
"dataset": "<string>",
"evaluator": "<string>",
"name": "<string>",
"displayName": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"completedTime": "2023-11-07T05:31:56Z",
"evaluationDataset": "<string>",
"evalAutoCarveout": true,
"state": "JOB_STATE_UNSPECIFIED",
"status": {
"code": "OK",
"message": "<string>"
},
"createdBy": "<string>",
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": true
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": [
"<string>"
]
},
"wandbConfig": {
"enabled": true,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>",
"url": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"outputStats": "<string>",
"jobProgress": {
"percent": 123,
"epoch": 123,
"totalInputRequests": 123,
"totalProcessedRequests": 123,
"successfullyProcessedRequests": 123,
"failedRequests": 123,
"outputRows": 123,
"inputTokens": 123,
"outputTokens": 123,
"cachedInputTokenCount": 123
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"outputMetrics": "<string>",
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": {
"lambda": 123
}
},
"trainerLogsSignedUrl": "<string>",
"acceleratorSeconds": {},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}Create Reinforcement Fine-tuning Job
curl --request POST \
--url https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset": "<string>",
"evaluator": "<string>",
"displayName": "<string>",
"evaluationDataset": "<string>",
"evalAutoCarveout": true,
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": true
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": [
"<string>"
]
},
"wandbConfig": {
"enabled": true,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": {
"lambda": 123
}
},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}
'import requests
url = "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs"
payload = {
"dataset": "<string>",
"evaluator": "<string>",
"displayName": "<string>",
"evaluationDataset": "<string>",
"evalAutoCarveout": True,
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": True
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": ["<string>"]
},
"wandbConfig": {
"enabled": True,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": { "lambda": 123 }
},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset: '<string>',
evaluator: '<string>',
displayName: '<string>',
evaluationDataset: '<string>',
evalAutoCarveout: true,
trainingConfig: {
outputModel: '<string>',
baseModel: '<string>',
warmStartFrom: '<string>',
jinjaTemplate: '<string>',
learningRate: 123,
maxContextLength: 123,
loraRank: 123,
epochs: 123,
batchSize: 123,
gradientAccumulationSteps: 123,
learningRateWarmupSteps: 123,
batchSizeSamples: 123,
optimizerWeightDecay: 123,
trainerShardingScheme: {
tensorParallelism: 123,
pipelineParallelism: 123,
contextParallelism: 123,
expertParallelism: 123,
sequenceParallelism: true
},
loraAlpha: 123,
loraDropout: 123,
loraTargetModules: ['<string>']
},
wandbConfig: {
enabled: true,
apiKey: '<string>',
project: '<string>',
entity: '<string>',
runId: '<string>'
},
awsS3Config: {credentialsSecret: '<string>', iamRoleArn: '<string>'},
azureBlobStorageConfig: {
credentialsSecret: '<string>',
managedIdentityClientId: '<string>',
tenantId: '<string>'
},
inferenceParameters: {
maxOutputTokens: 123,
temperature: 123,
topP: 123,
responseCandidatesCount: 123,
extraBody: '<string>',
topK: 123
},
chunkSize: 123,
maxInferenceReplicaCount: 123,
nodeCount: 123,
lossConfig: {
method: 'METHOD_UNSPECIFIED',
klBeta: 123,
dpo: {beta: 123, refCacheConcurrency: 123, refCacheBatchSize: 123},
orpo: {lambda: 123}
},
maxConcurrentRollouts: 123,
maxConcurrentEvaluations: 123,
purpose: 'PURPOSE_UNSPECIFIED'
})
};
fetch('https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataset' => '<string>',
'evaluator' => '<string>',
'displayName' => '<string>',
'evaluationDataset' => '<string>',
'evalAutoCarveout' => true,
'trainingConfig' => [
'outputModel' => '<string>',
'baseModel' => '<string>',
'warmStartFrom' => '<string>',
'jinjaTemplate' => '<string>',
'learningRate' => 123,
'maxContextLength' => 123,
'loraRank' => 123,
'epochs' => 123,
'batchSize' => 123,
'gradientAccumulationSteps' => 123,
'learningRateWarmupSteps' => 123,
'batchSizeSamples' => 123,
'optimizerWeightDecay' => 123,
'trainerShardingScheme' => [
'tensorParallelism' => 123,
'pipelineParallelism' => 123,
'contextParallelism' => 123,
'expertParallelism' => 123,
'sequenceParallelism' => true
],
'loraAlpha' => 123,
'loraDropout' => 123,
'loraTargetModules' => [
'<string>'
]
],
'wandbConfig' => [
'enabled' => true,
'apiKey' => '<string>',
'project' => '<string>',
'entity' => '<string>',
'runId' => '<string>'
],
'awsS3Config' => [
'credentialsSecret' => '<string>',
'iamRoleArn' => '<string>'
],
'azureBlobStorageConfig' => [
'credentialsSecret' => '<string>',
'managedIdentityClientId' => '<string>',
'tenantId' => '<string>'
],
'inferenceParameters' => [
'maxOutputTokens' => 123,
'temperature' => 123,
'topP' => 123,
'responseCandidatesCount' => 123,
'extraBody' => '<string>',
'topK' => 123
],
'chunkSize' => 123,
'maxInferenceReplicaCount' => 123,
'nodeCount' => 123,
'lossConfig' => [
'method' => 'METHOD_UNSPECIFIED',
'klBeta' => 123,
'dpo' => [
'beta' => 123,
'refCacheConcurrency' => 123,
'refCacheBatchSize' => 123
],
'orpo' => [
'lambda' => 123
]
],
'maxConcurrentRollouts' => 123,
'maxConcurrentEvaluations' => 123,
'purpose' => 'PURPOSE_UNSPECIFIED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs"
payload := strings.NewReader("{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireworks.ai/v1/accounts/{account_id}/reinforcementFineTuningJobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset\": \"<string>\",\n \"evaluator\": \"<string>\",\n \"displayName\": \"<string>\",\n \"evaluationDataset\": \"<string>\",\n \"evalAutoCarveout\": true,\n \"trainingConfig\": {\n \"outputModel\": \"<string>\",\n \"baseModel\": \"<string>\",\n \"warmStartFrom\": \"<string>\",\n \"jinjaTemplate\": \"<string>\",\n \"learningRate\": 123,\n \"maxContextLength\": 123,\n \"loraRank\": 123,\n \"epochs\": 123,\n \"batchSize\": 123,\n \"gradientAccumulationSteps\": 123,\n \"learningRateWarmupSteps\": 123,\n \"batchSizeSamples\": 123,\n \"optimizerWeightDecay\": 123,\n \"trainerShardingScheme\": {\n \"tensorParallelism\": 123,\n \"pipelineParallelism\": 123,\n \"contextParallelism\": 123,\n \"expertParallelism\": 123,\n \"sequenceParallelism\": true\n },\n \"loraAlpha\": 123,\n \"loraDropout\": 123,\n \"loraTargetModules\": [\n \"<string>\"\n ]\n },\n \"wandbConfig\": {\n \"enabled\": true,\n \"apiKey\": \"<string>\",\n \"project\": \"<string>\",\n \"entity\": \"<string>\",\n \"runId\": \"<string>\"\n },\n \"awsS3Config\": {\n \"credentialsSecret\": \"<string>\",\n \"iamRoleArn\": \"<string>\"\n },\n \"azureBlobStorageConfig\": {\n \"credentialsSecret\": \"<string>\",\n \"managedIdentityClientId\": \"<string>\",\n \"tenantId\": \"<string>\"\n },\n \"inferenceParameters\": {\n \"maxOutputTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"responseCandidatesCount\": 123,\n \"extraBody\": \"<string>\",\n \"topK\": 123\n },\n \"chunkSize\": 123,\n \"maxInferenceReplicaCount\": 123,\n \"nodeCount\": 123,\n \"lossConfig\": {\n \"method\": \"METHOD_UNSPECIFIED\",\n \"klBeta\": 123,\n \"dpo\": {\n \"beta\": 123,\n \"refCacheConcurrency\": 123,\n \"refCacheBatchSize\": 123\n },\n \"orpo\": {\n \"lambda\": 123\n }\n },\n \"maxConcurrentRollouts\": 123,\n \"maxConcurrentEvaluations\": 123,\n \"purpose\": \"PURPOSE_UNSPECIFIED\"\n}"
response = http.request(request)
puts response.read_body{
"dataset": "<string>",
"evaluator": "<string>",
"name": "<string>",
"displayName": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"completedTime": "2023-11-07T05:31:56Z",
"evaluationDataset": "<string>",
"evalAutoCarveout": true,
"state": "JOB_STATE_UNSPECIFIED",
"status": {
"code": "OK",
"message": "<string>"
},
"createdBy": "<string>",
"trainingConfig": {
"outputModel": "<string>",
"baseModel": "<string>",
"warmStartFrom": "<string>",
"jinjaTemplate": "<string>",
"learningRate": 123,
"maxContextLength": 123,
"loraRank": 123,
"epochs": 123,
"batchSize": 123,
"gradientAccumulationSteps": 123,
"learningRateWarmupSteps": 123,
"batchSizeSamples": 123,
"optimizerWeightDecay": 123,
"trainerShardingScheme": {
"tensorParallelism": 123,
"pipelineParallelism": 123,
"contextParallelism": 123,
"expertParallelism": 123,
"sequenceParallelism": true
},
"loraAlpha": 123,
"loraDropout": 123,
"loraTargetModules": [
"<string>"
]
},
"wandbConfig": {
"enabled": true,
"apiKey": "<string>",
"project": "<string>",
"entity": "<string>",
"runId": "<string>",
"url": "<string>"
},
"awsS3Config": {
"credentialsSecret": "<string>",
"iamRoleArn": "<string>"
},
"azureBlobStorageConfig": {
"credentialsSecret": "<string>",
"managedIdentityClientId": "<string>",
"tenantId": "<string>"
},
"outputStats": "<string>",
"jobProgress": {
"percent": 123,
"epoch": 123,
"totalInputRequests": 123,
"totalProcessedRequests": 123,
"successfullyProcessedRequests": 123,
"failedRequests": 123,
"outputRows": 123,
"inputTokens": 123,
"outputTokens": 123,
"cachedInputTokenCount": 123
},
"inferenceParameters": {
"maxOutputTokens": 123,
"temperature": 123,
"topP": 123,
"responseCandidatesCount": 123,
"extraBody": "<string>",
"topK": 123
},
"chunkSize": 123,
"outputMetrics": "<string>",
"maxInferenceReplicaCount": 123,
"nodeCount": 123,
"lossConfig": {
"method": "METHOD_UNSPECIFIED",
"klBeta": 123,
"dpo": {
"beta": 123,
"refCacheConcurrency": 123,
"refCacheBatchSize": 123
},
"orpo": {
"lambda": 123
}
},
"trainerLogsSignedUrl": "<string>",
"acceleratorSeconds": {},
"maxConcurrentRollouts": 123,
"maxConcurrentEvaluations": 123,
"purpose": "PURPOSE_UNSPECIFIED"
}Authorizations
Bearer authentication using your Fireworks API key. Format: Bearer <API_KEY>
Path Parameters
The Account Id
Query Parameters
ID of the reinforcement fine-tuning job, a random UUID will be generated if not specified.
Body
The name of the dataset used for training.
The evaluator resource name to use for RLOR fine-tuning job.
The name of a separate dataset to use for evaluation.
Whether to auto-carve the dataset for eval.
Common training configurations.
Show child attributes
Show child attributes
The Weights & Biases team/user account for logging training progress.
Show child attributes
Show child attributes
The AWS configuration for S3 dataset access.
Show child attributes
Show child attributes
The Azure configuration for Blob Storage dataset access.
Show child attributes
Show child attributes
RFT inference parameters.
Show child attributes
Show child attributes
Data chunking for rollout, default size 200, enabled when dataset > 300. Valid range is 1-10,000.
The number of nodes to use for the fine-tuning job. If not specified, the default is 1.
Reinforcement learning loss method + hyperparameters for the underlying trainers.
Show child attributes
Show child attributes
Maximum number of concurrent rollouts during the RFT job.
Maximum number of concurrent evaluations during the RFT job.
Scheduling purpose for this job.
PURPOSE_UNSPECIFIED, PURPOSE_PILOT Response
A successful response.
The name of the dataset used for training.
The evaluator resource name to use for RLOR fine-tuning job.
The completed time for the reinforcement fine-tuning job.
The name of a separate dataset to use for evaluation.
Whether to auto-carve the dataset for eval.
JobState represents the state an asynchronous job can be in.
- JOB_STATE_PAUSED: Job is paused, typically due to account suspension or manual intervention.
- JOB_STATE_DELETED: Job has been deleted.
JOB_STATE_UNSPECIFIED, JOB_STATE_CREATING, JOB_STATE_RUNNING, JOB_STATE_COMPLETED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_DELETING, JOB_STATE_WRITING_RESULTS, JOB_STATE_VALIDATING, JOB_STATE_DELETING_CLEANING_UP, JOB_STATE_PENDING, JOB_STATE_EXPIRED, JOB_STATE_RE_QUEUEING, JOB_STATE_CREATING_INPUT_DATASET, JOB_STATE_IDLE, JOB_STATE_CANCELLING, JOB_STATE_EARLY_STOPPED, JOB_STATE_PAUSED, JOB_STATE_DELETED Show child attributes
Show child attributes
The email address of the user who initiated this fine-tuning job.
Common training configurations.
Show child attributes
Show child attributes
The Weights & Biases team/user account for logging training progress.
Show child attributes
Show child attributes
The AWS configuration for S3 dataset access.
Show child attributes
Show child attributes
The Azure configuration for Blob Storage dataset access.
Show child attributes
Show child attributes
The output dataset's aggregated stats for the evaluation job.
Job progress.
Show child attributes
Show child attributes
RFT inference parameters.
Show child attributes
Show child attributes
Data chunking for rollout, default size 200, enabled when dataset > 300. Valid range is 1-10,000.
The number of nodes to use for the fine-tuning job. If not specified, the default is 1.
Reinforcement learning loss method + hyperparameters for the underlying trainers.
Show child attributes
Show child attributes
The signed URL for the trainer logs file (stdout/stderr). Only populated if the account has trainer log reading enabled.
Accelerator seconds used by the job, keyed by accelerator type (e.g., "NVIDIA_H100_80GB"). Updated when job completes or is cancelled.
Show child attributes
Show child attributes
Maximum number of concurrent rollouts during the RFT job.
Maximum number of concurrent evaluations during the RFT job.
Scheduling purpose for this job.
PURPOSE_UNSPECIFIED, PURPOSE_PILOT Was this page helpful?