go/resources/fine_tuning/subresources/methods/index.md +0 −796 deleted
File Deleted View Diff
1# Methods
2
3## Domain Types
4
5### Dpo Hyperparameters
6
7- `type DpoHyperparametersResp struct{…}`
8
9 The hyperparameters used for the DPO fine-tuning job.
10
11 - `BatchSize DpoHyperparametersBatchSizeUnionResp`
12
13 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
14
15 - `type Auto string`
16
17 - `const AutoAuto Auto = "auto"`
18
19 - `int64`
20
21 - `Beta DpoHyperparametersBetaUnionResp`
22
23 The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
24
25 - `type Auto string`
26
27 - `const AutoAuto Auto = "auto"`
28
29 - `float64`
30
31 - `LearningRateMultiplier DpoHyperparametersLearningRateMultiplierUnionResp`
32
33 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
34
35 - `type Auto string`
36
37 - `const AutoAuto Auto = "auto"`
38
39 - `float64`
40
41 - `NEpochs DpoHyperparametersNEpochsUnionResp`
42
43 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
44
45 - `type Auto string`
46
47 - `const AutoAuto Auto = "auto"`
48
49 - `int64`
50
51### Dpo Method
52
53- `type DpoMethod struct{…}`
54
55 Configuration for the DPO fine-tuning method.
56
57 - `Hyperparameters DpoHyperparametersResp`
58
59 The hyperparameters used for the DPO fine-tuning job.
60
61 - `BatchSize DpoHyperparametersBatchSizeUnionResp`
62
63 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
64
65 - `type Auto string`
66
67 - `const AutoAuto Auto = "auto"`
68
69 - `int64`
70
71 - `Beta DpoHyperparametersBetaUnionResp`
72
73 The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
74
75 - `type Auto string`
76
77 - `const AutoAuto Auto = "auto"`
78
79 - `float64`
80
81 - `LearningRateMultiplier DpoHyperparametersLearningRateMultiplierUnionResp`
82
83 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
84
85 - `type Auto string`
86
87 - `const AutoAuto Auto = "auto"`
88
89 - `float64`
90
91 - `NEpochs DpoHyperparametersNEpochsUnionResp`
92
93 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
94
95 - `type Auto string`
96
97 - `const AutoAuto Auto = "auto"`
98
99 - `int64`
100
101### Reinforcement Hyperparameters
102
103- `type ReinforcementHyperparametersResp struct{…}`
104
105 The hyperparameters used for the reinforcement fine-tuning job.
106
107 - `BatchSize ReinforcementHyperparametersBatchSizeUnionResp`
108
109 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
110
111 - `type Auto string`
112
113 - `const AutoAuto Auto = "auto"`
114
115 - `int64`
116
117 - `ComputeMultiplier ReinforcementHyperparametersComputeMultiplierUnionResp`
118
119 Multiplier on amount of compute used for exploring search space during training.
120
121 - `type Auto string`
122
123 - `const AutoAuto Auto = "auto"`
124
125 - `float64`
126
127 - `EvalInterval ReinforcementHyperparametersEvalIntervalUnionResp`
128
129 The number of training steps between evaluation runs.
130
131 - `type Auto string`
132
133 - `const AutoAuto Auto = "auto"`
134
135 - `int64`
136
137 - `EvalSamples ReinforcementHyperparametersEvalSamplesUnionResp`
138
139 Number of evaluation samples to generate per training step.
140
141 - `type Auto string`
142
143 - `const AutoAuto Auto = "auto"`
144
145 - `int64`
146
147 - `LearningRateMultiplier ReinforcementHyperparametersLearningRateMultiplierUnionResp`
148
149 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
150
151 - `type Auto string`
152
153 - `const AutoAuto Auto = "auto"`
154
155 - `float64`
156
157 - `NEpochs ReinforcementHyperparametersNEpochsUnionResp`
158
159 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
160
161 - `type Auto string`
162
163 - `const AutoAuto Auto = "auto"`
164
165 - `int64`
166
167 - `ReasoningEffort ReinforcementHyperparametersReasoningEffort`
168
169 Level of reasoning effort.
170
171 - `const ReinforcementHyperparametersReasoningEffortDefault ReinforcementHyperparametersReasoningEffort = "default"`
172
173 - `const ReinforcementHyperparametersReasoningEffortLow ReinforcementHyperparametersReasoningEffort = "low"`
174
175 - `const ReinforcementHyperparametersReasoningEffortMedium ReinforcementHyperparametersReasoningEffort = "medium"`
176
177 - `const ReinforcementHyperparametersReasoningEffortHigh ReinforcementHyperparametersReasoningEffort = "high"`
178
179### Reinforcement Method
180
181- `type ReinforcementMethod struct{…}`
182
183 Configuration for the reinforcement fine-tuning method.
184
185 - `Grader ReinforcementMethodGraderUnion`
186
187 The grader used for the fine-tuning job.
188
189 - `type StringCheckGrader struct{…}`
190
191 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
192
193 - `Input string`
194
195 The input text. This may include template strings.
196
197 - `Name string`
198
199 The name of the grader.
200
201 - `Operation StringCheckGraderOperation`
202
203 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
204
205 - `const StringCheckGraderOperationEq StringCheckGraderOperation = "eq"`
206
207 - `const StringCheckGraderOperationNe StringCheckGraderOperation = "ne"`
208
209 - `const StringCheckGraderOperationLike StringCheckGraderOperation = "like"`
210
211 - `const StringCheckGraderOperationIlike StringCheckGraderOperation = "ilike"`
212
213 - `Reference string`
214
215 The reference text. This may include template strings.
216
217 - `Type StringCheck`
218
219 The object type, which is always `string_check`.
220
221 - `const StringCheckStringCheck StringCheck = "string_check"`
222
223 - `type TextSimilarityGrader struct{…}`
224
225 A TextSimilarityGrader object which grades text based on similarity metrics.
226
227 - `EvaluationMetric TextSimilarityGraderEvaluationMetric`
228
229 The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,
230 `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,
231 or `rouge_l`.
232
233 - `const TextSimilarityGraderEvaluationMetricCosine TextSimilarityGraderEvaluationMetric = "cosine"`
234
235 - `const TextSimilarityGraderEvaluationMetricFuzzyMatch TextSimilarityGraderEvaluationMetric = "fuzzy_match"`
236
237 - `const TextSimilarityGraderEvaluationMetricBleu TextSimilarityGraderEvaluationMetric = "bleu"`
238
239 - `const TextSimilarityGraderEvaluationMetricGleu TextSimilarityGraderEvaluationMetric = "gleu"`
240
241 - `const TextSimilarityGraderEvaluationMetricMeteor TextSimilarityGraderEvaluationMetric = "meteor"`
242
243 - `const TextSimilarityGraderEvaluationMetricRouge1 TextSimilarityGraderEvaluationMetric = "rouge_1"`
244
245 - `const TextSimilarityGraderEvaluationMetricRouge2 TextSimilarityGraderEvaluationMetric = "rouge_2"`
246
247 - `const TextSimilarityGraderEvaluationMetricRouge3 TextSimilarityGraderEvaluationMetric = "rouge_3"`
248
249 - `const TextSimilarityGraderEvaluationMetricRouge4 TextSimilarityGraderEvaluationMetric = "rouge_4"`
250
251 - `const TextSimilarityGraderEvaluationMetricRouge5 TextSimilarityGraderEvaluationMetric = "rouge_5"`
252
253 - `const TextSimilarityGraderEvaluationMetricRougeL TextSimilarityGraderEvaluationMetric = "rouge_l"`
254
255 - `Input string`
256
257 The text being graded.
258
259 - `Name string`
260
261 The name of the grader.
262
263 - `Reference string`
264
265 The text being graded against.
266
267 - `Type TextSimilarity`
268
269 The type of grader.
270
271 - `const TextSimilarityTextSimilarity TextSimilarity = "text_similarity"`
272
273 - `type PythonGrader struct{…}`
274
275 A PythonGrader object that runs a python script on the input.
276
277 - `Name string`
278
279 The name of the grader.
280
281 - `Source string`
282
283 The source code of the python script.
284
285 - `Type Python`
286
287 The object type, which is always `python`.
288
289 - `const PythonPython Python = "python"`
290
291 - `ImageTag string`
292
293 The image tag to use for the python script.
294
295 - `type ScoreModelGrader struct{…}`
296
297 A ScoreModelGrader object that uses a model to assign a score to the input.
298
299 - `Input []ScoreModelGraderInput`
300
301 The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
302
303 - `Content ScoreModelGraderInputContentUnion`
304
305 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
306
307 - `string`
308
309 - `type ResponseInputText struct{…}`
310
311 A text input to the model.
312
313 - `Text string`
314
315 The text input to the model.
316
317 - `Type InputText`
318
319 The type of the input item. Always `input_text`.
320
321 - `const InputTextInputText InputText = "input_text"`
322
323 - `type ScoreModelGraderInputContentOutputText struct{…}`
324
325 A text output from the model.
326
327 - `Text string`
328
329 The text output from the model.
330
331 - `Type OutputText`
332
333 The type of the output text. Always `output_text`.
334
335 - `const OutputTextOutputText OutputText = "output_text"`
336
337 - `type ScoreModelGraderInputContentInputImage struct{…}`
338
339 An image input block used within EvalItem content arrays.
340
341 - `ImageURL string`
342
343 The URL of the image input.
344
345 - `Type InputImage`
346
347 The type of the image input. Always `input_image`.
348
349 - `const InputImageInputImage InputImage = "input_image"`
350
351 - `Detail string`
352
353 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
354
355 - `type ResponseInputAudio struct{…}`
356
357 An audio input to the model.
358
359 - `InputAudio ResponseInputAudioInputAudio`
360
361 - `Data string`
362
363 Base64-encoded audio data.
364
365 - `Format string`
366
367 The format of the audio data. Currently supported formats are `mp3` and
368 `wav`.
369
370 - `const ResponseInputAudioInputAudioFormatMP3 ResponseInputAudioInputAudioFormat = "mp3"`
371
372 - `const ResponseInputAudioInputAudioFormatWAV ResponseInputAudioInputAudioFormat = "wav"`
373
374 - `Type InputAudio`
375
376 The type of the input item. Always `input_audio`.
377
378 - `const InputAudioInputAudio InputAudio = "input_audio"`
379
380 - `type GraderInputs []GraderInputUnion`
381
382 A list of inputs, each of which may be either an input text, output text, input
383 image, or input audio object.
384
385 - `string`
386
387 - `type ResponseInputText struct{…}`
388
389 A text input to the model.
390
391 - `type GraderInputOutputText struct{…}`
392
393 A text output from the model.
394
395 - `Text string`
396
397 The text output from the model.
398
399 - `Type OutputText`
400
401 The type of the output text. Always `output_text`.
402
403 - `const OutputTextOutputText OutputText = "output_text"`
404
405 - `type GraderInputInputImage struct{…}`
406
407 An image input block used within EvalItem content arrays.
408
409 - `ImageURL string`
410
411 The URL of the image input.
412
413 - `Type InputImage`
414
415 The type of the image input. Always `input_image`.
416
417 - `const InputImageInputImage InputImage = "input_image"`
418
419 - `Detail string`
420
421 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
422
423 - `type ResponseInputAudio struct{…}`
424
425 An audio input to the model.
426
427 - `Role string`
428
429 The role of the message input. One of `user`, `assistant`, `system`, or
430 `developer`.
431
432 - `const ScoreModelGraderInputRoleUser ScoreModelGraderInputRole = "user"`
433
434 - `const ScoreModelGraderInputRoleAssistant ScoreModelGraderInputRole = "assistant"`
435
436 - `const ScoreModelGraderInputRoleSystem ScoreModelGraderInputRole = "system"`
437
438 - `const ScoreModelGraderInputRoleDeveloper ScoreModelGraderInputRole = "developer"`
439
440 - `Type string`
441
442 The type of the message input. Always `message`.
443
444 - `const ScoreModelGraderInputTypeMessage ScoreModelGraderInputType = "message"`
445
446 - `Model string`
447
448 The model to use for the evaluation.
449
450 - `Name string`
451
452 The name of the grader.
453
454 - `Type ScoreModel`
455
456 The object type, which is always `score_model`.
457
458 - `const ScoreModelScoreModel ScoreModel = "score_model"`
459
460 - `Range []float64`
461
462 The range of the score. Defaults to `[0, 1]`.
463
464 - `SamplingParams ScoreModelGraderSamplingParams`
465
466 The sampling parameters for the model.
467
468 - `MaxCompletionsTokens int64`
469
470 The maximum number of tokens the grader model may generate in its response.
471
472 - `ReasoningEffort ReasoningEffort`
473
474 Constrains effort on reasoning for
475 [reasoning models](https://platform.openai.com/docs/guides/reasoning).
476 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
477 reasoning effort can result in faster responses and fewer tokens used
478 on reasoning in a response.
479
480 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
481 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
482 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
483 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
484
485 - `const ReasoningEffortNone ReasoningEffort = "none"`
486
487 - `const ReasoningEffortMinimal ReasoningEffort = "minimal"`
488
489 - `const ReasoningEffortLow ReasoningEffort = "low"`
490
491 - `const ReasoningEffortMedium ReasoningEffort = "medium"`
492
493 - `const ReasoningEffortHigh ReasoningEffort = "high"`
494
495 - `const ReasoningEffortXhigh ReasoningEffort = "xhigh"`
496
497 - `Seed int64`
498
499 A seed value to initialize the randomness, during sampling.
500
501 - `Temperature float64`
502
503 A higher temperature increases randomness in the outputs.
504
505 - `TopP float64`
506
507 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
508
509 - `type MultiGrader struct{…}`
510
511 A MultiGrader object combines the output of multiple graders to produce a single score.
512
513 - `CalculateOutput string`
514
515 A formula to calculate the output based on grader results.
516
517 - `Graders MultiGraderGradersUnion`
518
519 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
520
521 - `type StringCheckGrader struct{…}`
522
523 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
524
525 - `type TextSimilarityGrader struct{…}`
526
527 A TextSimilarityGrader object which grades text based on similarity metrics.
528
529 - `type PythonGrader struct{…}`
530
531 A PythonGrader object that runs a python script on the input.
532
533 - `type ScoreModelGrader struct{…}`
534
535 A ScoreModelGrader object that uses a model to assign a score to the input.
536
537 - `type LabelModelGrader struct{…}`
538
539 A LabelModelGrader object which uses a model to assign labels to each item
540 in the evaluation.
541
542 - `Input []LabelModelGraderInput`
543
544 - `Content LabelModelGraderInputContentUnion`
545
546 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
547
548 - `string`
549
550 - `type ResponseInputText struct{…}`
551
552 A text input to the model.
553
554 - `type LabelModelGraderInputContentOutputText struct{…}`
555
556 A text output from the model.
557
558 - `Text string`
559
560 The text output from the model.
561
562 - `Type OutputText`
563
564 The type of the output text. Always `output_text`.
565
566 - `const OutputTextOutputText OutputText = "output_text"`
567
568 - `type LabelModelGraderInputContentInputImage struct{…}`
569
570 An image input block used within EvalItem content arrays.
571
572 - `ImageURL string`
573
574 The URL of the image input.
575
576 - `Type InputImage`
577
578 The type of the image input. Always `input_image`.
579
580 - `const InputImageInputImage InputImage = "input_image"`
581
582 - `Detail string`
583
584 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
585
586 - `type ResponseInputAudio struct{…}`
587
588 An audio input to the model.
589
590 - `type GraderInputs []GraderInputUnion`
591
592 A list of inputs, each of which may be either an input text, output text, input
593 image, or input audio object.
594
595 - `Role string`
596
597 The role of the message input. One of `user`, `assistant`, `system`, or
598 `developer`.
599
600 - `const LabelModelGraderInputRoleUser LabelModelGraderInputRole = "user"`
601
602 - `const LabelModelGraderInputRoleAssistant LabelModelGraderInputRole = "assistant"`
603
604 - `const LabelModelGraderInputRoleSystem LabelModelGraderInputRole = "system"`
605
606 - `const LabelModelGraderInputRoleDeveloper LabelModelGraderInputRole = "developer"`
607
608 - `Type string`
609
610 The type of the message input. Always `message`.
611
612 - `const LabelModelGraderInputTypeMessage LabelModelGraderInputType = "message"`
613
614 - `Labels []string`
615
616 The labels to assign to each item in the evaluation.
617
618 - `Model string`
619
620 The model to use for the evaluation. Must support structured outputs.
621
622 - `Name string`
623
624 The name of the grader.
625
626 - `PassingLabels []string`
627
628 The labels that indicate a passing result. Must be a subset of labels.
629
630 - `Type LabelModel`
631
632 The object type, which is always `label_model`.
633
634 - `const LabelModelLabelModel LabelModel = "label_model"`
635
636 - `Name string`
637
638 The name of the grader.
639
640 - `Type Multi`
641
642 The object type, which is always `multi`.
643
644 - `const MultiMulti Multi = "multi"`
645
646 - `Hyperparameters ReinforcementHyperparametersResp`
647
648 The hyperparameters used for the reinforcement fine-tuning job.
649
650 - `BatchSize ReinforcementHyperparametersBatchSizeUnionResp`
651
652 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
653
654 - `type Auto string`
655
656 - `const AutoAuto Auto = "auto"`
657
658 - `int64`
659
660 - `ComputeMultiplier ReinforcementHyperparametersComputeMultiplierUnionResp`
661
662 Multiplier on amount of compute used for exploring search space during training.
663
664 - `type Auto string`
665
666 - `const AutoAuto Auto = "auto"`
667
668 - `float64`
669
670 - `EvalInterval ReinforcementHyperparametersEvalIntervalUnionResp`
671
672 The number of training steps between evaluation runs.
673
674 - `type Auto string`
675
676 - `const AutoAuto Auto = "auto"`
677
678 - `int64`
679
680 - `EvalSamples ReinforcementHyperparametersEvalSamplesUnionResp`
681
682 Number of evaluation samples to generate per training step.
683
684 - `type Auto string`
685
686 - `const AutoAuto Auto = "auto"`
687
688 - `int64`
689
690 - `LearningRateMultiplier ReinforcementHyperparametersLearningRateMultiplierUnionResp`
691
692 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
693
694 - `type Auto string`
695
696 - `const AutoAuto Auto = "auto"`
697
698 - `float64`
699
700 - `NEpochs ReinforcementHyperparametersNEpochsUnionResp`
701
702 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
703
704 - `type Auto string`
705
706 - `const AutoAuto Auto = "auto"`
707
708 - `int64`
709
710 - `ReasoningEffort ReinforcementHyperparametersReasoningEffort`
711
712 Level of reasoning effort.
713
714 - `const ReinforcementHyperparametersReasoningEffortDefault ReinforcementHyperparametersReasoningEffort = "default"`
715
716 - `const ReinforcementHyperparametersReasoningEffortLow ReinforcementHyperparametersReasoningEffort = "low"`
717
718 - `const ReinforcementHyperparametersReasoningEffortMedium ReinforcementHyperparametersReasoningEffort = "medium"`
719
720 - `const ReinforcementHyperparametersReasoningEffortHigh ReinforcementHyperparametersReasoningEffort = "high"`
721
722### Supervised Hyperparameters
723
724- `type SupervisedHyperparametersResp struct{…}`
725
726 The hyperparameters used for the fine-tuning job.
727
728 - `BatchSize SupervisedHyperparametersBatchSizeUnionResp`
729
730 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
731
732 - `type Auto string`
733
734 - `const AutoAuto Auto = "auto"`
735
736 - `int64`
737
738 - `LearningRateMultiplier SupervisedHyperparametersLearningRateMultiplierUnionResp`
739
740 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
741
742 - `type Auto string`
743
744 - `const AutoAuto Auto = "auto"`
745
746 - `float64`
747
748 - `NEpochs SupervisedHyperparametersNEpochsUnionResp`
749
750 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
751
752 - `type Auto string`
753
754 - `const AutoAuto Auto = "auto"`
755
756 - `int64`
757
758### Supervised Method
759
760- `type SupervisedMethod struct{…}`
761
762 Configuration for the supervised fine-tuning method.
763
764 - `Hyperparameters SupervisedHyperparametersResp`
765
766 The hyperparameters used for the fine-tuning job.
767
768 - `BatchSize SupervisedHyperparametersBatchSizeUnionResp`
769
770 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
771
772 - `type Auto string`
773
774 - `const AutoAuto Auto = "auto"`
775
776 - `int64`
777
778 - `LearningRateMultiplier SupervisedHyperparametersLearningRateMultiplierUnionResp`
779
780 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
781
782 - `type Auto string`
783
784 - `const AutoAuto Auto = "auto"`
785
786 - `float64`
787
788 - `NEpochs SupervisedHyperparametersNEpochsUnionResp`
789
790 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
791
792 - `type Auto string`
793
794 - `const AutoAuto Auto = "auto"`
795
796 - `int64`