diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Cancel.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Cancel.json new file mode 100644 index 000000000000..7b32e8ad0bd3 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Cancel.json @@ -0,0 +1,53 @@ +{ + "title": "Cancel a FineTuning job", + "operationId": "FineTuningJobs_Cancel", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "cancelling", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Create.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Create.json new file mode 100644 index 000000000000..4364e6ea8edb --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Create.json @@ -0,0 +1,81 @@ +{ + "title": "Create FineTuning job", + "operationId": "FineTuningJobs_Create", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fineTuningJob": { + "model": "gpt-4o-mini-2024-07-18", + "training_file": "FileId-1", + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + }, + "seed": 123, + "validation_file": "FileId-2" + } + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "running", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Delete.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Delete.json new file mode 100644 index 000000000000..5007a9848e22 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "Delete FineTuning job", + "operationId": "FineTuningJobs_Delete", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_FailedJob.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_FailedJob.json new file mode 100644 index 000000000000..4584b3dc008d --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_FailedJob.json @@ -0,0 +1,58 @@ +{ + "title": "Retrieve a failed FineTuning job", + "operationId": "FineTuningJobs_Get", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "failed", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "failed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + }, + "error": { + "code": "400", + "message": "Training file should be chat or completion for supervised finetune.", + "param": "training file" + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_SuccessfulJob.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_SuccessfulJob.json new file mode 100644 index 000000000000..871b82187b00 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Get_SuccessfulJob.json @@ -0,0 +1,55 @@ +{ + "title": "Retrieve a successful FineTuning job", + "operationId": "FineTuningJobs_Get", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "succeeded", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "fine_tuned_model": "gpt-4o-mini-2024-07-18.ftjob-1", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListCheckpoints.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListCheckpoints.json new file mode 100644 index 000000000000..31f374180fd0 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListCheckpoints.json @@ -0,0 +1,37 @@ +{ + "title": "List the checkpoints from a FineTuning jobs", + "operationId": "FineTuningJobs_ListCheckpoints", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.checkpoint", + "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P", + "created_at": "2025-01-01T10:00:00.00Z", + "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88", + "fine_tuning_job_id": "ftjob-1", + "metrics": { + "step": 88, + "train_loss": 0.478, + "train_mean_token_accuracy": 0.924, + "valid_loss": 10.112, + "valid_mean_token_accuracy": 0.145, + "full_valid_loss": 0.567, + "full_valid_mean_token_accuracy": 0.944 + }, + "step_number": 88 + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListEvents.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListEvents.json new file mode 100644 index 000000000000..371b0f724944 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListEvents.json @@ -0,0 +1,27 @@ +{ + "title": "List the events from a FineTuning jobs", + "operationId": "FineTuningJobs_ListEvents", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.event", + "created_at": "2025-01-01T10:00:00.00Z", + "id": "ftevent-1", + "level": "info", + "message": "job started" + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListJobs.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListJobs.json new file mode 100644 index 000000000000..262c507c2b40 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_ListJobs.json @@ -0,0 +1,61 @@ +{ + "title": "List FineTuning jobs", + "operationId": "FineTuningJobs_List", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "succeeded", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "fine_tuned_model": "gpt-4o-mini-2024-07-18.ftjob-1", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Pause.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Pause.json new file mode 100644 index 000000000000..63bc8fe8a9e7 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Pause.json @@ -0,0 +1,53 @@ +{ + "title": "Pause a FineTuning job", + "operationId": "FineTuningJobs_Pause", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "pausing", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Resume.json b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Resume.json new file mode 100644 index 000000000000..4a649dc6c96d --- /dev/null +++ b/specification/ai/Azure.AI.Projects/examples/2025-05-15-preview/FineTuningJobs_Resume.json @@ -0,0 +1,53 @@ +{ + "title": "Resume a FineTuning job", + "operationId": "FineTuningJobs_Resume", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "running", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/Azure.AI.Projects/fine_tuning/models.tsp b/specification/ai/Azure.AI.Projects/fine_tuning/models.tsp new file mode 100644 index 000000000000..76cc3d0090cb --- /dev/null +++ b/specification/ai/Azure.AI.Projects/fine_tuning/models.tsp @@ -0,0 +1,922 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@azure-tools/typespec-autorest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "../common/models.tsp"; +import "../main.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Versioning; + +namespace Azure.AI.Projects; + +// +// OAI SFT fine-tuning +// + +@doc("The hyper parameter settings used in Supervised Fine-Tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model SupervisedHyperparametersParam { + @doc("Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.") + batch_size?: int32; + + @doc("Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.") + learning_rate_multiplier?: int32; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + n_epochs?: int32; +} + +@doc("Supervised Fine-Tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model SupervisedMethodParam { + @doc("The hyperparameters used for the SFT fine-tuning job.") + hyperparameters?: SupervisedHyperparametersParam; +} + +// +// OAI DPO fine-tuning +// + +@doc("The hyper parameter settings used in Direct Preference Optimization fine-tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model DpoHyperparametersParam { + @doc("Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.") + batch_size?: int32; + + @doc("The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.") + beta?: float64; + + @doc("Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.") + learning_rate_multiplier?: float64; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + n_epochs?: int32; +} + +@doc("Configuration for the Direct Preference Optimization fine-tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model DpoMethodParam { + @doc("The hyperparameters used for the DPO fine-tuning job.") + hyperparameters?: DpoHyperparametersParam; +} + +// +// OAI RFT fine-tuning +// + +// RFT graders + +@doc("The grader used for RFT fine-tuning. Abstract base class") +@discriminator("type") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningGrader { + @doc("The grader type.") + type: string; +} + +@doc("String operations used in RFT string check grader") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union FineTuningStringOperation { + string, + + @doc("Equal operator") + eq: "eq", + + @doc("Not equal operator") + ne: "ne", + + @doc("Like operator") + like: "like", + + @doc("Not like operator") + ilike: "ilike", +} + +@doc("A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model StringCheckGraderParam extends FineTuningGrader { + type: "string_check"; + + @doc("The input text. This may include template strings.") + input: string; + + @doc("The name of the grader.") + name: string; + + @doc("The string check operation to perform. One of eq, ne, like, or ilike.") + operation: FineTuningStringOperation; + + @doc("The reference text. This may include template strings.") + reference: string; +} + +@doc("The evaluation metric to use in RFT text similarity grader") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union FineTuningEvaluationMetric { + string, + + @doc("bleu") + bleu: "bleu", + + @doc("fuzzy_match") + fuzzy_match: "fuzzy_match", + + @doc("gleu") + gleu: "gleu", + + @doc("meteor") + meteor: "meteor", + + @doc("rouge_1") + rouge_1: "rouge_1", + + @doc("rouge_2") + rouge_2: "rouge_2", + + @doc("rouge_3") + rouge_3: "rouge_3", + + @doc("rouge_4") + rouge_4: "rouge_4", + + @doc("rouge_5") + rouge_5: "rouge_5", + + @doc("rouge_l") + rouge_l: "rouge_l", + + @doc("cosine") + cosine: "cosine", +} + +@doc("ScoreModelGrader uses a model to assign a score to the input.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model TextSimilarityGraderParam extends FineTuningGrader { + type: "text_similarity"; + + @doc("The evaluation metric to use") + evaluation_metric: FineTuningEvaluationMetric; + + @doc("The text being graded.") + input: string; + + @doc("The name of the grader.") + name: string; + + @doc("The text being graded against.") + reference: string; + + @doc("TBD") + pass_threshold?: float64; +} + +@doc("A PythonGrader object that runs a python script on the input.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model PythonGraderParam extends FineTuningGrader { + type: "python"; + + @doc("The name of the grader.") + name: string; + + @doc("The source code of the python script.") + source: string; + + @doc("The image tag to use for the python script.") + image_tag?: string; +} + +@doc("Training RFT message role options.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union FineTuningJobGraderMessageRole { + string, + + @doc("doc message role") + user: "user", + + @doc("system message role") + system: "system", + + @doc("developer message role") + developer: "developer", + + @doc("assistant message role") + assistant: "assistant", +} + +@doc("Base for inputs to the model.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model InputContent {} + +@doc("Inputs to the model - can contain template strings.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ResponseInputTextParam is InputContent { + @doc("The type of the input item. Always `input_text`") + type: "input_text"; + + @doc("The text input to the model.") + text: string; +} + +@doc("Inputs to the model - can contain template strings.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model InputSimpleContent is InputContent { + @doc("content field") + content: string; +} + +@doc("Inputs to the model - can contain template strings.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model InputContentOutputText is InputContent { + @doc("The type of the output text. Always `output_text`.") + type: "output_text"; + + @doc("The text output from the model.") + text: string; +} + +@doc("A ScoreModelGrader object that uses a model to assign a score to the input.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model Input { + @doc("Message type") + type: string; + + @doc("Message role") + role: FineTuningJobGraderMessageRole; + + @doc("Message content") + content: InputContent; +} + +@doc("The sampling parameters for the model.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union FineTuningJobGraderReasoningEffort { + string, + + @doc("Low reasoning effort") + low: "low", + + @doc("Medium reasoning effort") + medium: "medium", + + @doc("High reasoning effort") + high: "high", +} + +@doc("The sampling parameters for the model.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobGraderModelSamplingParam { + @doc("Seed parameter") + seed?: int32; + + @doc("Temperature parameter") + temperature?: float64; + + @doc("Max completions tokens parameter") + max_completions_tokens?: int32; + + @doc("Top parameter") + top_p?: float64; + + @doc("Reasoning effort parameter") + reasoning_effort?: FineTuningJobGraderReasoningEffort; +} + +@doc("A ScoreModelGrader object that uses a model to assign a score to the input.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ScoreModelGraderParam extends FineTuningGrader { + type: "score_model"; + + @doc("The input text. This may include template strings.") + input: Array; + + @doc("The model to use for the evaluation.") + `model`: string; + + @doc("The name of the grader.") + name: string; + + @doc("The model to use for the evaluation.") + range?: Array; + + @doc("The sampling parameters for the model.") + sampling_params?: FineTuningJobGraderModelSamplingParam; + + @doc("TBD") + pass_threshold?: float64; +} + +@doc("A MultiGrader object combines the output of multiple graders to produce a single score.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model MultiGraderParam extends FineTuningGrader { + type: "multi"; + + @doc("A formula to calculate the output based on grader results.") + calculate_output: string; + + @doc("Graders to be combined") + graders: Record; + + @doc("The name of the grader.") + name: string; +} + +@doc("A LabelModelGrader object which uses a model to assign labels to each item in the evaluation.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningLabelModelGrader extends FineTuningGrader { + type: "label_model"; + + @doc("input labels") + input: Array; + + @doc("The labels to assign to each item in the evaluation.") + labels: Array; + + @doc("The model to use for the evaluation. Must support structured outputs.") + `model`: string; + + @doc("The name of the grader.") + name: string; + + @doc("The labels that indicate a passing result. Must be a subset of labels.") + passing_labels: Array; +} + +// RFT graders end + +@doc("Configuration for the Reinforcement fine-tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ReinforcementHyperparametersParam { + @doc("Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.") + batch_size?: int32; + + @doc("Multiplier on amount of compute used for exploring search space during training.") + compute_multiplier?: float64; + + @doc("The number of training steps between evaluation runs.") + eval_interval?: int32; + + @doc("Number of evaluation samples to generate per training step.") + eval_samples?: int32; + + @doc("Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.") + learning_rate_multiplier?: float64; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + n_epochs?: int32; + + @doc("Level of reasoning effort.") + reasoning_effort?: string; +} + +@doc("Gets the response format for the Reinforcement fine-tuning method.") +@discriminator("type") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ReinforcementResponseFormat { + @doc("Response format request - Currently only JSON schema is supported") + type: string; +} + +@doc("Gets the response format for the Reinforcement fine-tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ReinforcementResponseJsonSchema extends ReinforcementResponseFormat { + type: "json_schema"; + + @doc("JSON schema response for RFT") + json_schema: Record; +} + +@doc("Configuration for the Reinforcement fine-tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model ReinforcementMethodParam { + @doc("The grader used for the fine-tuning job.") + grader: FineTuningGrader; + + @doc("The hyperparameters used for the reinforcement fine-tuning job.") + hyperparameters?: ReinforcementHyperparametersParam; + + @doc("Gets the response format for the Reinforcement fine-tuning job.") + response_format?: ReinforcementResponseFormat; +} + +////////////////// + +// +// Mistral Completion fine-tuning +// + +@doc("The hyper parameter settings used in Mistral Completion Fine-Tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model MistralCompletionHyperParameters { + @doc("The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.") + training_steps?: int32; + + @doc("A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.") + learning_rate?: float64 = 0.0001; + + @doc("(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.") + weight_decay?: float64 = 0.1; + + @doc("(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to pct_start in mistral-finetune") + warmup_fraction?: float64 = 0.05; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + epochs?: int32; + + @doc("Seq len parameter") + seq_len?: int32; + + @doc("Fim ratio parameter") + fim_ratio?: float64; +} + +@doc("Mistral Completion Fine-Tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model MistralCompletionParam { + @doc("Mistral Completion fine-tuning type") + type: "mistral_completion"; + + @doc("The hyperparameters used for the Mistral Completion fine-tuning job.") + hyperparameters?: MistralCompletionHyperParameters; +} + +////////////////// + +// +// Mistral Classifier fine-tuning +// + +@doc("The hyper parameter settings used in Mistral Classifier Fine-Tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model MistralClassifierHyperparametersParam { + @doc("The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.") + training_steps?: int32; + + @doc("A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.") + learning_rate?: float64 = 0.0001; + + @doc("(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.") + weight_decay?: float64 = 0.1; + + @doc("(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to pct_start in mistral-finetune") + warmup_fraction?: float64 = 0.05; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + epochs?: int32; + + @doc("Seq len parameter") + seq_len?: int32; +} + +@doc("Mistral Classifier Fine-Tuning method.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model MistralClassifierMethodParam { + @doc("Mistral Classifier fine-tuning type") + type: "mistral_classifier"; + + @doc("The hyperparameters used for the Mistral Classifier fine-tuning job.") + hyperparameters?: MistralClassifierHyperparametersParam; +} + +////////////////// + +@doc("For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobError { + @doc("A machine-readable error code.") + code?: string; + + @doc("A human-readable error message.") + message?: string; + + @doc("The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.") + param?: string; +} + +// +// Fine-tuning integration with W&B +// + +@doc("The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model IntegrationWandb { + @doc("The name of the project that the new run will be created under.") + project: string; + + @doc("The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used.") + entity?: string; + + @doc("A display name to set for the run. If not set, we will use the Job ID as the name.") + name?: string; + + @doc("A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: 'openai/finetune', 'openai/{base-model}', 'openai/{ftjob}.") + tags?: Array; +} + +@doc("Integration to enable for fine-tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model Integration { + @doc("The type of integration to enable. Currently, only 'wandb' (Weights and Biases) is supported.") + type: string; + + @doc("The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.") + wandb: IntegrationWandb; +} + +@doc("The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobWandbIntegration { + @doc("The name of the project that the new run will be created under.") + project: string; + + @doc("The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used.") + entity?: string; + + @doc("A display name to set for the run. If not set, we will use the Job ID as the name.") + name?: string; + + @doc("A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: 'openai/finetune', 'openai/{base-model}', 'openai/{ftjob}.") + tags?: Array; +} + +@doc("Integration to enable for fine-tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobWandbIntegrationObject { + @doc("The type of integration to enable. Currently, only 'wandb' (Weights and Biases) is supported.") + type: string; + + @doc("The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.") + wandb: FineTuningJobWandbIntegration; +} + +// Fine-tuning integration with W&B ends + +// Training method + +@doc("Training method types") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union MethodTrainingType { + string, + + @doc("Supervised fine-tuning type") + supervised: "supervised", + + @doc("DPO fine-tuning type") + dpo: "dpo", + + @doc("Reinforcement fine-tuning type") + reinforcement: "reinforcement", + + @doc("Mistral Completion fine-tuning type") + mistral_completion: "mistral_completion", + + @doc("Mistral Classifier fine-tuning type") + mistral_classifier: "mistral_classifier", +} + +@doc("The method used for fine-tuning.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model Method { + @doc("The type of training method.") + type: MethodTrainingType; + + @doc("Configuration for the supervised fine-tuning method.") + supervised?: SupervisedMethodParam; + + @doc("Configuration for the DPO fine-tuning method.") + dpo?: DpoMethodParam; + + @doc("Configuration for the reinforcement fine-tuning method.") + reinforcement?: ReinforcementMethodParam; + + @doc("Configuration for the Mistral Classifier fine-tuning method.") + mistral_classifier?: MistralClassifierMethodParam; + + @doc("Configuration for the Mistral Completion fine-tuning method.") + mistral_completion?: MistralCompletionParam; +} + +@doc("The hyperparameters used for the fine-tuning job. This value is now deprecated sin favor of `method`, and should be passed in under the `method` parameter.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model Hyperparameters { + @doc("Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.") + batch_size?: int32; + + @doc("Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.") + learning_rate_multiplier?: int32; + + @doc("The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.") + n_epochs?: int32; +} + +// +// Fine-Tuning job +// + +@doc("Fine-Tuning Job") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJob { + @doc("The job identifier.") + id: string; + + @doc("The object type, which is always 'fine_tuning.job'.") + object: string = "fine_tuning.job"; + + @doc("The time when the fine-tuning job was created.") + created_at: utcDateTime; + + @doc("For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.") + error?: FineTuningJobError; + + @doc("The time when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.") + estimated_finish?: utcDateTime; + + @doc("The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.") + fine_tuned_model?: string; + + @doc("The time when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.") + finished_at?: utcDateTime; + + @doc("The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs") + hyperparameters?: Hyperparameters; + + @doc("A list of integrations to enable for this fine-tuning job.") + integrations?: Array; + + /** + * 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. + */ + metadata?: Record; + + @doc("The method used for fine-tuning.") + method: Method; + + @doc("The base model that is being fine-tuned.") + `model`: string; + + @doc("The organization that owns the fine-tuning job.") + organization_id: string; + + @doc("The compiled results file ID(s) for the fine-tuning job. The file is only available for successfully completed fine-tune runs.") + result_files?: Array; + + @doc("The seed used for the fine-tuning job.") + seed: int32; + + @doc("The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.") + status: string; + + @doc("The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.") + trained_tokens?: int32; + + @doc("The file ID used for training. You can retrieve the training data with the Files API.") + training_file: string; + + @doc("The file ID used for validation. You can retrieve the validation results with the Files API.") + validation_file?: string; + + @doc("The additional 1P parameters used to train the fine-tuned model. This is Azure AI specific parameter.") + additional_Parameters?: Record; + + @doc("A string of up to 64 characters that will be added to your fine-tuned model name.") + suffix?: string; + + @doc("The SKU used for training. This is Azure AI specific parameter") + training_type?: TrainingType; + + @doc("Inference configurations. This is Azure AI specific parameter") + inference_configs?: InferenceConfigs; +} + +@doc("SKU available for training") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union TrainingType { + string, + + @doc("Standard training job uses dedicated training capacity in a region") + Standard: "Standard", + + @doc("GlobalStandard training job uses dedicated capacity from a different region") + GlobalStandard: "GlobalStandard", + + @doc("DeveloperTier training job uses inference capacity when available") + DeveloperTier: "DeveloperTier", +} + +@doc("SKU available for training") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +union InferenceSku { + string, + + @doc("DeveloperTier refers to a cross-region developer inference sku.") + DeveloperTier: "DeveloperTier", + + @doc("Standard refers to regional pay-go inference sku.") + Standard: "Standard", + + @doc("Global Standard refers to a cross-region pay-go inference sku.") + GlobalStandard: "GlobalStandard", +} + +@doc("Inference configurations") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model InferenceConfigs { + @doc("Is model deployed after tuning completes") + auto_inference_enabled?: boolean; + + @doc("SKU used for inference") + inference_sku?: InferenceSku; + + @doc("Deployment identifier") + auto_deployment_id?: string; + + @doc("Deployment status") + auto_deployment_status?: string; + + @doc("Deployment error information") + auto_deployment_error_message?: string; +} + +// +// Fine-Tuning job definition for create +// + +@doc("Fine-Tuning Job") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model JobCreateParams { + @doc("The base model that is being fine-tuned.") + `model`: string; + + @doc("The file ID used for training. You can retrieve the training data with the Files API.") + training_file: string; + + @doc("The hyperparameters used for the SFT fine-tuning job. This value is now deprecated in favor of method, and should be passed in under the method parameter.") + hyperparameters?: Hyperparameters; + + @doc("A list of integrations to enable for this fine-tuning job.") + integrations?: Array; + + /** + * 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. + */ + metadata?: Record; + + @doc("The method used for fine-tuning.") + method: Method; + + @doc("The seed used for the fine-tuning job.") + seed: int32; + + @doc("A string of up to 64 characters that will be added to your fine-tuned model name.") + suffix?: string; + + @doc("The file ID used for validation. You can retrieve the validation results with the Files API.") + validation_file?: string; + + @doc("The SKU used for training. This is Azure AI specific parameter") + training_type?: TrainingType; + + @doc("Inference configurations. This is Azure AI specific parameter") + inference_configs?: InferenceConfigs; +} + +@doc("The response data for a requested list of items.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningPaginatedResponse { + @doc("Response type") + object: string = "list"; + + @doc("Items list.") + @pageItems + data: Array; + + @doc("A value indicating whether there are additional values available.") + has_more: boolean; +} + +@doc("Fine-tuning job event object.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobEvent { + @doc("The object type, which is always fine_tuning.job.event") + object: string = "fine_tuning.job.event"; + + @doc("The time when the fine-tuning event was created.") + created_at: utcDateTime; + + #suppress "@azure-tools/typespec-azure-core/no-unknown" + @doc("The data associated with the event.") + data?: unknown; + + @doc("The object identifier.") + id: string; + + @doc("The log level of the event.") + level: string; + + @doc("The message of the event.") + message: string; + + @doc("The type of event.") + type?: string; +} + +@doc("Metrics at the step number during the fine-tuning job.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobCheckpointMetric { + @doc("metric full validation loss") + full_valid_loss?: float64; + + @doc("metric full valid mean token accuracy") + full_valid_mean_token_accuracy?: float64; + + @doc("metric step") + step?: float64; + + @doc("metric train loss") + train_loss?: float64; + + @doc("metric train mean token accuracy") + train_mean_token_accuracy?: float64; + + @doc("metric valid loss") + valid_loss?: float64; + + @doc("metric valid mean token accuracy") + valid_mean_token_accuracy?: float64; +} + +@doc("The fine_tuning.job.checkpoint object represents a model checkpoint for a fine-tuning job that is ready to use.") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +model FineTuningJobCheckpoint { + @doc("The object type, which is always fine_tuning.job.checkpoint") + object: string = "fine_tuning.job.checkpoint"; + + @doc("The time when the fine-tuning checkpoint was created.") + created_at: utcDateTime; + + @doc("The name of the fine-tuned checkpoint model that is created.") + fine_tuned_model_checkpoint: string; + + @doc("The name of the fine-tuning job that this checkpoint was created from.") + fine_tuning_job_id: string; + + @doc("The checkpoint identifier, which can be referenced in the API endpoints.") + id: string; + + @doc("Metrics at the step number during the fine-tuning job.") + metrics: FineTuningJobCheckpointMetric; + + @doc("The step number that the checkpoint was created at.") + step_number: int32; +} diff --git a/specification/ai/Azure.AI.Projects/fine_tuning/routes.tsp b/specification/ai/Azure.AI.Projects/fine_tuning/routes.tsp new file mode 100644 index 000000000000..32d5926d2a0b --- /dev/null +++ b/specification/ai/Azure.AI.Projects/fine_tuning/routes.tsp @@ -0,0 +1,165 @@ +import "@typespec/rest"; +import "@azure-tools/typespec-autorest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "./models.tsp"; +import "../servicepatterns.tsp"; + +using TypeSpec.Http; +using Azure.Core.Traits; +using TypeSpec.Versioning; +using Azure.Core.Foundations; + +namespace Azure.AI.Projects; + +@route("fine_tuning/jobs") +@added(Versions.v2025_05_15_preview) +@removed(Versions.v1) +interface FineTuningJobs { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Get info about a fine-tuning job.") + get is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + }, + FineTuningJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Returns a list of finetune jobs") + @get + @list + list is Azure.Core.Foundations.Operation< + { + @doc("Identifier for the last job from the previous pagination request.") + @query + after?: string; + + @doc("Number of fine-tuning jobs to retrieve.") + @query + limit?: int32 = 20; + + @doc("Optional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata.") + @query + metadata?: string; + }, + FineTuningPaginatedResponse + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Creates a fine-tuning job.") + @post + create is Azure.Core.Foundations.Operation< + { + @doc("fine-tuning job") + @body + fineTuningJob: JobCreateParams; + }, + FineTuningJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Cancel a fine-tune job.") + @post + @route("/{fine_tuning_job_id}/cancel") + cancel is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to cancel.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + }, + FineTuningJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Pause a fine-tune job.") + @post + @route("/{fine_tuning_job_id}/pause") + pause is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to pause.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + }, + FineTuningJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Resume a fine-tune job.") + @post + @route("/{fine_tuning_job_id}/resume") + resume is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to resume.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + }, + FineTuningJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Delete a fine-tune job.") + @delete + @route("/{fine_tuning_job_id}") + delete is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to delete.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + }, + Http.NoContentResponse + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Get status updates for a fine-tuning job.") + @get + @list + @route("/{fine_tuning_job_id}/events") + listEvents is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to get events for.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + + @doc("Identifier for the last event from the previous pagination request.") + @query + after?: string; + + @doc("Number of events to retrieve.") + @query + limit?: int32 = 20; + }, + FineTuningPaginatedResponse + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("List checkpoints for a fine-tuning job.") + @get + @list + @route("/{fine_tuning_job_id}/checkpoints") + listCheckpoints is Azure.Core.Foundations.Operation< + { + @doc("The ID of the fine-tuning job to get events for.") + @path + @maxLength(1024) + fine_tuning_job_id: string; + + @doc("Identifier for the last checkpoint from the previous pagination request.") + @query + after?: string; + + @doc("Number of checkpoints to retrieve.") + @query + limit?: int32 = 10; + }, + FineTuningPaginatedResponse + >; +} diff --git a/specification/ai/Azure.AI.Projects/main.tsp b/specification/ai/Azure.AI.Projects/main.tsp index 3f845adfda0e..f02f60746166 100644 --- a/specification/ai/Azure.AI.Projects/main.tsp +++ b/specification/ai/Azure.AI.Projects/main.tsp @@ -9,6 +9,7 @@ import "./datasets/routes.tsp"; import "./indexes/routes.tsp"; import "./deployments/routes.tsp"; import "./red-teams/routes.tsp"; +import "./fine_tuning/routes.tsp"; using TypeSpec.Http; using TypeSpec.Versioning; diff --git a/specification/ai/cspell.yaml b/specification/ai/cspell.yaml index 57b70ec4ca59..5c6edb8a7e4f 100644 --- a/specification/ai/cspell.yaml +++ b/specification/ai/cspell.yaml @@ -104,3 +104,15 @@ overrides: - rerank - wandb - webp + - filename: '**/specification/ai/Azure.AI.Projects/fine_tuning/**/*.*' + words: + - ilike + - ftjob + - wandb + - gleu + - filename: '**/specification/ai/data-plane/Azure.AI.Projects/**/*.*' + words: + - ilike + - ftjob + - wandb + - gleu \ No newline at end of file diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects.json index cb475d40c91b..3ae26d4828c5 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects.json @@ -1092,20 +1092,67 @@ } } }, - "/indexes": { + "/fine_tuning/jobs": { "get": { - "operationId": "Indexes_ListLatest", - "description": "List the latest version of each Index", + "operationId": "FineTuningJobs_List", + "description": "Returns a list of finetune jobs", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "after", + "in": "query", + "description": "Identifier for the last job from the previous pagination request.", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of fine-tuning jobs to retrieve.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "metadata", + "in": "query", + "description": "Optional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata.", + "required": false, + "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedIndex" + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "Response type", + "default": "list" + }, + "data": { + "type": "array", + "description": "Items list.", + "items": { + "$ref": "#/definitions/FineTuningJob" + } + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available." + } + }, + "required": [ + "object", + "data", + "has_more" + ] } }, "default": { @@ -1122,39 +1169,33 @@ } }, "x-ms-examples": { - "Indexes_ListLatest_MaximumSet": { - "$ref": "./examples/Indexes_ListLatest_MaximumSet_Gen.json" - }, - "Indexes_ListLatest_MinimumSet": { - "$ref": "./examples/Indexes_ListLatest_MinimumSet_Gen.json" + "List FineTuning jobs": { + "$ref": "./examples/FineTuningJobs_ListJobs.json" } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" } - } - }, - "/indexes/{name}/versions": { - "get": { - "operationId": "Indexes_ListVersions", - "description": "List all versions of the given Index", + }, + "post": { + "operationId": "FineTuningJobs_Create", + "description": "Creates a fine-tuning job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", - "in": "path", - "description": "The name of the resource", + "name": "fineTuningJob", + "in": "body", + "description": "fine-tuning job", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/JobCreateParams" + } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedIndex" + "$ref": "#/definitions/FineTuningJob" } }, "default": { @@ -1171,46 +1212,34 @@ } }, "x-ms-examples": { - "Indexes_ListVersions_MaximumSet": { - "$ref": "./examples/Indexes_ListVersions_MaximumSet_Gen.json" - }, - "Indexes_ListVersions_MinimumSet": { - "$ref": "./examples/Indexes_ListVersions_MinimumSet_Gen.json" + "Create FineTuning job": { + "$ref": "./examples/FineTuningJobs_Create.json" } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" } } }, - "/indexes/{name}/versions/{version}": { + "/fine_tuning/jobs/{fine_tuning_job_id}": { "get": { - "operationId": "Indexes_GetVersion", - "description": "Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist.", + "operationId": "FineTuningJobs_Get", + "description": "Get info about a fine-tuning job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", - "in": "path", - "description": "The name of the resource", - "required": true, - "type": "string" - }, - { - "name": "version", + "name": "fine_tuning_job_id", "in": "path", - "description": "The specific version id of the Index to retrieve.", + "description": "The ID of the fine-tuning job.", "required": true, - "type": "string" + "type": "string", + "maxLength": 1024 } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/Index" + "$ref": "#/definitions/FineTuningJob" } }, "default": { @@ -1227,59 +1256,76 @@ } }, "x-ms-examples": { - "Indexes_GetVersion_MaximumSet": { - "$ref": "./examples/Indexes_GetVersion_MaximumSet_Gen.json" + "Retrieve a failed FineTuning job": { + "$ref": "./examples/FineTuningJobs_Get_FailedJob.json" }, - "Indexes_GetVersion_MinimumSet": { - "$ref": "./examples/Indexes_GetVersion_MinimumSet_Gen.json" + "Retrieve a successful FineTuning job": { + "$ref": "./examples/FineTuningJobs_Get_SuccessfulJob.json" } } }, - "patch": { - "operationId": "Indexes_CreateOrUpdateVersion", - "description": "Create a new or update an existing Index with the given version id", - "consumes": [ - "application/merge-patch+json" - ], + "delete": { + "operationId": "FineTuningJobs_Delete", + "description": "Delete a fine-tune job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", + "name": "fine_tuning_job_id", "in": "path", - "description": "The name of the resource", + "description": "The ID of the fine-tuning job to delete.", "required": true, - "type": "string" + "type": "string", + "maxLength": 1024 + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful." }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Delete FineTuning job": { + "$ref": "./examples/FineTuningJobs_Delete.json" + } + } + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": { + "post": { + "operationId": "FineTuningJobs_Cancel", + "description": "Cancel a fine-tune job.", + "parameters": [ { - "name": "version", - "in": "path", - "description": "The specific version id of the Index to create or update.", - "required": true, - "type": "string" + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "index", - "in": "body", - "description": "The Index to create or update.", + "name": "fine_tuning_job_id", + "in": "path", + "description": "The ID of the fine-tuning job to cancel.", "required": true, - "schema": { - "$ref": "#/definitions/Index" - } + "type": "string", + "maxLength": 1024 } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/Index" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/Index" + "$ref": "#/definitions/FineTuningJob" } }, "default": { @@ -1296,39 +1342,75 @@ } }, "x-ms-examples": { - "Indexes_CreateOrUpdateVersion_MaximumSet": { - "$ref": "./examples/Indexes_CreateOrUpdateVersion_MaximumSet_Gen.json" - }, - "Indexes_CreateOrUpdateVersion_MinimumSet": { - "$ref": "./examples/Indexes_CreateOrUpdateVersion_MinimumSet_Gen.json" + "Cancel a FineTuning job": { + "$ref": "./examples/FineTuningJobs_Cancel.json" } } - }, - "delete": { - "operationId": "Indexes_DeleteVersion", - "description": "Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist.", + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": { + "get": { + "operationId": "FineTuningJobs_ListCheckpoints", + "description": "List checkpoints for a fine-tuning job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", + "name": "fine_tuning_job_id", "in": "path", - "description": "The name of the resource", + "description": "The ID of the fine-tuning job to get events for.", "required": true, - "type": "string" + "type": "string", + "maxLength": 1024 }, { - "name": "version", - "in": "path", - "description": "The version of the Index to delete.", - "required": true, + "name": "after", + "in": "query", + "description": "Identifier for the last checkpoint from the previous pagination request.", + "required": false, "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of checkpoints to retrieve.", + "required": false, + "type": "integer", + "format": "int32", + "default": 10 } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful." + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "Response type", + "default": "list" + }, + "data": { + "type": "array", + "description": "Items list.", + "items": { + "$ref": "#/definitions/FineTuningJobCheckpoint" + } + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available." + } + }, + "required": [ + "object", + "data", + "has_more" + ] + } }, "default": { "description": "An unexpected error response.", @@ -1344,39 +1426,74 @@ } }, "x-ms-examples": { - "Indexes_DeleteVersion_MaximumSet": { - "$ref": "./examples/Indexes_DeleteVersion_MaximumSet_Gen.json" - }, - "Indexes_DeleteVersion_MinimumSet": { - "$ref": "./examples/Indexes_DeleteVersion_MinimumSet_Gen.json" + "List the checkpoints from a FineTuning jobs": { + "$ref": "./examples/FineTuningJobs_ListCheckpoints.json" } } } }, - "/redTeams/runs": { + "/fine_tuning/jobs/{fine_tuning_job_id}/events": { "get": { - "operationId": "RedTeams_List", - "description": "List a redteam by name.", + "operationId": "FineTuningJobs_ListEvents", + "description": "Get status updates for a fine-tuning job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + "name": "fine_tuning_job_id", + "in": "path", + "description": "The ID of the fine-tuning job to get events for.", + "required": true, + "type": "string", + "maxLength": 1024 + }, + { + "name": "after", + "in": "query", + "description": "Identifier for the last event from the previous pagination request.", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of events to retrieve.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedRedTeam" - }, - "headers": { - "x-ms-client-request-id": { - "type": "string", - "format": "uuid", - "description": "An opaque, globally-unique, client-generated string identifier for the request." - } + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "Response type", + "default": "list" + }, + "data": { + "type": "array", + "description": "Items list.", + "items": { + "$ref": "#/definitions/FineTuningJobEvent" + } + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available." + } + }, + "required": [ + "object", + "data", + "has_more" + ] } }, "default": { @@ -1393,46 +1510,34 @@ } }, "x-ms-examples": { - "RedTeams_List_MaximumSet": { - "$ref": "./examples/RedTeams_List_MaximumSet_Gen.json" + "List the events from a FineTuning jobs": { + "$ref": "./examples/FineTuningJobs_ListEvents.json" } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" } } }, - "/redTeams/runs/{name}": { - "get": { - "operationId": "RedTeams_Get", - "description": "Get a redteam by name.", + "/fine_tuning/jobs/{fine_tuning_job_id}/pause": { + "post": { + "operationId": "FineTuningJobs_Pause", + "description": "Pause a fine-tune job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", + "name": "fine_tuning_job_id", "in": "path", - "description": "Identifier of the red team run.", + "description": "The ID of the fine-tuning job to pause.", "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + "type": "string", + "maxLength": 1024 } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/RedTeam" - }, - "headers": { - "x-ms-client-request-id": { - "type": "string", - "format": "uuid", - "description": "An opaque, globally-unique, client-generated string identifier for the request." - } + "$ref": "#/definitions/FineTuningJob" } }, "default": { @@ -1449,35 +1554,34 @@ } }, "x-ms-examples": { - "RedTeams_Get_MaximumSet": { - "$ref": "./examples/RedTeams_Get_MaximumSet_Gen.json" + "Pause a FineTuning job": { + "$ref": "./examples/FineTuningJobs_Pause.json" } } } }, - "/redTeams/runs:run": { + "/fine_tuning/jobs/{fine_tuning_job_id}/resume": { "post": { - "operationId": "RedTeams_Create", - "description": "Creates a redteam run.", + "operationId": "FineTuningJobs_Resume", + "description": "Resume a fine-tune job.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "RedTeam", - "in": "body", - "description": "Redteam to be run", + "name": "fine_tuning_job_id", + "in": "path", + "description": "The ID of the fine-tuning job to resume.", "required": true, - "schema": { - "$ref": "#/definitions/RedTeam" - } + "type": "string", + "maxLength": 1024 } ], "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", + "200": { + "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/RedTeam" + "$ref": "#/definitions/FineTuningJob" } }, "default": { @@ -1494,23 +1598,431 @@ } }, "x-ms-examples": { - "RedTeams_Create_MaximumSet": { - "$ref": "./examples/RedTeams_Create_MaximumSet_Gen.json" - }, - "RedTeams_Create_MinimumSet": { - "$ref": "./examples/RedTeams_Create_MinimumSet_Gen.json" + "Resume a FineTuning job": { + "$ref": "./examples/FineTuningJobs_Resume.json" } } } - } - }, - "definitions": { - "AgentEvaluation": { - "type": "object", - "description": "Evaluation response for agent evaluation run.", - "properties": { - "id": { - "type": "string", + }, + "/indexes": { + "get": { + "operationId": "Indexes_ListLatest", + "description": "List the latest version of each Index", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedIndex" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_ListLatest_MaximumSet": { + "$ref": "./examples/Indexes_ListLatest_MaximumSet_Gen.json" + }, + "Indexes_ListLatest_MinimumSet": { + "$ref": "./examples/Indexes_ListLatest_MinimumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/indexes/{name}/versions": { + "get": { + "operationId": "Indexes_ListVersions", + "description": "List all versions of the given Index", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedIndex" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_ListVersions_MaximumSet": { + "$ref": "./examples/Indexes_ListVersions_MaximumSet_Gen.json" + }, + "Indexes_ListVersions_MinimumSet": { + "$ref": "./examples/Indexes_ListVersions_MinimumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/indexes/{name}/versions/{version}": { + "get": { + "operationId": "Indexes_GetVersion", + "description": "Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the Index to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_GetVersion_MaximumSet": { + "$ref": "./examples/Indexes_GetVersion_MaximumSet_Gen.json" + }, + "Indexes_GetVersion_MinimumSet": { + "$ref": "./examples/Indexes_GetVersion_MinimumSet_Gen.json" + } + } + }, + "patch": { + "operationId": "Indexes_CreateOrUpdateVersion", + "description": "Create a new or update an existing Index with the given version id", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the Index to create or update.", + "required": true, + "type": "string" + }, + { + "name": "index", + "in": "body", + "description": "The Index to create or update.", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_CreateOrUpdateVersion_MaximumSet": { + "$ref": "./examples/Indexes_CreateOrUpdateVersion_MaximumSet_Gen.json" + }, + "Indexes_CreateOrUpdateVersion_MinimumSet": { + "$ref": "./examples/Indexes_CreateOrUpdateVersion_MinimumSet_Gen.json" + } + } + }, + "delete": { + "operationId": "Indexes_DeleteVersion", + "description": "Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The version of the Index to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_DeleteVersion_MaximumSet": { + "$ref": "./examples/Indexes_DeleteVersion_MaximumSet_Gen.json" + }, + "Indexes_DeleteVersion_MinimumSet": { + "$ref": "./examples/Indexes_DeleteVersion_MinimumSet_Gen.json" + } + } + } + }, + "/redTeams/runs": { + "get": { + "operationId": "RedTeams_List", + "description": "List a redteam by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedRedTeam" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "RedTeams_List_MaximumSet": { + "$ref": "./examples/RedTeams_List_MaximumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/redTeams/runs/{name}": { + "get": { + "operationId": "RedTeams_Get", + "description": "Get a redteam by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "Identifier of the red team run.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RedTeam" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "RedTeams_Get_MaximumSet": { + "$ref": "./examples/RedTeams_Get_MaximumSet_Gen.json" + } + } + } + }, + "/redTeams/runs:run": { + "post": { + "operationId": "RedTeams_Create", + "description": "Creates a redteam run.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "RedTeam", + "in": "body", + "description": "Redteam to be run", + "required": true, + "schema": { + "$ref": "#/definitions/RedTeam" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/RedTeam" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "RedTeams_Create_MaximumSet": { + "$ref": "./examples/RedTeams_Create_MaximumSet_Gen.json" + }, + "RedTeams_Create_MinimumSet": { + "$ref": "./examples/RedTeams_Create_MinimumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "AgentEvaluation": { + "type": "object", + "description": "Evaluation response for agent evaluation run.", + "properties": { + "id": { + "type": "string", "description": "Identifier of the agent evaluation run." }, "status": { @@ -1930,20 +2442,247 @@ } } }, - "AzureAISearchIndex": { + "AzureAISearchIndex": { + "type": "object", + "description": "Azure AI Search Index Definition", + "properties": { + "connectionName": { + "type": "string", + "description": "Name of connection to Azure AI Search", + "x-ms-mutability": [ + "create" + ] + }, + "indexName": { + "type": "string", + "description": "Name of index in Azure AI Search resource to attach", + "x-ms-mutability": [ + "create" + ] + }, + "fieldMapping": { + "$ref": "#/definitions/FieldMapping", + "description": "Field mapping configuration", + "x-ms-mutability": [ + "create" + ] + } + }, + "required": [ + "connectionName", + "indexName" + ], + "allOf": [ + { + "$ref": "#/definitions/Index" + } + ], + "x-ms-discriminator-value": "AzureSearch" + }, + "AzureOpenAIModelConfiguration": { + "type": "object", + "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.", + "properties": { + "modelDeploymentName": { + "type": "string", + "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)." + } + }, + "required": [ + "modelDeploymentName" + ], + "allOf": [ + { + "$ref": "#/definitions/TargetConfig" + } + ], + "x-ms-discriminator-value": "AzureOpenAIModel" + }, + "BaseCredentials": { + "type": "object", + "description": "A base class for connection credentials", + "properties": { + "type": { + "$ref": "#/definitions/CredentialType", + "description": "The type of credential used by the connection", + "readOnly": true + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "BlobReference": { + "type": "object", + "description": "Blob reference details.", + "properties": { + "blobUri": { + "type": "string", + "description": "Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path" + }, + "storageAccountArmId": { + "type": "string", + "description": "ARM ID of the storage account to use." + }, + "credential": { + "$ref": "#/definitions/SasCredential", + "description": "Credential info to access the storage account." + } + }, + "required": [ + "blobUri", + "storageAccountArmId", + "credential" + ] + }, + "Connection": { + "type": "object", + "description": "Response from the list and get connections operations", + "properties": { + "name": { + "type": "string", + "description": "The friendly name of the connection, provided by the user.", + "readOnly": true + }, + "id": { + "type": "string", + "description": "A unique identifier for the connection, generated by the service", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/ConnectionType", + "description": "Category of the connection", + "readOnly": true + }, + "target": { + "type": "string", + "description": "The connection URL to be used for this service", + "readOnly": true + }, + "isDefault": { + "type": "boolean", + "description": "Whether the connection is tagged as the default connection of its type", + "readOnly": true + }, + "credentials": { + "$ref": "#/definitions/BaseCredentials", + "description": "The credentials used by the connection", + "readOnly": true + }, + "metadata": { + "type": "object", + "description": "Metadata of the connection", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + } + }, + "required": [ + "name", + "id", + "type", + "target", + "isDefault", + "credentials", + "metadata" + ] + }, + "ConnectionType": { + "type": "string", + "description": "The Type (or category) of the connection", + "enum": [ + "AzureOpenAI", + "AzureBlob", + "AzureStorageAccount", + "CognitiveSearch", + "CosmosDB", + "ApiKey", + "AppConfig", + "AppInsights", + "CustomKeys" + ], + "x-ms-enum": { + "name": "ConnectionType", + "modelAsString": true, + "values": [ + { + "name": "AzureOpenAI", + "value": "AzureOpenAI", + "description": "Azure OpenAI Service" + }, + { + "name": "AzureBlobStorage", + "value": "AzureBlob", + "description": "Azure Blob Storage, with specified container" + }, + { + "name": "AzureStorageAccount", + "value": "AzureStorageAccount", + "description": "Azure Blob Storage, with container not specified (used by Agents)" + }, + { + "name": "AzureAISearch", + "value": "CognitiveSearch", + "description": "Azure AI Search" + }, + { + "name": "CosmosDB", + "value": "CosmosDB", + "description": "CosmosDB" + }, + { + "name": "APIKey", + "value": "ApiKey", + "description": "Generic connection that uses API Key authentication" + }, + { + "name": "ApplicationConfiguration", + "value": "AppConfig", + "description": "Application Configuration" + }, + { + "name": "ApplicationInsights", + "value": "AppInsights", + "description": "Application Insights" + }, + { + "name": "Custom", + "value": "CustomKeys", + "description": "Custom Keys" + } + ] + } + }, + "CosmosDBIndex": { "type": "object", - "description": "Azure AI Search Index Definition", + "description": "CosmosDB Vector Store Index Definition", "properties": { "connectionName": { "type": "string", - "description": "Name of connection to Azure AI Search", + "description": "Name of connection to CosmosDB", "x-ms-mutability": [ "create" ] }, - "indexName": { + "databaseName": { "type": "string", - "description": "Name of index in Azure AI Search resource to attach", + "description": "Name of the CosmosDB Database", + "x-ms-mutability": [ + "create" + ] + }, + "containerName": { + "type": "string", + "description": "Name of CosmosDB Container", + "x-ms-mutability": [ + "create" + ] + }, + "embeddingConfiguration": { + "$ref": "#/definitions/EmbeddingConfiguration", + "description": "Embedding model configuration", "x-ms-mutability": [ "create" ] @@ -1958,683 +2697,1084 @@ }, "required": [ "connectionName", - "indexName" + "databaseName", + "containerName", + "embeddingConfiguration", + "fieldMapping" ], "allOf": [ { "$ref": "#/definitions/Index" } ], - "x-ms-discriminator-value": "AzureSearch" + "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" }, - "AzureOpenAIModelConfiguration": { + "CredentialType": { + "type": "string", + "description": "The credential type used by the connection", + "enum": [ + "ApiKey", + "AAD", + "SAS", + "CustomKeys", + "None" + ], + "x-ms-enum": { + "name": "CredentialType", + "modelAsString": true, + "values": [ + { + "name": "apiKey", + "value": "ApiKey", + "description": "API Key credential" + }, + { + "name": "entraId", + "value": "AAD", + "description": "Entra ID credential (formerly known as AAD)" + }, + { + "name": "SAS", + "value": "SAS", + "description": "Shared Access Signature (SAS) credential" + }, + { + "name": "custom", + "value": "CustomKeys", + "description": "Custom credential" + }, + { + "name": "None", + "value": "None", + "description": "No credential" + } + ] + } + }, + "CustomCredential": { "type": "object", - "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.", + "description": "Custom credential definition", "properties": { - "modelDeploymentName": { - "type": "string", - "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)." + "keys": { + "type": "object", + "description": "The credential type", + "additionalProperties": { + "type": "string" + }, + "readOnly": true } }, "required": [ - "modelDeploymentName" + "keys" ], "allOf": [ { - "$ref": "#/definitions/TargetConfig" + "$ref": "#/definitions/BaseCredentials" } ], - "x-ms-discriminator-value": "AzureOpenAIModel" + "x-ms-discriminator-value": "CustomKeys" }, - "BaseCredentials": { - "type": "object", - "description": "A base class for connection credentials", - "properties": { - "type": { - "$ref": "#/definitions/CredentialType", - "description": "The type of credential used by the connection", - "readOnly": true - } - }, - "discriminator": "type", - "required": [ - "type" - ] + "DatasetType": { + "type": "string", + "description": "Enum to determine the type of data.", + "enum": [ + "uri_file", + "uri_folder" + ], + "x-ms-enum": { + "name": "DatasetType", + "modelAsString": true, + "values": [ + { + "name": "uri_file", + "value": "uri_file", + "description": "URI file." + }, + { + "name": "uri_folder", + "value": "uri_folder", + "description": "URI folder." + } + ] + } }, - "BlobReference": { + "DatasetVersion": { "type": "object", - "description": "Blob reference details.", + "description": "DatasetVersion Definition", "properties": { - "blobUri": { + "dataUri": { "type": "string", - "description": "Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path" + "description": "URI of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330", + "minLength": 1, + "pattern": "[a-zA-Z0-9_]", + "x-ms-mutability": [ + "read", + "create" + ] }, - "storageAccountArmId": { - "type": "string", - "description": "ARM ID of the storage account to use." + "type": { + "$ref": "#/definitions/DatasetType", + "description": "Dataset type" }, - "credential": { - "$ref": "#/definitions/SasCredential", - "description": "Credential info to access the storage account." - } - }, - "required": [ - "blobUri", - "storageAccountArmId", - "credential" - ] - }, - "Connection": { - "type": "object", - "description": "Response from the list and get connections operations", - "properties": { - "name": { - "type": "string", - "description": "The friendly name of the connection, provided by the user.", + "isReference": { + "type": "boolean", + "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted", "readOnly": true }, - "id": { + "connectionName": { "type": "string", - "description": "A unique identifier for the connection, generated by the service", - "readOnly": true + "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset", + "x-ms-mutability": [ + "read", + "create" + ] }, - "type": { - "$ref": "#/definitions/ConnectionType", - "description": "Category of the connection", + "id": { + "type": "string", + "description": "Asset ID, a unique identifier for the asset", "readOnly": true }, - "target": { + "name": { "type": "string", - "description": "The connection URL to be used for this service", + "description": "The name of the resource", "readOnly": true }, - "isDefault": { - "type": "boolean", - "description": "Whether the connection is tagged as the default connection of its type", + "version": { + "type": "string", + "description": "The version of the resource", "readOnly": true }, - "credentials": { - "$ref": "#/definitions/BaseCredentials", - "description": "The credentials used by the connection", - "readOnly": true + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, - "metadata": { + "tags": { "type": "object", - "description": "Metadata of the connection", + "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "dataUri", + "type", + "name", + "version" + ] + }, + "Deployment": { + "type": "object", + "description": "Model Deployment Definition", + "properties": { + "type": { + "$ref": "#/definitions/DeploymentType", + "description": "The type of the deployment" + }, + "name": { + "type": "string", + "description": "Name of the deployment", "readOnly": true } }, + "discriminator": "type", "required": [ - "name", - "id", "type", - "target", - "isDefault", - "credentials", - "metadata" + "name" ] }, - "ConnectionType": { + "DeploymentType": { "type": "string", - "description": "The Type (or category) of the connection", "enum": [ - "AzureOpenAI", - "AzureBlob", - "AzureStorageAccount", - "CognitiveSearch", - "CosmosDB", - "ApiKey", - "AppConfig", - "AppInsights", - "CustomKeys" + "ModelDeployment" ], "x-ms-enum": { - "name": "ConnectionType", + "name": "DeploymentType", "modelAsString": true, "values": [ { - "name": "AzureOpenAI", - "value": "AzureOpenAI", - "description": "Azure OpenAI Service" - }, - { - "name": "AzureBlobStorage", - "value": "AzureBlob", - "description": "Azure Blob Storage, with specified container" - }, - { - "name": "AzureStorageAccount", - "value": "AzureStorageAccount", - "description": "Azure Blob Storage, with container not specified (used by Agents)" - }, - { - "name": "AzureAISearch", - "value": "CognitiveSearch", - "description": "Azure AI Search" - }, - { - "name": "CosmosDB", - "value": "CosmosDB", - "description": "CosmosDB" - }, - { - "name": "APIKey", - "value": "ApiKey", - "description": "Generic connection that uses API Key authentication" - }, - { - "name": "ApplicationConfiguration", - "value": "AppConfig", - "description": "Application Configuration" - }, - { - "name": "ApplicationInsights", - "value": "AppInsights", - "description": "Application Insights" - }, - { - "name": "Custom", - "value": "CustomKeys", - "description": "Custom Keys" + "name": "ModelDeployment", + "value": "ModelDeployment", + "description": "Model deployment" } ] } }, - "CosmosDBIndex": { + "DeveloperMessage": { "type": "object", - "description": "CosmosDB Vector Store Index Definition", + "description": "A message authored by a developer to guide the model during evaluation.", "properties": { - "connectionName": { + "content": { "type": "string", - "description": "Name of connection to CosmosDB", - "x-ms-mutability": [ - "create" - ] + "description": "Content provided by a developer to guide model behavior in an evaluation context." + } + }, + "required": [ + "content" + ], + "allOf": [ + { + "$ref": "#/definitions/Message" + } + ], + "x-ms-discriminator-value": "developer" + }, + "DpoHyperparametersParam": { + "type": "object", + "description": "The hyper parameter settings used in Direct Preference Optimization fine-tuning method.", + "properties": { + "batch_size": { + "type": "integer", + "format": "int32", + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance." }, - "databaseName": { - "type": "string", - "description": "Name of the CosmosDB Database", - "x-ms-mutability": [ - "create" - ] + "beta": { + "type": "number", + "format": "double", + "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model." }, - "containerName": { - "type": "string", - "description": "Name of CosmosDB Container", - "x-ms-mutability": [ - "create" - ] + "learning_rate_multiplier": { + "type": "number", + "format": "double", + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." }, - "embeddingConfiguration": { - "$ref": "#/definitions/EmbeddingConfiguration", - "description": "Embedding model configuration", + "n_epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + } + } + }, + "DpoMethodParam": { + "type": "object", + "description": "Configuration for the Direct Preference Optimization fine-tuning method.", + "properties": { + "hyperparameters": { + "$ref": "#/definitions/DpoHyperparametersParam", + "description": "The hyperparameters used for the DPO fine-tuning job." + } + } + }, + "EmbeddingConfiguration": { + "type": "object", + "description": "Embedding configuration class", + "properties": { + "modelDeploymentName": { + "type": "string", + "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.", "x-ms-mutability": [ "create" ] }, - "fieldMapping": { - "$ref": "#/definitions/FieldMapping", - "description": "Field mapping configuration", + "embeddingField": { + "type": "string", + "description": "Embedding field", "x-ms-mutability": [ "create" ] } }, "required": [ - "connectionName", - "databaseName", - "containerName", - "embeddingConfiguration", - "fieldMapping" - ], + "modelDeploymentName", + "embeddingField" + ] + }, + "EntraIDCredentials": { + "type": "object", + "description": "Entra ID credential definition", "allOf": [ { - "$ref": "#/definitions/Index" + "$ref": "#/definitions/BaseCredentials" } ], - "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" - }, - "CredentialType": { - "type": "string", - "description": "The credential type used by the connection", - "enum": [ - "ApiKey", - "AAD", - "SAS", - "CustomKeys", - "None" - ], - "x-ms-enum": { - "name": "CredentialType", - "modelAsString": true, - "values": [ - { - "name": "apiKey", - "value": "ApiKey", - "description": "API Key credential" - }, - { - "name": "entraId", - "value": "AAD", - "description": "Entra ID credential (formerly known as AAD)" - }, - { - "name": "SAS", - "value": "SAS", - "description": "Shared Access Signature (SAS) credential" - }, - { - "name": "custom", - "value": "CustomKeys", - "description": "Custom credential" - }, - { - "name": "None", - "value": "None", - "description": "No credential" - } - ] - } + "x-ms-discriminator-value": "AAD" }, - "CustomCredential": { + "Evaluation": { "type": "object", - "description": "Custom credential definition", + "description": "Evaluation Definition", "properties": { - "keys": { + "id": { + "type": "string", + "description": "Identifier of the evaluation.", + "readOnly": true, + "x-ms-client-name": "name" + }, + "data": { + "$ref": "#/definitions/InputData", + "description": "Data for evaluation." + }, + "displayName": { + "type": "string", + "description": "Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique." + }, + "description": { + "type": "string", + "description": "Description of the evaluation. It can be used to store additional information about the evaluation and is mutable." + }, + "status": { + "type": "string", + "description": "Status of the evaluation. It is set by service and is read-only.", + "readOnly": true + }, + "tags": { "type": "object", - "description": "The credential type", + "description": "Evaluation's tags. Unlike properties, tags are fully mutable.", "additionalProperties": { "type": "string" - }, - "readOnly": true + } + }, + "properties": { + "type": "object", + "description": "Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", + "additionalProperties": { + "type": "string" + } + }, + "evaluators": { + "type": "object", + "description": "Evaluators to be used for the evaluation.", + "additionalProperties": { + "$ref": "#/definitions/EvaluatorConfiguration" + } + }, + "target": { + "$ref": "#/definitions/EvaluationTarget", + "description": "Specifies the type and configuration of the entity used for this evaluation." + } + }, + "required": [ + "id", + "data", + "evaluators" + ] + }, + "EvaluationTarget": { + "type": "object", + "description": "Abstract base model for defining evaluation targets.", + "properties": { + "type": { + "$ref": "#/definitions/EvaluationTargetType", + "description": "Discriminator that defines the type of the evaluation target." } }, + "discriminator": "type", "required": [ - "keys" - ], - "allOf": [ - { - "$ref": "#/definitions/BaseCredentials" - } - ], - "x-ms-discriminator-value": "CustomKeys" + "type" + ] }, - "DatasetType": { + "EvaluationTargetType": { "type": "string", - "description": "Enum to determine the type of data.", + "description": "Allowed types of evaluation targets.", "enum": [ - "uri_file", - "uri_folder" + "modelResponseGeneration" ], "x-ms-enum": { - "name": "DatasetType", + "name": "EvaluationTargetType", "modelAsString": true, "values": [ { - "name": "uri_file", - "value": "uri_file", - "description": "URI file." - }, - { - "name": "uri_folder", - "value": "uri_folder", - "description": "URI folder." + "name": "modelResponseGeneration", + "value": "modelResponseGeneration", + "description": "Evaluation target that uses a model for response generation." } ] } }, - "DatasetVersion": { + "EvaluatorConfiguration": { "type": "object", - "description": "DatasetVersion Definition", + "description": "Evaluator Configuration", "properties": { - "dataUri": { + "id": { "type": "string", - "description": "URI of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330", - "minLength": 1, - "pattern": "[a-zA-Z0-9_]", + "description": "Identifier of the evaluator." + }, + "initParams": { + "type": "object", + "description": "Initialization parameters of the evaluator.", + "additionalProperties": {} + }, + "dataMapping": { + "type": "object", + "description": "Data parameters of the evaluator.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + }, + "FieldMapping": { + "type": "object", + "description": "Field mapping configuration class", + "properties": { + "contentFields": { + "type": "array", + "description": "List of fields with text content", + "items": { + "type": "string" + }, "x-ms-mutability": [ - "read", "create" ] }, - "type": { - "$ref": "#/definitions/DatasetType", - "description": "Dataset type" - }, - "isReference": { - "type": "boolean", - "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted", - "readOnly": true - }, - "connectionName": { + "filepathField": { "type": "string", - "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset", + "description": "Path of file to be used as a source of text content", "x-ms-mutability": [ - "read", "create" ] }, - "id": { - "type": "string", - "description": "Asset ID, a unique identifier for the asset", - "readOnly": true - }, - "name": { + "titleField": { "type": "string", - "description": "The name of the resource", - "readOnly": true + "description": "Field containing the title of the document", + "x-ms-mutability": [ + "create" + ] }, - "version": { + "urlField": { "type": "string", - "description": "The version of the resource", - "readOnly": true + "description": "Field containing the url of the document", + "x-ms-mutability": [ + "create" + ] }, - "description": { - "type": "string", - "description": "The asset description text.", + "vectorFields": { + "type": "array", + "description": "List of fields with vector content", + "items": { + "type": "string" + }, "x-ms-mutability": [ - "update", "create" ] }, - "tags": { - "type": "object", - "description": "Tag dictionary. Tags can be added, removed, and updated.", - "additionalProperties": { + "metadataFields": { + "type": "array", + "description": "List of fields with metadata content", + "items": { "type": "string" }, "x-ms-mutability": [ - "update", "create" ] } }, - "discriminator": "type", "required": [ - "dataUri", - "type", - "name", - "version" + "contentFields" ] }, - "Deployment": { + "FileDatasetVersion": { "type": "object", - "description": "Model Deployment Definition", - "properties": { - "type": { - "$ref": "#/definitions/DeploymentType", - "description": "The type of the deployment" - }, - "name": { - "type": "string", - "description": "Name of the deployment", - "readOnly": true + "description": "FileDatasetVersion Definition", + "allOf": [ + { + "$ref": "#/definitions/DatasetVersion" } - }, - "discriminator": "type", - "required": [ - "type", - "name" - ] + ], + "x-ms-discriminator-value": "uri_file" }, - "DeploymentType": { + "FineTuningEvaluationMetric": { "type": "string", + "description": "The evaluation metric to use in RFT text similarity grader", "enum": [ - "ModelDeployment" + "bleu", + "fuzzy_match", + "gleu", + "meteor", + "rouge_1", + "rouge_2", + "rouge_3", + "rouge_4", + "rouge_5", + "rouge_l", + "cosine" ], "x-ms-enum": { - "name": "DeploymentType", + "name": "FineTuningEvaluationMetric", "modelAsString": true, "values": [ { - "name": "ModelDeployment", - "value": "ModelDeployment", - "description": "Model deployment" + "name": "bleu", + "value": "bleu", + "description": "bleu" + }, + { + "name": "fuzzy_match", + "value": "fuzzy_match", + "description": "fuzzy_match" + }, + { + "name": "gleu", + "value": "gleu", + "description": "gleu" + }, + { + "name": "meteor", + "value": "meteor", + "description": "meteor" + }, + { + "name": "rouge_1", + "value": "rouge_1", + "description": "rouge_1" + }, + { + "name": "rouge_2", + "value": "rouge_2", + "description": "rouge_2" + }, + { + "name": "rouge_3", + "value": "rouge_3", + "description": "rouge_3" + }, + { + "name": "rouge_4", + "value": "rouge_4", + "description": "rouge_4" + }, + { + "name": "rouge_5", + "value": "rouge_5", + "description": "rouge_5" + }, + { + "name": "rouge_l", + "value": "rouge_l", + "description": "rouge_l" + }, + { + "name": "cosine", + "value": "cosine", + "description": "cosine" } ] } }, - "DeveloperMessage": { + "FineTuningGrader": { "type": "object", - "description": "A message authored by a developer to guide the model during evaluation.", + "description": "The grader used for RFT fine-tuning. Abstract base class", "properties": { - "content": { + "type": { "type": "string", - "description": "Content provided by a developer to guide model behavior in an evaluation context." + "description": "The grader type." } }, + "discriminator": "type", "required": [ - "content" - ], - "allOf": [ - { - "$ref": "#/definitions/Message" + "type" + ] + }, + "FineTuningJob": { + "type": "object", + "description": "Fine-Tuning Job", + "properties": { + "id": { + "type": "string", + "description": "The job identifier." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'fine_tuning.job'.", + "default": "fine_tuning.job" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The time when the fine-tuning job was created." + }, + "error": { + "$ref": "#/definitions/FineTuningJobError", + "description": "For fine-tuning jobs that have failed, this will contain more information on the cause of the failure." + }, + "estimated_finish": { + "type": "string", + "format": "date-time", + "description": "The time when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running." + }, + "fine_tuned_model": { + "type": "string", + "description": "The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running." + }, + "finished_at": { + "type": "string", + "format": "date-time", + "description": "The time when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running." + }, + "hyperparameters": { + "$ref": "#/definitions/Hyperparameters", + "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs" + }, + "integrations": { + "type": "array", + "description": "A list of integrations to enable for this fine-tuning job.", + "items": { + "$ref": "#/definitions/FineTuningJobWandbIntegrationObject" + } + }, + "metadata": { + "type": "object", + "description": "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.\n\nKeys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.", + "additionalProperties": { + "type": "string" + } + }, + "method": { + "$ref": "#/definitions/Method", + "description": "The method used for fine-tuning." + }, + "model": { + "type": "string", + "description": "The base model that is being fine-tuned." + }, + "organization_id": { + "type": "string", + "description": "The organization that owns the fine-tuning job." + }, + "result_files": { + "type": "array", + "description": "The compiled results file ID(s) for the fine-tuning job. The file is only available for successfully completed fine-tune runs.", + "items": { + "type": "string" + } + }, + "seed": { + "type": "integer", + "format": "int32", + "description": "The seed used for the fine-tuning job." + }, + "status": { + "type": "string", + "description": "The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled." + }, + "trained_tokens": { + "type": "integer", + "format": "int32", + "description": "The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running." + }, + "training_file": { + "type": "string", + "description": "The file ID used for training. You can retrieve the training data with the Files API." + }, + "validation_file": { + "type": "string", + "description": "The file ID used for validation. You can retrieve the validation results with the Files API." + }, + "additional_Parameters": { + "type": "object", + "description": "The additional 1P parameters used to train the fine-tuned model. This is Azure AI specific parameter.", + "additionalProperties": { + "type": "string" + } + }, + "suffix": { + "type": "string", + "description": "A string of up to 64 characters that will be added to your fine-tuned model name." + }, + "training_type": { + "$ref": "#/definitions/TrainingType", + "description": "The SKU used for training. This is Azure AI specific parameter" + }, + "inference_configs": { + "$ref": "#/definitions/InferenceConfigs", + "description": "Inference configurations. This is Azure AI specific parameter" } - ], - "x-ms-discriminator-value": "developer" + }, + "required": [ + "id", + "object", + "created_at", + "method", + "model", + "organization_id", + "seed", + "status", + "training_file" + ] }, - "EmbeddingConfiguration": { + "FineTuningJobCheckpoint": { "type": "object", - "description": "Embedding configuration class", + "description": "The fine_tuning.job.checkpoint object represents a model checkpoint for a fine-tuning job that is ready to use.", "properties": { - "modelDeploymentName": { + "object": { "type": "string", - "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.", - "x-ms-mutability": [ - "create" - ] + "description": "The object type, which is always fine_tuning.job.checkpoint", + "default": "fine_tuning.job.checkpoint" }, - "embeddingField": { + "created_at": { "type": "string", - "description": "Embedding field", - "x-ms-mutability": [ - "create" - ] + "format": "date-time", + "description": "The time when the fine-tuning checkpoint was created." + }, + "fine_tuned_model_checkpoint": { + "type": "string", + "description": "The name of the fine-tuned checkpoint model that is created." + }, + "fine_tuning_job_id": { + "type": "string", + "description": "The name of the fine-tuning job that this checkpoint was created from." + }, + "id": { + "type": "string", + "description": "The checkpoint identifier, which can be referenced in the API endpoints." + }, + "metrics": { + "$ref": "#/definitions/FineTuningJobCheckpointMetric", + "description": "Metrics at the step number during the fine-tuning job." + }, + "step_number": { + "type": "integer", + "format": "int32", + "description": "The step number that the checkpoint was created at." } }, "required": [ - "modelDeploymentName", - "embeddingField" + "object", + "created_at", + "fine_tuned_model_checkpoint", + "fine_tuning_job_id", + "id", + "metrics", + "step_number" ] }, - "EntraIDCredentials": { + "FineTuningJobCheckpointMetric": { "type": "object", - "description": "Entra ID credential definition", - "allOf": [ - { - "$ref": "#/definitions/BaseCredentials" + "description": "Metrics at the step number during the fine-tuning job.", + "properties": { + "full_valid_loss": { + "type": "number", + "format": "double", + "description": "metric full validation loss" + }, + "full_valid_mean_token_accuracy": { + "type": "number", + "format": "double", + "description": "metric full valid mean token accuracy" + }, + "step": { + "type": "number", + "format": "double", + "description": "metric step" + }, + "train_loss": { + "type": "number", + "format": "double", + "description": "metric train loss" + }, + "train_mean_token_accuracy": { + "type": "number", + "format": "double", + "description": "metric train mean token accuracy" + }, + "valid_loss": { + "type": "number", + "format": "double", + "description": "metric valid loss" + }, + "valid_mean_token_accuracy": { + "type": "number", + "format": "double", + "description": "metric valid mean token accuracy" } - ], - "x-ms-discriminator-value": "AAD" + } }, - "Evaluation": { + "FineTuningJobError": { "type": "object", - "description": "Evaluation Definition", + "description": "For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.", "properties": { - "id": { + "code": { "type": "string", - "description": "Identifier of the evaluation.", - "readOnly": true, - "x-ms-client-name": "name" - }, - "data": { - "$ref": "#/definitions/InputData", - "description": "Data for evaluation." + "description": "A machine-readable error code." }, - "displayName": { + "message": { "type": "string", - "description": "Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique." + "description": "A human-readable error message." }, - "description": { + "param": { "type": "string", - "description": "Description of the evaluation. It can be used to store additional information about the evaluation and is mutable." + "description": "The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific." + } + } + }, + "FineTuningJobEvent": { + "type": "object", + "description": "Fine-tuning job event object.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always fine_tuning.job.event", + "default": "fine_tuning.job.event" }, - "status": { + "created_at": { "type": "string", - "description": "Status of the evaluation. It is set by service and is read-only.", - "readOnly": true + "format": "date-time", + "description": "The time when the fine-tuning event was created." }, - "tags": { - "type": "object", - "description": "Evaluation's tags. Unlike properties, tags are fully mutable.", - "additionalProperties": { - "type": "string" - } + "data": { + "description": "The data associated with the event." }, - "properties": { - "type": "object", - "description": "Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", - "additionalProperties": { - "type": "string" - } + "id": { + "type": "string", + "description": "The object identifier." }, - "evaluators": { - "type": "object", - "description": "Evaluators to be used for the evaluation.", - "additionalProperties": { - "$ref": "#/definitions/EvaluatorConfiguration" - } + "level": { + "type": "string", + "description": "The log level of the event." }, - "target": { - "$ref": "#/definitions/EvaluationTarget", - "description": "Specifies the type and configuration of the entity used for this evaluation." + "message": { + "type": "string", + "description": "The message of the event." + }, + "type": { + "type": "string", + "description": "The type of event." } }, "required": [ + "object", + "created_at", "id", - "data", - "evaluators" + "level", + "message" ] }, - "EvaluationTarget": { + "FineTuningJobGraderMessageRole": { + "type": "string", + "description": "Training RFT message role options.", + "enum": [ + "user", + "system", + "developer", + "assistant" + ], + "x-ms-enum": { + "name": "FineTuningJobGraderMessageRole", + "modelAsString": true, + "values": [ + { + "name": "user", + "value": "user", + "description": "doc message role" + }, + { + "name": "system", + "value": "system", + "description": "system message role" + }, + { + "name": "developer", + "value": "developer", + "description": "developer message role" + }, + { + "name": "assistant", + "value": "assistant", + "description": "assistant message role" + } + ] + } + }, + "FineTuningJobGraderModelSamplingParam": { "type": "object", - "description": "Abstract base model for defining evaluation targets.", + "description": "The sampling parameters for the model.", "properties": { - "type": { - "$ref": "#/definitions/EvaluationTargetType", - "description": "Discriminator that defines the type of the evaluation target." + "seed": { + "type": "integer", + "format": "int32", + "description": "Seed parameter" + }, + "temperature": { + "type": "number", + "format": "double", + "description": "Temperature parameter" + }, + "max_completions_tokens": { + "type": "integer", + "format": "int32", + "description": "Max completions tokens parameter" + }, + "top_p": { + "type": "number", + "format": "double", + "description": "Top parameter" + }, + "reasoning_effort": { + "$ref": "#/definitions/FineTuningJobGraderReasoningEffort", + "description": "Reasoning effort parameter" } - }, - "discriminator": "type", - "required": [ - "type" - ] + } }, - "EvaluationTargetType": { + "FineTuningJobGraderReasoningEffort": { "type": "string", - "description": "Allowed types of evaluation targets.", + "description": "The sampling parameters for the model.", "enum": [ - "modelResponseGeneration" + "low", + "medium", + "high" ], "x-ms-enum": { - "name": "EvaluationTargetType", + "name": "FineTuningJobGraderReasoningEffort", "modelAsString": true, "values": [ { - "name": "modelResponseGeneration", - "value": "modelResponseGeneration", - "description": "Evaluation target that uses a model for response generation." + "name": "low", + "value": "low", + "description": "Low reasoning effort" + }, + { + "name": "medium", + "value": "medium", + "description": "Medium reasoning effort" + }, + { + "name": "high", + "value": "high", + "description": "High reasoning effort" } ] } }, - "EvaluatorConfiguration": { + "FineTuningJobWandbIntegration": { "type": "object", - "description": "Evaluator Configuration", + "description": "The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.", "properties": { - "id": { + "project": { "type": "string", - "description": "Identifier of the evaluator." + "description": "The name of the project that the new run will be created under." }, - "initParams": { - "type": "object", - "description": "Initialization parameters of the evaluator.", - "additionalProperties": {} + "entity": { + "type": "string", + "description": "The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used." }, - "dataMapping": { - "type": "object", - "description": "Data parameters of the evaluator.", - "additionalProperties": { + "name": { + "type": "string", + "description": "A display name to set for the run. If not set, we will use the Job ID as the name." + }, + "tags": { + "type": "array", + "description": "A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: 'openai/finetune', 'openai/{base-model}', 'openai/{ftjob}.", + "items": { "type": "string" } } }, "required": [ - "id" + "project" ] }, - "FieldMapping": { + "FineTuningJobWandbIntegrationObject": { "type": "object", - "description": "Field mapping configuration class", + "description": "Integration to enable for fine-tuning job.", "properties": { - "contentFields": { + "type": { + "type": "string", + "description": "The type of integration to enable. Currently, only 'wandb' (Weights and Biases) is supported." + }, + "wandb": { + "$ref": "#/definitions/FineTuningJobWandbIntegration", + "description": "The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run." + } + }, + "required": [ + "type", + "wandb" + ] + }, + "FineTuningLabelModelGrader": { + "type": "object", + "description": "A LabelModelGrader object which uses a model to assign labels to each item in the evaluation.", + "properties": { + "input": { "type": "array", - "description": "List of fields with text content", + "description": "input labels", "items": { - "type": "string" - }, - "x-ms-mutability": [ - "create" - ] + "$ref": "#/definitions/Input" + } }, - "filepathField": { - "type": "string", - "description": "Path of file to be used as a source of text content", - "x-ms-mutability": [ - "create" - ] + "labels": { + "type": "array", + "description": "The labels to assign to each item in the evaluation.", + "items": { + "type": "string" + } }, - "titleField": { + "model": { "type": "string", - "description": "Field containing the title of the document", - "x-ms-mutability": [ - "create" - ] + "description": "The model to use for the evaluation. Must support structured outputs." }, - "urlField": { + "name": { "type": "string", - "description": "Field containing the url of the document", - "x-ms-mutability": [ - "create" - ] - }, - "vectorFields": { - "type": "array", - "description": "List of fields with vector content", - "items": { - "type": "string" - }, - "x-ms-mutability": [ - "create" - ] + "description": "The name of the grader." }, - "metadataFields": { + "passing_labels": { "type": "array", - "description": "List of fields with metadata content", + "description": "The labels that indicate a passing result. Must be a subset of labels.", "items": { "type": "string" - }, - "x-ms-mutability": [ - "create" - ] + } } }, "required": [ - "contentFields" - ] - }, - "FileDatasetVersion": { - "type": "object", - "description": "FileDatasetVersion Definition", + "input", + "labels", + "model", + "name", + "passing_labels" + ], "allOf": [ { - "$ref": "#/definitions/DatasetVersion" + "$ref": "#/definitions/FineTuningGrader" } ], - "x-ms-discriminator-value": "uri_file" + "x-ms-discriminator-value": "label_model" + }, + "FineTuningStringOperation": { + "type": "string", + "description": "String operations used in RFT string check grader", + "enum": [ + "eq", + "ne", + "like", + "ilike" + ], + "x-ms-enum": { + "name": "FineTuningStringOperation", + "modelAsString": true, + "values": [ + { + "name": "eq", + "value": "eq", + "description": "Equal operator" + }, + { + "name": "ne", + "value": "ne", + "description": "Not equal operator" + }, + { + "name": "like", + "value": "like", + "description": "Like operator" + }, + { + "name": "ilike", + "value": "ilike", + "description": "Not like operator" + } + ] + } }, "FolderDatasetVersion": { "type": "object", @@ -2646,6 +3786,27 @@ ], "x-ms-discriminator-value": "uri_folder" }, + "Hyperparameters": { + "type": "object", + "description": "The hyperparameters used for the fine-tuning job. This value is now deprecated sin favor of `method`, and should be passed in under the `method` parameter.", + "properties": { + "batch_size": { + "type": "integer", + "format": "int32", + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance." + }, + "learning_rate_multiplier": { + "type": "integer", + "format": "int32", + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + } + } + }, "Index": { "type": "object", "description": "Index resource Definition", @@ -2725,6 +3886,113 @@ ] } }, + "InferenceConfigs": { + "type": "object", + "description": "Inference configurations", + "properties": { + "auto_inference_enabled": { + "type": "boolean", + "description": "Is model deployed after tuning completes" + }, + "inference_sku": { + "$ref": "#/definitions/InferenceSku", + "description": "SKU used for inference" + }, + "auto_deployment_id": { + "type": "string", + "description": "Deployment identifier" + }, + "auto_deployment_status": { + "type": "string", + "description": "Deployment status" + }, + "auto_deployment_error_message": { + "type": "string", + "description": "Deployment error information" + } + } + }, + "InferenceSku": { + "type": "string", + "description": "SKU available for training", + "enum": [ + "DeveloperTier", + "Standard", + "GlobalStandard" + ], + "x-ms-enum": { + "name": "InferenceSku", + "modelAsString": true, + "values": [ + { + "name": "DeveloperTier", + "value": "DeveloperTier", + "description": "DeveloperTier refers to a cross-region developer inference sku." + }, + { + "name": "Standard", + "value": "Standard", + "description": "Standard refers to regional pay-go inference sku." + }, + { + "name": "GlobalStandard", + "value": "GlobalStandard", + "description": "Global Standard refers to a cross-region pay-go inference sku." + } + ] + } + }, + "Input": { + "type": "object", + "description": "A ScoreModelGrader object that uses a model to assign a score to the input.", + "properties": { + "type": { + "type": "string", + "description": "Message type" + }, + "role": { + "$ref": "#/definitions/FineTuningJobGraderMessageRole", + "description": "Message role" + }, + "content": { + "$ref": "#/definitions/InputContent", + "description": "Message content" + } + }, + "required": [ + "type", + "role", + "content" + ] + }, + "InputContent": { + "type": "object", + "description": "Base for inputs to the model." + }, + "InputContentOutputText": { + "type": "object", + "description": "Inputs to the model - can contain template strings.", + "properties": { + "type": { + "type": "string", + "description": "The type of the output text. Always `output_text`.", + "enum": [ + "output_text" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "text": { + "type": "string", + "description": "The text output from the model." + } + }, + "required": [ + "type", + "text" + ] + }, "InputData": { "type": "object", "description": "Abstract data class.", @@ -2758,6 +4026,128 @@ ], "x-ms-discriminator-value": "dataset" }, + "InputSimpleContent": { + "type": "object", + "description": "Inputs to the model - can contain template strings.", + "properties": { + "content": { + "type": "string", + "description": "content field" + } + }, + "required": [ + "content" + ] + }, + "Integration": { + "type": "object", + "description": "Integration to enable for fine-tuning job.", + "properties": { + "type": { + "type": "string", + "description": "The type of integration to enable. Currently, only 'wandb' (Weights and Biases) is supported." + }, + "wandb": { + "$ref": "#/definitions/IntegrationWandb", + "description": "The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run." + } + }, + "required": [ + "type", + "wandb" + ] + }, + "IntegrationWandb": { + "type": "object", + "description": "The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.", + "properties": { + "project": { + "type": "string", + "description": "The name of the project that the new run will be created under." + }, + "entity": { + "type": "string", + "description": "The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used." + }, + "name": { + "type": "string", + "description": "A display name to set for the run. If not set, we will use the Job ID as the name." + }, + "tags": { + "type": "array", + "description": "A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: 'openai/finetune', 'openai/{base-model}', 'openai/{ftjob}.", + "items": { + "type": "string" + } + } + }, + "required": [ + "project" + ] + }, + "JobCreateParams": { + "type": "object", + "description": "Fine-Tuning Job", + "properties": { + "model": { + "type": "string", + "description": "The base model that is being fine-tuned." + }, + "training_file": { + "type": "string", + "description": "The file ID used for training. You can retrieve the training data with the Files API." + }, + "hyperparameters": { + "$ref": "#/definitions/Hyperparameters", + "description": "The hyperparameters used for the SFT fine-tuning job. This value is now deprecated in favor of method, and should be passed in under the method parameter." + }, + "integrations": { + "type": "array", + "description": "A list of integrations to enable for this fine-tuning job.", + "items": { + "$ref": "#/definitions/Integration" + } + }, + "metadata": { + "type": "object", + "description": "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.\n\nKeys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.", + "additionalProperties": { + "type": "string" + } + }, + "method": { + "$ref": "#/definitions/Method", + "description": "The method used for fine-tuning." + }, + "seed": { + "type": "integer", + "format": "int32", + "description": "The seed used for the fine-tuning job." + }, + "suffix": { + "type": "string", + "description": "A string of up to 64 characters that will be added to your fine-tuned model name." + }, + "validation_file": { + "type": "string", + "description": "The file ID used for validation. You can retrieve the validation results with the Files API." + }, + "training_type": { + "$ref": "#/definitions/TrainingType", + "description": "The SKU used for training. This is Azure AI specific parameter" + }, + "inference_configs": { + "$ref": "#/definitions/InferenceConfigs", + "description": "Inference configurations. This is Azure AI specific parameter" + } + }, + "required": [ + "model", + "training_file", + "method", + "seed" + ] + }, "ManagedAzureAISearchIndex": { "type": "object", "description": "Managed Azure AI Search Index Definition", @@ -2771,36 +4161,240 @@ } }, "required": [ - "vectorStoreId" - ], - "allOf": [ - { - "$ref": "#/definitions/Index" + "vectorStoreId" + ], + "allOf": [ + { + "$ref": "#/definitions/Index" + } + ], + "x-ms-discriminator-value": "ManagedAzureSearch" + }, + "Message": { + "type": "object", + "description": "Abstract base model representing a single message in a conversation.", + "properties": { + "role": { + "type": "string", + "description": "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'.", + "enum": [ + "system", + "assistant", + "developer", + "user" + ], + "x-ms-enum": { + "modelAsString": true + } + } + }, + "discriminator": "role", + "required": [ + "role" + ] + }, + "Method": { + "type": "object", + "description": "The method used for fine-tuning.", + "properties": { + "type": { + "$ref": "#/definitions/MethodTrainingType", + "description": "The type of training method." + }, + "supervised": { + "$ref": "#/definitions/SupervisedMethodParam", + "description": "Configuration for the supervised fine-tuning method." + }, + "dpo": { + "$ref": "#/definitions/DpoMethodParam", + "description": "Configuration for the DPO fine-tuning method." + }, + "reinforcement": { + "$ref": "#/definitions/ReinforcementMethodParam", + "description": "Configuration for the reinforcement fine-tuning method." + }, + "mistral_classifier": { + "$ref": "#/definitions/MistralClassifierMethodParam", + "description": "Configuration for the Mistral Classifier fine-tuning method." + }, + "mistral_completion": { + "$ref": "#/definitions/MistralCompletionParam", + "description": "Configuration for the Mistral Completion fine-tuning method." + } + }, + "required": [ + "type" + ] + }, + "MethodTrainingType": { + "type": "string", + "description": "Training method types", + "enum": [ + "supervised", + "dpo", + "reinforcement", + "mistral_completion", + "mistral_classifier" + ], + "x-ms-enum": { + "name": "MethodTrainingType", + "modelAsString": true, + "values": [ + { + "name": "supervised", + "value": "supervised", + "description": "Supervised fine-tuning type" + }, + { + "name": "dpo", + "value": "dpo", + "description": "DPO fine-tuning type" + }, + { + "name": "reinforcement", + "value": "reinforcement", + "description": "Reinforcement fine-tuning type" + }, + { + "name": "mistral_completion", + "value": "mistral_completion", + "description": "Mistral Completion fine-tuning type" + }, + { + "name": "mistral_classifier", + "value": "mistral_classifier", + "description": "Mistral Classifier fine-tuning type" + } + ] + } + }, + "MistralClassifierHyperparametersParam": { + "type": "object", + "description": "The hyper parameter settings used in Mistral Classifier Fine-Tuning job.", + "properties": { + "training_steps": { + "type": "integer", + "format": "int32", + "description": "The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset." + }, + "learning_rate": { + "type": "number", + "format": "double", + "description": "A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.", + "default": 0.0001 + }, + "weight_decay": { + "type": "number", + "format": "double", + "description": "(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.", + "default": 0.1 + }, + "warmup_fraction": { + "type": "number", + "format": "double", + "description": "(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to pct_start in mistral-finetune", + "default": 0.05 + }, + "epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + }, + "seq_len": { + "type": "integer", + "format": "int32", + "description": "Seq len parameter" + } + } + }, + "MistralClassifierMethodParam": { + "type": "object", + "description": "Mistral Classifier Fine-Tuning method.", + "properties": { + "type": { + "type": "string", + "description": "Mistral Classifier fine-tuning type", + "enum": [ + "mistral_classifier" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "hyperparameters": { + "$ref": "#/definitions/MistralClassifierHyperparametersParam", + "description": "The hyperparameters used for the Mistral Classifier fine-tuning job." + } + }, + "required": [ + "type" + ] + }, + "MistralCompletionHyperParameters": { + "type": "object", + "description": "The hyper parameter settings used in Mistral Completion Fine-Tuning job.", + "properties": { + "training_steps": { + "type": "integer", + "format": "int32", + "description": "The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset." + }, + "learning_rate": { + "type": "number", + "format": "double", + "description": "A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.", + "default": 0.0001 + }, + "weight_decay": { + "type": "number", + "format": "double", + "description": "(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.", + "default": 0.1 + }, + "warmup_fraction": { + "type": "number", + "format": "double", + "description": "(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to pct_start in mistral-finetune", + "default": 0.05 + }, + "epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + }, + "seq_len": { + "type": "integer", + "format": "int32", + "description": "Seq len parameter" + }, + "fim_ratio": { + "type": "number", + "format": "double", + "description": "Fim ratio parameter" } - ], - "x-ms-discriminator-value": "ManagedAzureSearch" + } }, - "Message": { + "MistralCompletionParam": { "type": "object", - "description": "Abstract base model representing a single message in a conversation.", + "description": "Mistral Completion Fine-Tuning method.", "properties": { - "role": { + "type": { "type": "string", - "description": "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'.", + "description": "Mistral Completion fine-tuning type", "enum": [ - "system", - "assistant", - "developer", - "user" + "mistral_completion" ], "x-ms-enum": { - "modelAsString": true + "modelAsString": false } + }, + "hyperparameters": { + "$ref": "#/definitions/MistralCompletionHyperParameters", + "description": "The hyperparameters used for the Mistral Completion fine-tuning job." } }, - "discriminator": "role", "required": [ - "role" + "type" ] }, "ModelDeployment": { @@ -2855,6 +4449,38 @@ ], "x-ms-discriminator-value": "ModelDeployment" }, + "MultiGraderParam": { + "type": "object", + "description": "A MultiGrader object combines the output of multiple graders to produce a single score.", + "properties": { + "calculate_output": { + "type": "string", + "description": "A formula to calculate the output based on grader results." + }, + "graders": { + "type": "object", + "description": "Graders to be combined", + "additionalProperties": { + "$ref": "#/definitions/FineTuningGrader" + } + }, + "name": { + "type": "string", + "description": "The name of the grader." + } + }, + "required": [ + "calculate_output", + "graders", + "name" + ], + "allOf": [ + { + "$ref": "#/definitions/FineTuningGrader" + } + ], + "x-ms-discriminator-value": "multi" + }, "NoAuthenticationCredentials": { "type": "object", "description": "Credentials that do not require authentication", @@ -3093,6 +4719,34 @@ ] } }, + "PythonGraderParam": { + "type": "object", + "description": "A PythonGrader object that runs a python script on the input.", + "properties": { + "name": { + "type": "string", + "description": "The name of the grader." + }, + "source": { + "type": "string", + "description": "The source code of the python script." + }, + "image_tag": { + "type": "string", + "description": "The image tag to use for the python script." + } + }, + "required": [ + "name", + "source" + ], + "allOf": [ + { + "$ref": "#/definitions/FineTuningGrader" + } + ], + "x-ms-discriminator-value": "python" + }, "RedTeam": { "type": "object", "description": "Red team details.", @@ -3164,6 +4818,125 @@ "target" ] }, + "ReinforcementHyperparametersParam": { + "type": "object", + "description": "Configuration for the Reinforcement fine-tuning method.", + "properties": { + "batch_size": { + "type": "integer", + "format": "int32", + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance." + }, + "compute_multiplier": { + "type": "number", + "format": "double", + "description": "Multiplier on amount of compute used for exploring search space during training." + }, + "eval_interval": { + "type": "integer", + "format": "int32", + "description": "The number of training steps between evaluation runs." + }, + "eval_samples": { + "type": "integer", + "format": "int32", + "description": "Number of evaluation samples to generate per training step." + }, + "learning_rate_multiplier": { + "type": "number", + "format": "double", + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + }, + "reasoning_effort": { + "type": "string", + "description": "Level of reasoning effort." + } + } + }, + "ReinforcementMethodParam": { + "type": "object", + "description": "Configuration for the Reinforcement fine-tuning method.", + "properties": { + "grader": { + "$ref": "#/definitions/FineTuningGrader", + "description": "The grader used for the fine-tuning job." + }, + "hyperparameters": { + "$ref": "#/definitions/ReinforcementHyperparametersParam", + "description": "The hyperparameters used for the reinforcement fine-tuning job." + }, + "response_format": { + "$ref": "#/definitions/ReinforcementResponseFormat", + "description": "Gets the response format for the Reinforcement fine-tuning job." + } + }, + "required": [ + "grader" + ] + }, + "ReinforcementResponseFormat": { + "type": "object", + "description": "Gets the response format for the Reinforcement fine-tuning method.", + "properties": { + "type": { + "type": "string", + "description": "Response format request - Currently only JSON schema is supported" + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "ReinforcementResponseJsonSchema": { + "type": "object", + "description": "Gets the response format for the Reinforcement fine-tuning method.", + "properties": { + "json_schema": { + "type": "object", + "description": "JSON schema response for RFT", + "additionalProperties": {} + } + }, + "required": [ + "json_schema" + ], + "allOf": [ + { + "$ref": "#/definitions/ReinforcementResponseFormat" + } + ], + "x-ms-discriminator-value": "json_schema" + }, + "ResponseInputTextParam": { + "type": "object", + "description": "Inputs to the model - can contain template strings.", + "properties": { + "type": { + "type": "string", + "description": "The type of the input item. Always `input_text`", + "enum": [ + "input_text" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "text": { + "type": "string", + "description": "The text input to the model." + } + }, + "required": [ + "type", + "text" + ] + }, "RiskCategory": { "type": "string", "description": "Risk category for the attack objective.", @@ -3244,6 +5017,55 @@ "type" ] }, + "ScoreModelGraderParam": { + "type": "object", + "description": "A ScoreModelGrader object that uses a model to assign a score to the input.", + "properties": { + "input": { + "type": "array", + "description": "The input text. This may include template strings.", + "items": { + "$ref": "#/definitions/Input" + } + }, + "model": { + "type": "string", + "description": "The model to use for the evaluation." + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "range": { + "type": "array", + "description": "The model to use for the evaluation.", + "items": { + "type": "number", + "format": "double" + } + }, + "sampling_params": { + "$ref": "#/definitions/FineTuningJobGraderModelSamplingParam", + "description": "The sampling parameters for the model." + }, + "pass_threshold": { + "type": "number", + "format": "double", + "description": "TBD" + } + }, + "required": [ + "input", + "model", + "name" + ], + "allOf": [ + { + "$ref": "#/definitions/FineTuningGrader" + } + ], + "x-ms-discriminator-value": "score_model" + }, "Sku": { "type": "object", "description": "Sku information", @@ -3278,6 +5100,71 @@ "tier" ] }, + "StringCheckGraderParam": { + "type": "object", + "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.", + "properties": { + "input": { + "type": "string", + "description": "The input text. This may include template strings." + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "operation": { + "$ref": "#/definitions/FineTuningStringOperation", + "description": "The string check operation to perform. One of eq, ne, like, or ilike." + }, + "reference": { + "type": "string", + "description": "The reference text. This may include template strings." + } + }, + "required": [ + "input", + "name", + "operation", + "reference" + ], + "allOf": [ + { + "$ref": "#/definitions/FineTuningGrader" + } + ], + "x-ms-discriminator-value": "string_check" + }, + "SupervisedHyperparametersParam": { + "type": "object", + "description": "The hyper parameter settings used in Supervised Fine-Tuning job.", + "properties": { + "batch_size": { + "type": "integer", + "format": "int32", + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance." + }, + "learning_rate_multiplier": { + "type": "integer", + "format": "int32", + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "type": "integer", + "format": "int32", + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset." + } + } + }, + "SupervisedMethodParam": { + "type": "object", + "description": "Supervised Fine-Tuning method.", + "properties": { + "hyperparameters": { + "$ref": "#/definitions/SupervisedHyperparametersParam", + "description": "The hyperparameters used for the SFT fine-tuning job." + } + } + }, "SystemMessage": { "type": "object", "description": "A message authored by the system to guide model behavior.", @@ -3311,6 +5198,75 @@ "type" ] }, + "TextSimilarityGraderParam": { + "type": "object", + "description": "ScoreModelGrader uses a model to assign a score to the input.", + "properties": { + "evaluation_metric": { + "$ref": "#/definitions/FineTuningEvaluationMetric", + "description": "The evaluation metric to use" + }, + "input": { + "type": "string", + "description": "The text being graded." + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "reference": { + "type": "string", + "description": "The text being graded against." + }, + "pass_threshold": { + "type": "number", + "format": "double", + "description": "TBD" + } + }, + "required": [ + "evaluation_metric", + "input", + "name", + "reference" + ], + "allOf": [ + { + "$ref": "#/definitions/FineTuningGrader" + } + ], + "x-ms-discriminator-value": "text_similarity" + }, + "TrainingType": { + "type": "string", + "description": "SKU available for training", + "enum": [ + "Standard", + "GlobalStandard", + "DeveloperTier" + ], + "x-ms-enum": { + "name": "TrainingType", + "modelAsString": true, + "values": [ + { + "name": "Standard", + "value": "Standard", + "description": "Standard training job uses dedicated training capacity in a region" + }, + { + "name": "GlobalStandard", + "value": "GlobalStandard", + "description": "GlobalStandard training job uses dedicated capacity from a different region" + }, + { + "name": "DeveloperTier", + "value": "DeveloperTier", + "description": "DeveloperTier training job uses inference capacity when available" + } + ] + } + }, "UserMessage": { "type": "object", "description": "A message authored by the end user as input to the model.", diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Cancel.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Cancel.json new file mode 100644 index 000000000000..7b32e8ad0bd3 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Cancel.json @@ -0,0 +1,53 @@ +{ + "title": "Cancel a FineTuning job", + "operationId": "FineTuningJobs_Cancel", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "cancelling", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Create.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Create.json new file mode 100644 index 000000000000..4364e6ea8edb --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Create.json @@ -0,0 +1,81 @@ +{ + "title": "Create FineTuning job", + "operationId": "FineTuningJobs_Create", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fineTuningJob": { + "model": "gpt-4o-mini-2024-07-18", + "training_file": "FileId-1", + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + }, + "seed": 123, + "validation_file": "FileId-2" + } + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "running", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Delete.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Delete.json new file mode 100644 index 000000000000..5007a9848e22 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "Delete FineTuning job", + "operationId": "FineTuningJobs_Delete", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get.json new file mode 100644 index 000000000000..f66700e40fc6 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get.json @@ -0,0 +1,22 @@ +{ + "title": "FineTuningJobs_Get", + "operationId": "FineTuningJobs_Get", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "created_at": 1738193475, + "status": "running", + "training_file": "FileId-1", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123 + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_FailedJob.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_FailedJob.json new file mode 100644 index 000000000000..4584b3dc008d --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_FailedJob.json @@ -0,0 +1,58 @@ +{ + "title": "Retrieve a failed FineTuning job", + "operationId": "FineTuningJobs_Get", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "failed", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "failed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + }, + "error": { + "code": "400", + "message": "Training file should be chat or completion for supervised finetune.", + "param": "training file" + } + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_SuccessfulJob.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_SuccessfulJob.json new file mode 100644 index 000000000000..871b82187b00 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Get_SuccessfulJob.json @@ -0,0 +1,55 @@ +{ + "title": "Retrieve a successful FineTuning job", + "operationId": "FineTuningJobs_Get", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "succeeded", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "fine_tuned_model": "gpt-4o-mini-2024-07-18.ftjob-1", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListCheckpoints.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListCheckpoints.json new file mode 100644 index 000000000000..31f374180fd0 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListCheckpoints.json @@ -0,0 +1,37 @@ +{ + "title": "List the checkpoints from a FineTuning jobs", + "operationId": "FineTuningJobs_ListCheckpoints", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.checkpoint", + "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P", + "created_at": "2025-01-01T10:00:00.00Z", + "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88", + "fine_tuning_job_id": "ftjob-1", + "metrics": { + "step": 88, + "train_loss": 0.478, + "train_mean_token_accuracy": 0.924, + "valid_loss": 10.112, + "valid_mean_token_accuracy": 0.145, + "full_valid_loss": 0.567, + "full_valid_mean_token_accuracy": 0.944 + }, + "step_number": 88 + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListEvents.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListEvents.json new file mode 100644 index 000000000000..371b0f724944 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListEvents.json @@ -0,0 +1,27 @@ +{ + "title": "List the events from a FineTuning jobs", + "operationId": "FineTuningJobs_ListEvents", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.event", + "created_at": "2025-01-01T10:00:00.00Z", + "id": "ftevent-1", + "level": "info", + "message": "job started" + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListFineTuningJobs.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListFineTuningJobs.json new file mode 100644 index 000000000000..c1a92fc495d4 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListFineTuningJobs.json @@ -0,0 +1,61 @@ +{ + "title": "List FineTuning jobs", + "operationId": "FineTuningJobs_ListFineTuningJobs", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "data": [ + { + "object": "list", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "succeeded", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "fine_tuned_model": "gpt-4o-mini-2024-07-18.ftjob-1", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListJobs.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListJobs.json new file mode 100644 index 000000000000..262c507c2b40 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_ListJobs.json @@ -0,0 +1,61 @@ +{ + "title": "List FineTuning jobs", + "operationId": "FineTuningJobs_List", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "limit": "2" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "finished_at": "2025-01-01T11:00:00.00Z", + "status": "succeeded", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "fine_tuned_model": "gpt-4o-mini-2024-07-18.ftjob-1", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + ], + "has_more": false + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Pause.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Pause.json new file mode 100644 index 000000000000..63bc8fe8a9e7 --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Pause.json @@ -0,0 +1,53 @@ +{ + "title": "Pause a FineTuning job", + "operationId": "FineTuningJobs_Pause", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "pausing", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Resume.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Resume.json new file mode 100644 index 000000000000..4a649dc6c96d --- /dev/null +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/examples/FineTuningJobs_Resume.json @@ -0,0 +1,53 @@ +{ + "title": "Resume a FineTuning job", + "operationId": "FineTuningJobs_Resume", + "parameters": { + "api-version": "2025-05-15-preview", + "x-ms-client-request-id": "cf35b680-dc80-4815-ab83-9364acc3bce6", + "fine_tuning_job_id": "ftjob-1" + }, + "responses": { + "200": { + "body": { + "object": "fine_tuning.job", + "id": "ftjob-1", + "organization_id": "Org123", + "created_at": "2025-01-01T10:00:00.00Z", + "status": "running", + "training_file": "FileId-1", + "validation_file": "FileId-2", + "model": "gpt-4o-mini-2024-07-18", + "seed": 123, + "trained_tokens": 1000, + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + }, + "integrations": [ + { + "type": "wandb", + "wandb": { + "project": "custom-wandb-project", + "name": "ftjob-1", + "tags": [ + "FTJob", + "completed" + ] + } + } + ], + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "batch_size": 1, + "learning_rate_multiplier": 1, + "n_epochs": 1 + } + } + } + } + } + } +}