llama-stack-mirror/docs/docs/api-deprecated/run-supervised-fine-tuning-of-a-model.api.mdx
Francisco Javier Arceo 2d9163529a chore: Rename RagTool FileSearchTool
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
2025-10-24 16:52:58 -04:00

72 lines
16 KiB
Text

---
id: run-supervised-fine-tuning-of-a-model
title: "Run supervised fine-tuning of a model."
description: "Run supervised fine-tuning of a model."
sidebar_label: "Run supervised fine-tuning of a model."
hide_title: true
hide_table_of_contents: true
api: eJztGlluG8vxKoX5kgxSopy35BHIB59lJw5kW5YoPAS2QBRnajhtzXSPexFNCzpD/vOVY+Q8uUCuEFT3bFwl+SkBDEgfEtXsrq1rr76JNJlSSUMmGt5EzwcD/pOQibUorVAyGkYjOFXGjjUKKeTsr2p6EPWiWElL0vJuLMtcxMi7Dz8ZPnITmTijAvmTXZQUDSM1/USxjXpRqVVJ2oqA8JOaTpwTSWensVrIWXR724swSQSDxfy0cyrF3FAv0vTZCU1JNPzQgrnsRVbYnOGsEB3d3jLIHzZxOM4IGBwZC3M0IOQ15iIBpaHAPFW6oOTxeDYWrTOdfUJampGOeitk/WU8PoWwG2KVUHTbcLcqrdWjL7VWGvzmHiCYTGkLxhUF6gWoFGxGQH7PPBNxBiIwrQVKC6nSgLL63uO5ZfgWRX5fzGE3o86VnJGGzBUo+5owwWlO0DmzRA5jEtJYlPE9uNx7Vwb12IcRXJydVMzEKGFK4AwlYBVoslrQNUGhNIGQfJ/+5gCnylmP3JQUi1TEoOLYaU0yphW6HqKO1Q3Xt9UIr6OdXkxbhFebJKRaFZ6G0enrAzhTbpblC0hVnqu5gbNXL+DnPw5+PmCh0RcsyqAZtX79MBi0+H7FBM6Cirf03FPzK8t5/stmy4lzQdJChgYMf7BKQYFyUQNmqIAwE9ckAQvlpPWyFQU9GdWTUX1nRvX8lxbfWCl4w5peWZbpmtbflIMMrwnoS0yUsNjY2NAS5KIQ9gBOc0JDYPUCcIZCQo6W9EFlbz9ui1SG9DVpIBmzKZGmhBX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O2HB4eolz0M2UsJf08xwL7xmJ8dRCrwicIhmKnhV34g8e1eXy45O94WH3WjrVfthP6dizdqvuG8XI7FB5sGeke3TF8Pdo2Fz1aH1l2plQtVd054KAzwQtSXxq6dQdkW6ZfLdx6WFX371amRX55ywhldbhRDyF4uDBYHQ4MNjX0B9s64Xd2pytyd7eJq027urbVlvV+as14UsdB7kzubuRt6Hu1HaOOJ19pALXfbOrfVOirtHND6vihPn+5MbUL+rE5MQvfhURq0OQ6g25GUslnJTsIwvEvhFLlqayDKFsmnLNlwnn1kif4yT4cN76CX9Fw1GZDDz71+mhD34ufQpmlR0EBVJ3NdXD5PKvU6lokZD5KWPlB4DGzSoFk4iVv/OTEZiS4yafDOx8/+OfgpFOMOXlmoKjpo+S3Okr7R0zrwKf8bjuna9I4q6l6w5duDj7Kj/LZs3//45//+dff4fjl6dnLF6Pxy+Nnz4ZwQjOMF14SAVGBC34rpalQ15Twc+3UWacJKimZA7gwVd9bzKrooyml6o2UzBc+y2AvW6B/nBMC+v2fAi1dQOfpz/0hVNpq6Ys9LHMUfpDn3fhNFQk+hLteigXs9jdFg8texB6fD93csOZd6Pz2lpc/O9KL8F7Jv5WbsvZ94F5uRpiQ9lHgihYhXDMX/XFIBK4xd95XrT5m4lZDODGKYyrtzr2XnUB3+u6cU7Bp9WCKZRENI41zn2zOo2EUBf/JY7nhTVi7iXKUM8fTrmEUYPLPfwEBo2wd
sidebar_class_name: "post api-method"
info_path: docs/api-deprecated/llama-stack-specification-deprecated-apis
custom_edit_url: null
---
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";
<Heading
as={"h1"}
className={"openapi__heading"}
children={"Run supervised fine-tuning of a model."}
>
</Heading>
<MethodEndpoint
method={"post"}
path={"/v1/post-training/supervised-fine-tune"}
context={"endpoint"}
>
</MethodEndpoint>
:::caution deprecated
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
:::
Run supervised fine-tuning of a model.
<Heading
id={"request"}
as={"h2"}
className={"openapi-tabs__heading"}
children={"Request"}
>
</Heading>
<ParamsDetails
parameters={[]}
>
</ParamsDetails>
<RequestSchema
title={"Body"}
body={{"content":{"application/json":{"schema":{"type":"object","properties":{"job_uuid":{"type":"string","description":"The UUID of the job to create."},"training_config":{"description":"The training configuration.","type":"object","properties":{"n_epochs":{"type":"integer","description":"Number of training epochs to run"},"max_steps_per_epoch":{"type":"integer","default":1,"description":"Maximum number of steps to run per epoch"},"gradient_accumulation_steps":{"type":"integer","default":1,"description":"Number of steps to accumulate gradients before updating"},"max_validation_steps":{"type":"integer","default":1,"description":"(Optional) Maximum number of validation steps per epoch"},"data_config":{"description":"(Optional) Configuration for data loading and formatting","type":"object","properties":{"dataset_id":{"type":"string","description":"Unique identifier for the training dataset"},"batch_size":{"type":"integer","description":"Number of samples per training batch"},"shuffle":{"type":"boolean","description":"Whether to shuffle the dataset during training"},"data_format":{"description":"Format of the dataset (instruct or dialog)","type":"string","enum":["instruct","dialog"],"title":"DatasetFormat"},"validation_dataset_id":{"type":"string","description":"(Optional) Unique identifier for the validation dataset"},"packed":{"type":"boolean","default":false,"description":"(Optional) Whether to pack multiple samples into a single sequence for efficiency"},"train_on_input":{"type":"boolean","default":false,"description":"(Optional) Whether to compute loss on input tokens as well as output tokens"}},"additionalProperties":false,"required":["dataset_id","batch_size","shuffle","data_format"],"title":"DataConfig"},"optimizer_config":{"description":"(Optional) Configuration for the optimization algorithm","type":"object","properties":{"optimizer_type":{"description":"Type of optimizer to use (adam, adamw, or sgd)","type":"string","enum":["adam","adamw","sgd"],"title":"OptimizerType"},"lr":{"type":"number","description":"Learning rate for the optimizer"},"weight_decay":{"type":"number","description":"Weight decay coefficient for regularization"},"num_warmup_steps":{"type":"integer","description":"Number of steps for learning rate warmup"}},"additionalProperties":false,"required":["optimizer_type","lr","weight_decay","num_warmup_steps"],"title":"OptimizerConfig"},"efficiency_config":{"description":"(Optional) Configuration for memory and compute optimizations","type":"object","properties":{"enable_activation_checkpointing":{"type":"boolean","default":false,"description":"(Optional) Whether to use activation checkpointing to reduce memory usage"},"enable_activation_offloading":{"type":"boolean","default":false,"description":"(Optional) Whether to offload activations to CPU to save GPU memory"},"memory_efficient_fsdp_wrap":{"type":"boolean","default":false,"description":"(Optional) Whether to use memory-efficient FSDP wrapping"},"fsdp_cpu_offload":{"type":"boolean","default":false,"description":"(Optional) Whether to offload FSDP parameters to CPU"}},"additionalProperties":false,"title":"EfficiencyConfig"},"dtype":{"type":"string","default":"bf16","description":"(Optional) Data type for model parameters (bf16, fp16, fp32)"}},"additionalProperties":false,"required":["n_epochs","max_steps_per_epoch","gradient_accumulation_steps"],"title":"TrainingConfig"},"hyperparam_search_config":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]},"description":"The hyperparam search configuration."},"logger_config":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]},"description":"The logger configuration."},"model":{"type":"string","description":"The model to fine-tune."},"checkpoint_dir":{"type":"string","description":"The directory to save checkpoint(s) to."},"algorithm_config":{"description":"The algorithm configuration.","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"LoRA","default":"LoRA","description":"Algorithm type identifier, always \"LoRA\""},"lora_attn_modules":{"type":"array","items":{"type":"string"},"description":"List of attention module names to apply LoRA to"},"apply_lora_to_mlp":{"type":"boolean","description":"Whether to apply LoRA to MLP layers"},"apply_lora_to_output":{"type":"boolean","description":"Whether to apply LoRA to output projection layers"},"rank":{"type":"integer","description":"Rank of the LoRA adaptation (lower rank = fewer parameters)"},"alpha":{"type":"integer","description":"LoRA scaling parameter that controls adaptation strength"},"use_dora":{"type":"boolean","default":false,"description":"(Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)"},"quantize_base":{"type":"boolean","default":false,"description":"(Optional) Whether to quantize the base model weights"}},"additionalProperties":false,"required":["type","lora_attn_modules","apply_lora_to_mlp","apply_lora_to_output","rank","alpha"],"title":"LoraFinetuningConfig","description":"Configuration for Low-Rank Adaptation (LoRA) fine-tuning."},{"type":"object","properties":{"type":{"type":"string","const":"QAT","default":"QAT","description":"Algorithm type identifier, always \"QAT\""},"quantizer_name":{"type":"string","description":"Name of the quantization algorithm to use"},"group_size":{"type":"integer","description":"Size of groups for grouped quantization"}},"additionalProperties":false,"required":["type","quantizer_name","group_size"],"title":"QATFinetuningConfig","description":"Configuration for Quantization-Aware Training (QAT) fine-tuning."}],"discriminator":{"propertyName":"type","mapping":{"LoRA":{"type":"object","properties":{"type":{"type":"string","const":"LoRA","default":"LoRA","description":"Algorithm type identifier, always \"LoRA\""},"lora_attn_modules":{"type":"array","items":{"type":"string"},"description":"List of attention module names to apply LoRA to"},"apply_lora_to_mlp":{"type":"boolean","description":"Whether to apply LoRA to MLP layers"},"apply_lora_to_output":{"type":"boolean","description":"Whether to apply LoRA to output projection layers"},"rank":{"type":"integer","description":"Rank of the LoRA adaptation (lower rank = fewer parameters)"},"alpha":{"type":"integer","description":"LoRA scaling parameter that controls adaptation strength"},"use_dora":{"type":"boolean","default":false,"description":"(Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)"},"quantize_base":{"type":"boolean","default":false,"description":"(Optional) Whether to quantize the base model weights"}},"additionalProperties":false,"required":["type","lora_attn_modules","apply_lora_to_mlp","apply_lora_to_output","rank","alpha"],"title":"LoraFinetuningConfig","description":"Configuration for Low-Rank Adaptation (LoRA) fine-tuning."},"QAT":{"type":"object","properties":{"type":{"type":"string","const":"QAT","default":"QAT","description":"Algorithm type identifier, always \"QAT\""},"quantizer_name":{"type":"string","description":"Name of the quantization algorithm to use"},"group_size":{"type":"integer","description":"Size of groups for grouped quantization"}},"additionalProperties":false,"required":["type","quantizer_name","group_size"],"title":"QATFinetuningConfig","description":"Configuration for Quantization-Aware Training (QAT) fine-tuning."}}},"title":"AlgorithmConfig"}},"additionalProperties":false,"required":["job_uuid","training_config","hyperparam_search_config","logger_config"],"title":"SupervisedFineTuneRequest"}}},"required":true}}
>
</RequestSchema>
<StatusCodes
id={undefined}
label={undefined}
responses={{"200":{"description":"A PostTrainingJob.","content":{"application/json":{"schema":{"type":"object","properties":{"job_uuid":{"type":"string"}},"additionalProperties":false,"required":["job_uuid"],"title":"PostTrainingJob"}}}},"400":{"description":"The request was invalid or malformed","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":400,"title":"Bad Request","detail":"The request was invalid or malformed"}}}},"429":{"description":"The client has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":429,"title":"Too Many Requests","detail":"You have exceeded the rate limit. Please try again later."}}}},"500":{"description":"The server encountered an unexpected error","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":500,"title":"Internal Server Error","detail":"An unexpected error occurred. Our team has been notified."}}}},"default":{"description":"An unexpected error occurred","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":0,"title":"Error","detail":"An unexpected error occurred"}}}}}}
>
</StatusCodes>