go/resources/fine_tuning/subresources/methods/index.md +0 −805 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 - `PromptCacheBreakpoint ResponseInputTextPromptCacheBreakpoint`
324
325 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
326
327 - `Mode Explicit`
328
329 The breakpoint mode. Always `explicit`.
330
331 - `const ExplicitExplicit Explicit = "explicit"`
332
333 - `type ScoreModelGraderInputContentOutputText struct{…}`
334
335 A text output from the model.
336
337 - `Text string`
338
339 The text output from the model.
340
341 - `Type OutputText`
342
343 The type of the output text. Always `output_text`.
344
345 - `const OutputTextOutputText OutputText = "output_text"`
346
347 - `type ScoreModelGraderInputContentInputImage struct{…}`
348
349 An image input block used within EvalItem content arrays.
350
351 - `ImageURL string`
352
353 The URL of the image input.
354
355 - `Type InputImage`
356
357 The type of the image input. Always `input_image`.
358
359 - `const InputImageInputImage InputImage = "input_image"`
360
361 - `Detail string`
362
363 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
364
365 - `type ResponseInputAudio struct{…}`
366
367 An audio input to the model.
368
369 - `InputAudio ResponseInputAudioInputAudio`
370
371 - `Data string`
372
373 Base64-encoded audio data.
374
375 - `Format string`
376
377 The format of the audio data. Currently supported formats are `mp3` and
378 `wav`.
379
380 - `const ResponseInputAudioInputAudioFormatMP3 ResponseInputAudioInputAudioFormat = "mp3"`
381
382 - `const ResponseInputAudioInputAudioFormatWAV ResponseInputAudioInputAudioFormat = "wav"`
383
384 - `Type InputAudio`
385
386 The type of the input item. Always `input_audio`.
387
388 - `const InputAudioInputAudio InputAudio = "input_audio"`
389
390 - `type GraderInputs []GraderInputUnion`
391
392 A list of inputs, each of which may be either an input text, output text, input
393 image, or input audio object.
394
395 - `string`
396
397 - `type ResponseInputText struct{…}`
398
399 A text input to the model.
400
401 - `type GraderInputOutputText struct{…}`
402
403 A text output from the model.
404
405 - `Text string`
406
407 The text output from the model.
408
409 - `Type OutputText`
410
411 The type of the output text. Always `output_text`.
412
413 - `const OutputTextOutputText OutputText = "output_text"`
414
415 - `type GraderInputInputImage struct{…}`
416
417 An image input block used within EvalItem content arrays.
418
419 - `ImageURL string`
420
421 The URL of the image input.
422
423 - `Type InputImage`
424
425 The type of the image input. Always `input_image`.
426
427 - `const InputImageInputImage InputImage = "input_image"`
428
429 - `Detail string`
430
431 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
432
433 - `type ResponseInputAudio struct{…}`
434
435 An audio input to the model.
436
437 - `Role string`
438
439 The role of the message input. One of `user`, `assistant`, `system`, or
440 `developer`.
441
442 - `const ScoreModelGraderInputRoleUser ScoreModelGraderInputRole = "user"`
443
444 - `const ScoreModelGraderInputRoleAssistant ScoreModelGraderInputRole = "assistant"`
445
446 - `const ScoreModelGraderInputRoleSystem ScoreModelGraderInputRole = "system"`
447
448 - `const ScoreModelGraderInputRoleDeveloper ScoreModelGraderInputRole = "developer"`
449
450 - `Type string`
451
452 The type of the message input. Always `message`.
453
454 - `const ScoreModelGraderInputTypeMessage ScoreModelGraderInputType = "message"`
455
456 - `Model string`
457
458 The model to use for the evaluation.
459
460 - `Name string`
461
462 The name of the grader.
463
464 - `Type ScoreModel`
465
466 The object type, which is always `score_model`.
467
468 - `const ScoreModelScoreModel ScoreModel = "score_model"`
469
470 - `Range []float64`
471
472 The range of the score. Defaults to `[0, 1]`.
473
474 - `SamplingParams ScoreModelGraderSamplingParams`
475
476 The sampling parameters for the model.
477
478 - `MaxCompletionsTokens int64`
479
480 The maximum number of tokens the grader model may generate in its response.
481
482 - `ReasoningEffort ReasoningEffort`
483
484 Constrains effort on reasoning for reasoning models. Currently supported
485 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
486 Reducing reasoning effort can result in faster responses and fewer tokens
487 used on reasoning in a response. Not all reasoning models support every
488 value. See the
489 [reasoning guide](https://platform.openai.com/docs/guides/reasoning)
490 for model-specific support.
491
492 - `const ReasoningEffortNone ReasoningEffort = "none"`
493
494 - `const ReasoningEffortMinimal ReasoningEffort = "minimal"`
495
496 - `const ReasoningEffortLow ReasoningEffort = "low"`
497
498 - `const ReasoningEffortMedium ReasoningEffort = "medium"`
499
500 - `const ReasoningEffortHigh ReasoningEffort = "high"`
501
502 - `const ReasoningEffortXhigh ReasoningEffort = "xhigh"`
503
504 - `const ReasoningEffortMax ReasoningEffort = "max"`
505
506 - `Seed int64`
507
508 A seed value to initialize the randomness, during sampling.
509
510 - `Temperature float64`
511
512 A higher temperature increases randomness in the outputs.
513
514 - `TopP float64`
515
516 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
517
518 - `type MultiGrader struct{…}`
519
520 A MultiGrader object combines the output of multiple graders to produce a single score.
521
522 - `CalculateOutput string`
523
524 A formula to calculate the output based on grader results.
525
526 - `Graders MultiGraderGradersUnion`
527
528 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
529
530 - `type StringCheckGrader struct{…}`
531
532 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
533
534 - `type TextSimilarityGrader struct{…}`
535
536 A TextSimilarityGrader object which grades text based on similarity metrics.
537
538 - `type PythonGrader struct{…}`
539
540 A PythonGrader object that runs a python script on the input.
541
542 - `type ScoreModelGrader struct{…}`
543
544 A ScoreModelGrader object that uses a model to assign a score to the input.
545
546 - `type LabelModelGrader struct{…}`
547
548 A LabelModelGrader object which uses a model to assign labels to each item
549 in the evaluation.
550
551 - `Input []LabelModelGraderInput`
552
553 - `Content LabelModelGraderInputContentUnion`
554
555 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.
556
557 - `string`
558
559 - `type ResponseInputText struct{…}`
560
561 A text input to the model.
562
563 - `type LabelModelGraderInputContentOutputText struct{…}`
564
565 A text output from the model.
566
567 - `Text string`
568
569 The text output from the model.
570
571 - `Type OutputText`
572
573 The type of the output text. Always `output_text`.
574
575 - `const OutputTextOutputText OutputText = "output_text"`
576
577 - `type LabelModelGraderInputContentInputImage struct{…}`
578
579 An image input block used within EvalItem content arrays.
580
581 - `ImageURL string`
582
583 The URL of the image input.
584
585 - `Type InputImage`
586
587 The type of the image input. Always `input_image`.
588
589 - `const InputImageInputImage InputImage = "input_image"`
590
591 - `Detail string`
592
593 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
594
595 - `type ResponseInputAudio struct{…}`
596
597 An audio input to the model.
598
599 - `type GraderInputs []GraderInputUnion`
600
601 A list of inputs, each of which may be either an input text, output text, input
602 image, or input audio object.
603
604 - `Role string`
605
606 The role of the message input. One of `user`, `assistant`, `system`, or
607 `developer`.
608
609 - `const LabelModelGraderInputRoleUser LabelModelGraderInputRole = "user"`
610
611 - `const LabelModelGraderInputRoleAssistant LabelModelGraderInputRole = "assistant"`
612
613 - `const LabelModelGraderInputRoleSystem LabelModelGraderInputRole = "system"`
614
615 - `const LabelModelGraderInputRoleDeveloper LabelModelGraderInputRole = "developer"`
616
617 - `Type string`
618
619 The type of the message input. Always `message`.
620
621 - `const LabelModelGraderInputTypeMessage LabelModelGraderInputType = "message"`
622
623 - `Labels []string`
624
625 The labels to assign to each item in the evaluation.
626
627 - `Model string`
628
629 The model to use for the evaluation. Must support structured outputs.
630
631 - `Name string`
632
633 The name of the grader.
634
635 - `PassingLabels []string`
636
637 The labels that indicate a passing result. Must be a subset of labels.
638
639 - `Type LabelModel`
640
641 The object type, which is always `label_model`.
642
643 - `const LabelModelLabelModel LabelModel = "label_model"`
644
645 - `Name string`
646
647 The name of the grader.
648
649 - `Type Multi`
650
651 The object type, which is always `multi`.
652
653 - `const MultiMulti Multi = "multi"`
654
655 - `Hyperparameters ReinforcementHyperparametersResp`
656
657 The hyperparameters used for the reinforcement fine-tuning job.
658
659 - `BatchSize ReinforcementHyperparametersBatchSizeUnionResp`
660
661 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
662
663 - `type Auto string`
664
665 - `const AutoAuto Auto = "auto"`
666
667 - `int64`
668
669 - `ComputeMultiplier ReinforcementHyperparametersComputeMultiplierUnionResp`
670
671 Multiplier on amount of compute used for exploring search space during training.
672
673 - `type Auto string`
674
675 - `const AutoAuto Auto = "auto"`
676
677 - `float64`
678
679 - `EvalInterval ReinforcementHyperparametersEvalIntervalUnionResp`
680
681 The number of training steps between evaluation runs.
682
683 - `type Auto string`
684
685 - `const AutoAuto Auto = "auto"`
686
687 - `int64`
688
689 - `EvalSamples ReinforcementHyperparametersEvalSamplesUnionResp`
690
691 Number of evaluation samples to generate per training step.
692
693 - `type Auto string`
694
695 - `const AutoAuto Auto = "auto"`
696
697 - `int64`
698
699 - `LearningRateMultiplier ReinforcementHyperparametersLearningRateMultiplierUnionResp`
700
701 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
702
703 - `type Auto string`
704
705 - `const AutoAuto Auto = "auto"`
706
707 - `float64`
708
709 - `NEpochs ReinforcementHyperparametersNEpochsUnionResp`
710
711 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
712
713 - `type Auto string`
714
715 - `const AutoAuto Auto = "auto"`
716
717 - `int64`
718
719 - `ReasoningEffort ReinforcementHyperparametersReasoningEffort`
720
721 Level of reasoning effort.
722
723 - `const ReinforcementHyperparametersReasoningEffortDefault ReinforcementHyperparametersReasoningEffort = "default"`
724
725 - `const ReinforcementHyperparametersReasoningEffortLow ReinforcementHyperparametersReasoningEffort = "low"`
726
727 - `const ReinforcementHyperparametersReasoningEffortMedium ReinforcementHyperparametersReasoningEffort = "medium"`
728
729 - `const ReinforcementHyperparametersReasoningEffortHigh ReinforcementHyperparametersReasoningEffort = "high"`
730
731### Supervised Hyperparameters
732
733- `type SupervisedHyperparametersResp struct{…}`
734
735 The hyperparameters used for the fine-tuning job.
736
737 - `BatchSize SupervisedHyperparametersBatchSizeUnionResp`
738
739 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
740
741 - `type Auto string`
742
743 - `const AutoAuto Auto = "auto"`
744
745 - `int64`
746
747 - `LearningRateMultiplier SupervisedHyperparametersLearningRateMultiplierUnionResp`
748
749 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
750
751 - `type Auto string`
752
753 - `const AutoAuto Auto = "auto"`
754
755 - `float64`
756
757 - `NEpochs SupervisedHyperparametersNEpochsUnionResp`
758
759 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
760
761 - `type Auto string`
762
763 - `const AutoAuto Auto = "auto"`
764
765 - `int64`
766
767### Supervised Method
768
769- `type SupervisedMethod struct{…}`
770
771 Configuration for the supervised fine-tuning method.
772
773 - `Hyperparameters SupervisedHyperparametersResp`
774
775 The hyperparameters used for the fine-tuning job.
776
777 - `BatchSize SupervisedHyperparametersBatchSizeUnionResp`
778
779 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
780
781 - `type Auto string`
782
783 - `const AutoAuto Auto = "auto"`
784
785 - `int64`
786
787 - `LearningRateMultiplier SupervisedHyperparametersLearningRateMultiplierUnionResp`
788
789 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
790
791 - `type Auto string`
792
793 - `const AutoAuto Auto = "auto"`
794
795 - `float64`
796
797 - `NEpochs SupervisedHyperparametersNEpochsUnionResp`
798
799 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
800
801 - `type Auto string`
802
803 - `const AutoAuto Auto = "auto"`
804
805 - `int64`