Training Jobs
Create training job
Creates a training job with the specified configuration.
POST
/
v1
/
training_projects
/
{training_project_id}
/
jobs
cURL
curl --request POST \
--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"training_job": {
"image": {
"base_image": "hello-world",
"docker_auth": null
},
"compute": {
"node_count": 1,
"cpu_count": 1,
"memory": "2Gi",
"accelerator": {
"accelerator": "H100",
"count": 2
},
"availability_model": "spot"
},
"runtime": {
"start_commands": [
"python main.py"
],
"environment_variables": {
"API_KEY": "your_api_key_here",
"PATH": "/usr/bin"
},
"enable_cache": true,
"cache_config": {
"enable_legacy_hf_mount": true,
"enabled": true,
"mount_base_path": "/root/.cache",
"require_cache_affinity": true
},
"checkpointing_config": {
"enabled": true,
"checkpoint_path": "/mnt/ckpts",
"volume_size_gib": 10
},
"load_checkpoint_config": null
},
"name": "gpt-oss-job",
"truss_user_env": null,
"interactive_session": null,
"weights": [
{
"allow_patterns": null,
"auth": null,
"auth_secret_name": null,
"ignore_patterns": null,
"mount_location": "/app/models/base",
"source": "hf://meta-llama/Llama-3-8B@main"
}
],
"enable_baseten_workdir": false,
"priority": 0
}
}'{
"training_job": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"current_status": "<string>",
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"training_project_id": "<string>",
"training_project": {
"id": "<string>",
"name": "<string>"
},
"error_message": "<string>",
"name": "gpt-oss-job",
"priority": 0,
"availability_model": "dedicated",
"user": {
"email": "<string>"
}
}
}Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Path Parameters
Body
application/json
A request to create a training job.
The training job to create.
Show child attributes
Show child attributes
Response
200 - application/json
A response to creating a training job.
The created training job.
Show child attributes
Show child attributes
Was this page helpful?
Previous
Loops API referenceHTTP routes for Loops sessions, runs, samplers, checkpoints, and deployments.
Next
⌘I
cURL
curl --request POST \
--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"training_job": {
"image": {
"base_image": "hello-world",
"docker_auth": null
},
"compute": {
"node_count": 1,
"cpu_count": 1,
"memory": "2Gi",
"accelerator": {
"accelerator": "H100",
"count": 2
},
"availability_model": "spot"
},
"runtime": {
"start_commands": [
"python main.py"
],
"environment_variables": {
"API_KEY": "your_api_key_here",
"PATH": "/usr/bin"
},
"enable_cache": true,
"cache_config": {
"enable_legacy_hf_mount": true,
"enabled": true,
"mount_base_path": "/root/.cache",
"require_cache_affinity": true
},
"checkpointing_config": {
"enabled": true,
"checkpoint_path": "/mnt/ckpts",
"volume_size_gib": 10
},
"load_checkpoint_config": null
},
"name": "gpt-oss-job",
"truss_user_env": null,
"interactive_session": null,
"weights": [
{
"allow_patterns": null,
"auth": null,
"auth_secret_name": null,
"ignore_patterns": null,
"mount_location": "/app/models/base",
"source": "hf://meta-llama/Llama-3-8B@main"
}
],
"enable_baseten_workdir": false,
"priority": 0
}
}'{
"training_job": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"current_status": "<string>",
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"training_project_id": "<string>",
"training_project": {
"id": "<string>",
"name": "<string>"
},
"error_message": "<string>",
"name": "gpt-oss-job",
"priority": 0,
"availability_model": "dedicated",
"user": {
"email": "<string>"
}
}
}