From d2b2b93a3a7f84583bc3c1252a5d034ac997de77 Mon Sep 17 00:00:00 2001 From: mdlinville <7674613+mdlinville@users.noreply.github.com> Date: Mon, 16 Mar 2026 09:49:34 +0000 Subject: [PATCH] chore: Update Training API documentation --- training/api-reference.mdx | 4 +- training/api-reference/openapi.json | 202 ++++++++++++++++++++++++---- 2 files changed, 179 insertions(+), 27 deletions(-) diff --git a/training/api-reference.mdx b/training/api-reference.mdx index 9080663ceb..d0b8167456 100644 --- a/training/api-reference.mdx +++ b/training/api-reference.mdx @@ -29,6 +29,7 @@ https://api.training.wandb.ai/v1 ### chat-completions - **[POST /v1/chat/completions](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion)** - Create Chat Completion +- **[POST /v1/chat/completions/](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion)** - Create Chat Completion ### models @@ -40,7 +41,8 @@ https://api.training.wandb.ai/v1 ### training-jobs -- **[POST /v1/preview/training-jobs](https://docs.wandb.ai/training/api-reference/training-jobs/create-training-job)** - Create Training Job +- **[POST /v1/preview/sft-training-jobs](https://docs.wandb.ai/training/api-reference/training-jobs/create-sft-training-job)** - Create Sft Training Job +- **[POST /v1/preview/training-jobs](https://docs.wandb.ai/training/api-reference/training-jobs/create-rl-training-job)** - Create Rl Training Job - **[GET /v1/preview/training-jobs/{training_job_id}](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job)** - Get Training Job - **[GET /v1/preview/training-jobs/{training_job_id}/events](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job-events)** - Get Training Job Events diff --git a/training/api-reference/openapi.json b/training/api-reference/openapi.json index 30b8fc5598..104a44f28a 100644 --- a/training/api-reference/openapi.json +++ b/training/api-reference/openapi.json @@ -399,8 +399,9 @@ "tags": [ "training-jobs" ], - "summary": "Create Training Job", - "operationId": "create_training_job_v1_preview_training_jobs_post", + "summary": "Create Rl Training Job", + "description": "Create a new RL (Reinforcement Learning) training job.", + "operationId": "Create_RL_Training_Job_v1_preview_training_jobs_post", "requestBody": { "content": { "application/json": { @@ -440,6 +441,53 @@ ] } }, + "/v1/preview/sft-training-jobs": { + "post": { + "tags": [ + "training-jobs" + ], + "summary": "Create Sft Training Job", + "description": "Create a new SFT (Supervised Fine-Tuning) training job.", + "operationId": "Create_SFT_Training_Job_v1_preview_sft_training_jobs_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSFTTrainingJob" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainingJobResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ] + } + }, "/v1/preview/training-jobs/{training_job_id}": { "get": { "tags": [ @@ -563,6 +611,9 @@ }, "/v1/health": { "get": { + "tags": [ + "health" + ], "summary": "Health Check", "operationId": "health_check_v1_health_get", "responses": { @@ -579,6 +630,9 @@ }, "/v1/system-check": { "get": { + "tags": [ + "health" + ], "summary": "System Check", "description": "Check health of all system components.\n\nReturns:\n JSON with status of:\n - api: Always true (if endpoint is reachable)\n - database: Whether DB connection works\n - cpu_queue: Success, duration, and any errors\n - gpu_queue: Success, duration, and any errors\n\nReturns HTTP 503 if any checks fail.", "operationId": "system_check_v1_system_check_get", @@ -1833,6 +1887,7 @@ "anyOf": [ { "type": "integer", + "maximum": 9.223372036854776e+18, "minimum": -1.0 }, { @@ -2665,6 +2720,49 @@ "type": "object", "title": "Content" }, + "CreateSFTTrainingJob": { + "properties": { + "model_id": { + "type": "string", + "format": "uuid", + "title": "Model Id" + }, + "training_data_url": { + "type": "string", + "title": "Training Data Url", + "description": "W&B artifact path for training data (e.g., 'wandb-artifact:///entity/project/artifact-name:version')" + }, + "config": { + "anyOf": [ + { + "$ref": "#/components/schemas/SFTTrainingConfig" + }, + { + "type": "null" + } + ] + }, + "experimental_config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Experimental Config" + } + }, + "type": "object", + "required": [ + "model_id", + "training_data_url" + ], + "title": "CreateSFTTrainingJob", + "description": "Schema for creating a new SFT (Supervised Fine-Tuning) TrainingJob.\n\nThe client should upload the training data (trajectories.jsonl and metadata.json)\nto W&B Artifacts and provide the artifact URL." + }, "CreateTrainingJob": { "properties": { "model_id": { @@ -3728,6 +3826,17 @@ "base_model": { "type": "string", "title": "Base Model" + }, + "run_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Run Id" } }, "type": "object", @@ -3882,6 +3991,45 @@ "title": "Role", "description": "The role of a message author (mirrors ``chat::Role``)." }, + "SFTTrainingConfig": { + "properties": { + "batch_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "const": "auto" + }, + { + "type": "null" + } + ], + "title": "Batch Size" + }, + "learning_rate": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Learning Rate" + } + }, + "type": "object", + "title": "SFTTrainingConfig", + "description": "Schema for SFT training config." + }, "StreamOptions": { "properties": { "include_usage": { @@ -4189,7 +4337,8 @@ ] }, "type": "array", - "title": "Messages And Choices" + "title": "Messages And Choices", + "default": [] }, "tools": { "anyOf": [ @@ -4215,7 +4364,30 @@ }, "reward": { "type": "number", - "title": "Reward" + "title": "Reward", + "default": 0.0 + }, + "initial_policy_version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Initial Policy Version" + }, + "final_policy_version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Final Policy Version" }, "metrics": { "additionalProperties": { @@ -4235,24 +4407,6 @@ "title": "Metrics", "default": {} }, - "auto_metrics": { - "additionalProperties": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "integer" - }, - { - "type": "boolean" - } - ] - }, - "type": "object", - "title": "Auto Metrics", - "default": {} - }, "metadata": { "additionalProperties": { "anyOf": [ @@ -4292,10 +4446,6 @@ } }, "type": "object", - "required": [ - "messages_and_choices", - "reward" - ], "title": "Trajectory" }, "TrajectoryGroup": {