openai 4.76.2 → 4.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,9 +127,8 @@ export interface FineTuningJob {
127
127
  finished_at: number | null;
128
128
 
129
129
  /**
130
- * The hyperparameters used for the fine-tuning job. See the
131
- * [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
132
- * more details.
130
+ * The hyperparameters used for the fine-tuning job. This value will only be
131
+ * returned when running `supervised` jobs.
133
132
  */
134
133
  hyperparameters: FineTuningJob.Hyperparameters;
135
134
 
@@ -195,6 +194,11 @@ export interface FineTuningJob {
195
194
  * A list of integrations to enable for this fine-tuning job.
196
195
  */
197
196
  integrations?: Array<FineTuningJobWandbIntegrationObject> | null;
197
+
198
+ /**
199
+ * The method used for fine-tuning.
200
+ */
201
+ method?: FineTuningJob.Method;
198
202
  }
199
203
 
200
204
  export namespace FineTuningJob {
@@ -221,18 +225,125 @@ export namespace FineTuningJob {
221
225
  }
222
226
 
223
227
  /**
224
- * The hyperparameters used for the fine-tuning job. See the
225
- * [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for
226
- * more details.
228
+ * The hyperparameters used for the fine-tuning job. This value will only be
229
+ * returned when running `supervised` jobs.
227
230
  */
228
231
  export interface Hyperparameters {
232
+ /**
233
+ * Number of examples in each batch. A larger batch size means that model
234
+ * parameters are updated less frequently, but with lower variance.
235
+ */
236
+ batch_size?: 'auto' | number;
237
+
238
+ /**
239
+ * Scaling factor for the learning rate. A smaller learning rate may be useful to
240
+ * avoid overfitting.
241
+ */
242
+ learning_rate_multiplier?: 'auto' | number;
243
+
229
244
  /**
230
245
  * The number of epochs to train the model for. An epoch refers to one full cycle
231
- * through the training dataset. "auto" decides the optimal number of epochs based
232
- * on the size of the dataset. If setting the number manually, we support any
233
- * number between 1 and 50 epochs.
246
+ * through the training dataset.
247
+ */
248
+ n_epochs?: 'auto' | number;
249
+ }
250
+
251
+ /**
252
+ * The method used for fine-tuning.
253
+ */
254
+ export interface Method {
255
+ /**
256
+ * Configuration for the DPO fine-tuning method.
257
+ */
258
+ dpo?: Method.Dpo;
259
+
260
+ /**
261
+ * Configuration for the supervised fine-tuning method.
234
262
  */
235
- n_epochs: 'auto' | number;
263
+ supervised?: Method.Supervised;
264
+
265
+ /**
266
+ * The type of method. Is either `supervised` or `dpo`.
267
+ */
268
+ type?: 'supervised' | 'dpo';
269
+ }
270
+
271
+ export namespace Method {
272
+ /**
273
+ * Configuration for the DPO fine-tuning method.
274
+ */
275
+ export interface Dpo {
276
+ /**
277
+ * The hyperparameters used for the fine-tuning job.
278
+ */
279
+ hyperparameters?: Dpo.Hyperparameters;
280
+ }
281
+
282
+ export namespace Dpo {
283
+ /**
284
+ * The hyperparameters used for the fine-tuning job.
285
+ */
286
+ export interface Hyperparameters {
287
+ /**
288
+ * Number of examples in each batch. A larger batch size means that model
289
+ * parameters are updated less frequently, but with lower variance.
290
+ */
291
+ batch_size?: 'auto' | number;
292
+
293
+ /**
294
+ * The beta value for the DPO method. A higher beta value will increase the weight
295
+ * of the penalty between the policy and reference model.
296
+ */
297
+ beta?: 'auto' | number;
298
+
299
+ /**
300
+ * Scaling factor for the learning rate. A smaller learning rate may be useful to
301
+ * avoid overfitting.
302
+ */
303
+ learning_rate_multiplier?: 'auto' | number;
304
+
305
+ /**
306
+ * The number of epochs to train the model for. An epoch refers to one full cycle
307
+ * through the training dataset.
308
+ */
309
+ n_epochs?: 'auto' | number;
310
+ }
311
+ }
312
+
313
+ /**
314
+ * Configuration for the supervised fine-tuning method.
315
+ */
316
+ export interface Supervised {
317
+ /**
318
+ * The hyperparameters used for the fine-tuning job.
319
+ */
320
+ hyperparameters?: Supervised.Hyperparameters;
321
+ }
322
+
323
+ export namespace Supervised {
324
+ /**
325
+ * The hyperparameters used for the fine-tuning job.
326
+ */
327
+ export interface Hyperparameters {
328
+ /**
329
+ * Number of examples in each batch. A larger batch size means that model
330
+ * parameters are updated less frequently, but with lower variance.
331
+ */
332
+ batch_size?: 'auto' | number;
333
+
334
+ /**
335
+ * Scaling factor for the learning rate. A smaller learning rate may be useful to
336
+ * avoid overfitting.
337
+ */
338
+ learning_rate_multiplier?: 'auto' | number;
339
+
340
+ /**
341
+ * The number of epochs to train the model for. An epoch refers to one full cycle
342
+ * through the training dataset.
343
+ */
344
+ n_epochs?: 'auto' | number;
345
+ }
346
+ }
236
347
  }
237
348
  }
238
349
 
@@ -240,15 +351,40 @@ export namespace FineTuningJob {
240
351
  * Fine-tuning job event object
241
352
  */
242
353
  export interface FineTuningJobEvent {
354
+ /**
355
+ * The object identifier.
356
+ */
243
357
  id: string;
244
358
 
359
+ /**
360
+ * The Unix timestamp (in seconds) for when the fine-tuning job was created.
361
+ */
245
362
  created_at: number;
246
363
 
364
+ /**
365
+ * The log level of the event.
366
+ */
247
367
  level: 'info' | 'warn' | 'error';
248
368
 
369
+ /**
370
+ * The message of the event.
371
+ */
249
372
  message: string;
250
373
 
374
+ /**
375
+ * The object type, which is always "fine_tuning.job.event".
376
+ */
251
377
  object: 'fine_tuning.job.event';
378
+
379
+ /**
380
+ * The data associated with the event.
381
+ */
382
+ data?: unknown;
383
+
384
+ /**
385
+ * The type of event.
386
+ */
387
+ type?: 'message' | 'metrics';
252
388
  }
253
389
 
254
390
  export type FineTuningJobIntegration = FineTuningJobWandbIntegrationObject;
@@ -318,8 +454,10 @@ export interface JobCreateParams {
318
454
  * your file with the purpose `fine-tune`.
319
455
  *
320
456
  * The contents of the file should differ depending on if the model uses the
321
- * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
457
+ * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input),
322
458
  * [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
459
+ * format, or if the fine-tuning method uses the
460
+ * [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input)
323
461
  * format.
324
462
  *
325
463
  * See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
@@ -328,7 +466,8 @@ export interface JobCreateParams {
328
466
  training_file: string;
329
467
 
330
468
  /**
331
- * The hyperparameters used for the fine-tuning job.
469
+ * The hyperparameters used for the fine-tuning job. This value is now deprecated
470
+ * in favor of `method`, and should be passed in under the `method` parameter.
332
471
  */
333
472
  hyperparameters?: JobCreateParams.Hyperparameters;
334
473
 
@@ -337,6 +476,11 @@ export interface JobCreateParams {
337
476
  */
338
477
  integrations?: Array<JobCreateParams.Integration> | null;
339
478
 
479
+ /**
480
+ * The method used for fine-tuning.
481
+ */
482
+ method?: JobCreateParams.Method;
483
+
340
484
  /**
341
485
  * The seed controls the reproducibility of the job. Passing in the same seed and
342
486
  * job parameters should produce the same results, but may differ in rare cases. If
@@ -372,7 +516,9 @@ export interface JobCreateParams {
372
516
 
373
517
  export namespace JobCreateParams {
374
518
  /**
375
- * The hyperparameters used for the fine-tuning job.
519
+ * @deprecated: The hyperparameters used for the fine-tuning job. This value is now
520
+ * deprecated in favor of `method`, and should be passed in under the `method`
521
+ * parameter.
376
522
  */
377
523
  export interface Hyperparameters {
378
524
  /**
@@ -444,6 +590,104 @@ export namespace JobCreateParams {
444
590
  tags?: Array<string>;
445
591
  }
446
592
  }
593
+
594
+ /**
595
+ * The method used for fine-tuning.
596
+ */
597
+ export interface Method {
598
+ /**
599
+ * Configuration for the DPO fine-tuning method.
600
+ */
601
+ dpo?: Method.Dpo;
602
+
603
+ /**
604
+ * Configuration for the supervised fine-tuning method.
605
+ */
606
+ supervised?: Method.Supervised;
607
+
608
+ /**
609
+ * The type of method. Is either `supervised` or `dpo`.
610
+ */
611
+ type?: 'supervised' | 'dpo';
612
+ }
613
+
614
+ export namespace Method {
615
+ /**
616
+ * Configuration for the DPO fine-tuning method.
617
+ */
618
+ export interface Dpo {
619
+ /**
620
+ * The hyperparameters used for the fine-tuning job.
621
+ */
622
+ hyperparameters?: Dpo.Hyperparameters;
623
+ }
624
+
625
+ export namespace Dpo {
626
+ /**
627
+ * The hyperparameters used for the fine-tuning job.
628
+ */
629
+ export interface Hyperparameters {
630
+ /**
631
+ * Number of examples in each batch. A larger batch size means that model
632
+ * parameters are updated less frequently, but with lower variance.
633
+ */
634
+ batch_size?: 'auto' | number;
635
+
636
+ /**
637
+ * The beta value for the DPO method. A higher beta value will increase the weight
638
+ * of the penalty between the policy and reference model.
639
+ */
640
+ beta?: 'auto' | number;
641
+
642
+ /**
643
+ * Scaling factor for the learning rate. A smaller learning rate may be useful to
644
+ * avoid overfitting.
645
+ */
646
+ learning_rate_multiplier?: 'auto' | number;
647
+
648
+ /**
649
+ * The number of epochs to train the model for. An epoch refers to one full cycle
650
+ * through the training dataset.
651
+ */
652
+ n_epochs?: 'auto' | number;
653
+ }
654
+ }
655
+
656
+ /**
657
+ * Configuration for the supervised fine-tuning method.
658
+ */
659
+ export interface Supervised {
660
+ /**
661
+ * The hyperparameters used for the fine-tuning job.
662
+ */
663
+ hyperparameters?: Supervised.Hyperparameters;
664
+ }
665
+
666
+ export namespace Supervised {
667
+ /**
668
+ * The hyperparameters used for the fine-tuning job.
669
+ */
670
+ export interface Hyperparameters {
671
+ /**
672
+ * Number of examples in each batch. A larger batch size means that model
673
+ * parameters are updated less frequently, but with lower variance.
674
+ */
675
+ batch_size?: 'auto' | number;
676
+
677
+ /**
678
+ * Scaling factor for the learning rate. A smaller learning rate may be useful to
679
+ * avoid overfitting.
680
+ */
681
+ learning_rate_multiplier?: 'auto' | number;
682
+
683
+ /**
684
+ * The number of epochs to train the model for. An epoch refers to one full cycle
685
+ * through the training dataset.
686
+ */
687
+ n_epochs?: 'auto' | number;
688
+ }
689
+ }
690
+ }
447
691
  }
448
692
 
449
693
  export interface JobListParams extends CursorPageParams {}
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.76.2'; // x-release-please-version
1
+ export const VERSION = '4.77.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.76.2";
1
+ export declare const VERSION = "4.77.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.76.2'; // x-release-please-version
4
+ exports.VERSION = '4.77.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.76.2'; // x-release-please-version
1
+ export const VERSION = '4.77.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map