Download OpenAPI specification:Download
The Intelligence Foundry REST API. Please see https://docs.crusoecloud.com/ for more details.
Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
required | string or Preset (string) The name of the model to fine-tune. You can select one of the supported models. |
| training_file required | string The ID of an uploaded file that contains training data. See upload file for how to upload a file. Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose The contents of the file should differ depending on if the model uses the chat, completions format, or if the fine-tuning method uses the preference format. See the fine-tuning guide for more details. |
object The hyperparameters used for the fine-tuning job.
This value is now deprecated in favor of | |
| suffix | string or null [ 1 .. 64 ] characters ^[a-zA-Z0-9][a-zA-Z0-9-]*$ A string of up to 64 characters that will be added to your fine-tuned model name. For example, a |
| validation_file | string or null The ID of an uploaded file that contains validation data. If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. The same data should not be present in both train and validation files. Your dataset must be formatted as a JSONL file. You must upload your file with the purpose See the fine-tuning guide for more details. |
| seed | integer or null [ 0 .. 2147483647 ] The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed is not specified, one will be generated for you. |
object (FineTuneMethod) The method used for fine-tuning. Only | |
(object or null) or (object or null) (Metadata) Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. |
{- "model": "gpt-4o-mini",
- "training_file": "file-abc123",
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto"
}, - "suffix": "string",
- "validation_file": "file-abc123",
- "seed": 42,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto",
- "lora_variant": "lora",
- "lora_rank": 2,
- "lora_alpha": 1,
- "lora_dropout": 1,
- "early_stopping_patience": 1,
- "warmup_ratio": 1,
- "learning_rate": "auto",
- "weight_decay": 0,
- "top_k_gating": 1,
- "checkpoint_steps": 20,
- "eval_steps_per_epoch": 1,
- "overlong_row_behavior": "error",
- "lr_scheduler": "cosine"
}
}
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}
}{- "id": "string",
- "created_at": 0,
- "error": {
- "code": "string",
- "message": "string",
- "param": "string"
}, - "fine_tuned_model": "string",
- "finished_at": 0,
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto"
}, - "model": "string",
- "object": "fine_tuning.job",
- "organization_id": "string",
- "result_files": [
- "file-abc123"
], - "status": "validating_files",
- "trained_tokens": 0,
- "training_file": "string",
- "validation_file": "string",
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto",
- "lora_variant": "lora",
- "lora_rank": 2,
- "lora_alpha": 1,
- "lora_dropout": 1,
- "early_stopping_patience": 1,
- "warmup_ratio": 1,
- "learning_rate": "auto",
- "weight_decay": 0,
- "top_k_gating": 1,
- "checkpoint_steps": 20,
- "eval_steps_per_epoch": 1,
- "overlong_row_behavior": "error",
- "lr_scheduler": "cosine"
}
}
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}
}List your organization's fine-tuning jobs
| model | Array of strings Filter to jobs for these base model registry IDs. |
| suffix | Array of strings Filter to jobs with these suffixes. |
| status | Array of strings Items Enum: "validating_files" "queued" "running" "succeeded" "failed" "cancelled" Filter to jobs in these statuses. |
{- "data": [
- {
- "id": "string",
- "created_at": 0,
- "error": {
- "code": "string",
- "message": "string",
- "param": "string"
}, - "fine_tuned_model": "string",
- "finished_at": 0,
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto"
}, - "model": "string",
- "object": "fine_tuning.job",
- "organization_id": "string",
- "result_files": [
- "file-abc123"
], - "status": "validating_files",
- "trained_tokens": 0,
- "training_file": "string",
- "validation_file": "string",
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto",
- "lora_variant": "lora",
- "lora_rank": 2,
- "lora_alpha": 1,
- "lora_dropout": 1,
- "early_stopping_patience": 1,
- "warmup_ratio": 1,
- "learning_rate": "auto",
- "weight_decay": 0,
- "top_k_gating": 1,
- "checkpoint_steps": 20,
- "eval_steps_per_epoch": 1,
- "overlong_row_behavior": "error",
- "lr_scheduler": "cosine"
}
}
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}
}
], - "has_more": true,
- "object": "list"
}Get info about a fine-tuning job.
| fine_tuning_job_id required | string The ID of the fine-tuning job. |
{- "id": "string",
- "created_at": 0,
- "error": {
- "code": "string",
- "message": "string",
- "param": "string"
}, - "fine_tuned_model": "string",
- "finished_at": 0,
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto"
}, - "model": "string",
- "object": "fine_tuning.job",
- "organization_id": "string",
- "result_files": [
- "file-abc123"
], - "status": "validating_files",
- "trained_tokens": 0,
- "training_file": "string",
- "validation_file": "string",
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto",
- "lora_variant": "lora",
- "lora_rank": 2,
- "lora_alpha": 1,
- "lora_dropout": 1,
- "early_stopping_patience": 1,
- "warmup_ratio": 1,
- "learning_rate": "auto",
- "weight_decay": 0,
- "top_k_gating": 1,
- "checkpoint_steps": 20,
- "eval_steps_per_epoch": 1,
- "overlong_row_behavior": "error",
- "lr_scheduler": "cosine"
}
}
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}
}List checkpoints for a fine-tuning job.
| fine_tuning_job_id required | string The ID of the fine-tuning job to get checkpoints for. |
| after | string Identifier for the last checkpoint ID from the previous pagination request. |
| limit | integer Default: 10 Number of checkpoints to retrieve. |
{- "data": [
- {
- "id": "string",
- "created_at": 0,
- "fine_tuned_model_checkpoint": "string",
- "step_number": 0,
- "metrics": {
- "step": 0,
- "train_loss": 0,
- "train_mean_token_accuracy": 0,
- "valid_loss": 0,
- "valid_mean_token_accuracy": 0,
- "full_valid_loss": 0,
- "full_valid_mean_token_accuracy": 0
}, - "fine_tuning_job_id": "string",
- "object": "fine_tuning.job.checkpoint",
- "fine_tuned_model_id": null
}
], - "object": "list",
- "first_id": "string",
- "last_id": "string",
- "has_more": true
}Immediately cancel a fine-tune job.
| fine_tuning_job_id required | string The ID of the fine-tuning job to cancel. |
{- "id": "string",
- "created_at": 0,
- "error": {
- "code": "string",
- "message": "string",
- "param": "string"
}, - "fine_tuned_model": "string",
- "finished_at": 0,
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto"
}, - "model": "string",
- "object": "fine_tuning.job",
- "organization_id": "string",
- "result_files": [
- "file-abc123"
], - "status": "validating_files",
- "trained_tokens": 0,
- "training_file": "string",
- "validation_file": "string",
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "batch_size": "auto",
- "learning_rate_multiplier": "auto",
- "n_epochs": "auto",
- "lora_variant": "lora",
- "lora_rank": 2,
- "lora_alpha": 1,
- "lora_dropout": 1,
- "early_stopping_patience": 1,
- "warmup_ratio": 1,
- "learning_rate": "auto",
- "weight_decay": 0,
- "top_k_gating": 1,
- "checkpoint_steps": 20,
- "eval_steps_per_epoch": 1,
- "overlong_row_behavior": "error",
- "lr_scheduler": "cosine"
}
}
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}
}Get status updates for a fine-tuning job.
| fine_tuning_job_id required | string The ID of the fine-tuning job to get events for. |
| after | string Identifier for the last event from the previous pagination request. |
| limit | integer Default: 20 Number of events to retrieve. |
{- "data": [
- {
- "object": "fine_tuning.job.event",
- "id": "string",
- "created_at": 0,
- "level": "info",
- "message": "string",
- "type": "message",
- "data": { }
}
], - "object": "list",
- "has_more": true
}Get time-series training metrics for a fine-tuning job.
| fine_tuning_job_id required | string The ID of the fine-tuning job to get metrics for. |
| metric_names | Array of strings Items Enum: "ev_loss" "ev_eval_loss" "ev_current_step" "ev_total_steps" "ev_learning_rate" "ev_grad_norm" "ev_num_input_tokens_seen" "ev_eval_samples_per_second" "ev_eval_steps_per_second" "ev_estimated_finish" "ev_train_loss" "ev_train_runtime" "ev_train_samples_per_second" "ev_train_steps_per_second" "ev_train_tokens_per_second" "ev_total_flos" Filter to specific metric names. |
| cursor | string Epoch timestamp cursor for pagination. |
| step | string Step duration for aggregation (e.g. 1m, 30s). |
| x_axis | string Enum: "timestamp" "step_count" X-axis type for returned data points (default timestamp). |
{- "object": "fine_tuning.job.metrics",
- "fine_tuning_job_id": "string",
- "x_axis": "timestamp",
- "metrics": [
- {
- "metric_name": "ev_loss",
- "data": [
- {
- "x": 0,
- "value": 0
}
]
}
]
}Returns a list of files.
| purpose | string Only return files with the given purpose. |
| limit | integer Default: 10000 A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. |
| order | string Default: "desc" Enum: "asc" "desc" Sort order by the |
| after | string A cursor for use in pagination. |
{- "object": "list",
- "data": [
- {
- "id": "string",
- "bytes": 0,
- "created_at": 0,
- "expires_at": 0,
- "filename": "string",
- "object": "file",
- "purpose": "assistants",
- "status": "uploaded",
- "status_details": "string",
- "is_cmek_encrypted": false
}
], - "first_id": "file-abc123",
- "last_id": "file-abc456",
- "has_more": false
}Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 1 TB.
.jsonl files. The input also has
certain required formats for fine-tuning
chat or
completions models..jsonl files up to 200 MB in size. The input
also has a specific required
format.Please contact us if you need to increase these storage limits.
| file required | string <binary> The File object (not file name) to be uploaded. |
| purpose required | string (FilePurpose) Enum: "fine-tune" "batch" The intended purpose of the file. Supported values are |
object (File expiration policy) The expiration policy for a file. By default, files with |
{- "id": "string",
- "bytes": 0,
- "created_at": 0,
- "expires_at": 0,
- "filename": "string",
- "object": "file",
- "purpose": "assistants",
- "status": "uploaded",
- "status_details": "string",
- "is_cmek_encrypted": false
}Returns information about a specific file.
| file_id required | string The ID of the file to use for this request. |
{- "id": "string",
- "bytes": 0,
- "created_at": 0,
- "expires_at": 0,
- "filename": "string",
- "object": "file",
- "purpose": "assistants",
- "status": "uploaded",
- "status_details": "string",
- "is_cmek_encrypted": false
}Lists the currently available models, and provides basic information about each one such as the owner and availability.
{- "object": "list",
- "data": [
- {
- "id": "admin-model-abc123",
- "object": "model",
- "owned_by": "org-123",
- "model_source": "huggingface",
- "model_name": "meta-llama/Llama-2-7b-hf",
- "model_revision": "main",
- "globally_available": false,
- "project_ids": [
- "proj-123"
], - "inference_available": true,
- "fine_tuning_available": false,
- "model_type": "base_model",
- "base_model_id": "model-abc123",
- "created": 1700000000
}
]
}Retrieves a model instance, providing basic information about the model such as the owner and availability.
| model required | string The encoded ID of the model (returned in the |
{- "id": "admin-model-abc123",
- "object": "model",
- "owned_by": "org-123",
- "model_source": "huggingface",
- "model_name": "meta-llama/Llama-2-7b-hf",
- "model_revision": "main",
- "globally_available": false,
- "project_ids": [
- "proj-123"
], - "inference_available": true,
- "fine_tuning_available": false,
- "model_type": "base_model",
- "base_model_id": "model-abc123",
- "created": 1700000000
}Delete a fine-tuned model owned by the caller's project. Refuses deletion of globally available models, models not solely owned by the caller's project, or models referenced by any non-terminal fine-tuning job in the project.
| model required | string The encoded ID of the model (returned in the |
{- "id": "string",
- "object": "model",
- "deleted": true
}Lists the currently available fine-tuning models without requiring authentication.
{- "object": "list",
- "data": [
- {
- "id": "admin-model-abc123",
- "object": "model",
- "owned_by": "org-123",
- "model_source": "huggingface",
- "model_name": "meta-llama/Llama-2-7b-hf",
- "model_revision": "main",
- "globally_available": false,
- "project_ids": [
- "proj-123"
], - "inference_available": true,
- "fine_tuning_available": false,
- "model_type": "base_model",
- "base_model_id": "model-abc123",
- "created": 1700000000
}
]
}