together 2.0.0a7__tar.gz → 2.0.0a9__tar.gz

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.
Files changed (244) hide show
  1. together-2.0.0a9/.release-please-manifest.json +3 -0
  2. {together-2.0.0a7 → together-2.0.0a9}/CHANGELOG.md +43 -0
  3. {together-2.0.0a7 → together-2.0.0a9}/PKG-INFO +3 -52
  4. {together-2.0.0a7 → together-2.0.0a9}/README.md +2 -51
  5. {together-2.0.0a7 → together-2.0.0a9}/api.md +2 -2
  6. {together-2.0.0a7 → together-2.0.0a9}/pyproject.toml +11 -9
  7. {together-2.0.0a7 → together-2.0.0a9}/requirements-dev.lock +5 -7
  8. {together-2.0.0a7 → together-2.0.0a9}/src/together/_streaming.py +50 -48
  9. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_utils.py +1 -1
  10. {together-2.0.0a7 → together-2.0.0a9}/src/together/_version.py +1 -1
  11. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/endpoints.py +3 -4
  12. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/types/fine_tuning.py +72 -14
  13. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/transcriptions.py +20 -0
  14. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/fine_tuning.py +4 -4
  15. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/images.py +13 -1
  16. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/videos.py +4 -5
  17. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/__init__.py +0 -1
  18. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/transcription_create_params.py +14 -0
  19. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_delete_params.py +2 -2
  20. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/image_generate_params.py +9 -0
  21. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/audio/test_transcriptions.py +4 -0
  22. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_fine_tuning.py +14 -6
  23. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_images.py +2 -0
  24. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_videos.py +9 -9
  25. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_fine_tuning_resources.py +2 -0
  26. {together-2.0.0a7 → together-2.0.0a9}/uv.lock +66 -73
  27. together-2.0.0a7/.release-please-manifest.json +0 -3
  28. together-2.0.0a7/src/together/types/video_create_response.py +0 -10
  29. {together-2.0.0a7 → together-2.0.0a9}/.gitignore +0 -0
  30. {together-2.0.0a7 → together-2.0.0a9}/CONTRIBUTING.md +0 -0
  31. {together-2.0.0a7 → together-2.0.0a9}/LICENSE +0 -0
  32. {together-2.0.0a7 → together-2.0.0a9}/SECURITY.md +0 -0
  33. {together-2.0.0a7 → together-2.0.0a9}/bin/check-release-environment +0 -0
  34. {together-2.0.0a7 → together-2.0.0a9}/bin/publish-pypi +0 -0
  35. {together-2.0.0a7 → together-2.0.0a9}/examples/.keep +0 -0
  36. {together-2.0.0a7 → together-2.0.0a9}/examples/coqa-small.jsonl +0 -0
  37. {together-2.0.0a7 → together-2.0.0a9}/examples/coqa.jsonl +0 -0
  38. {together-2.0.0a7 → together-2.0.0a9}/examples/embedding.py +0 -0
  39. {together-2.0.0a7 → together-2.0.0a9}/examples/file-upload.py +0 -0
  40. {together-2.0.0a7 → together-2.0.0a9}/examples/files.py +0 -0
  41. {together-2.0.0a7 → together-2.0.0a9}/examples/fine_tuning.py +0 -0
  42. {together-2.0.0a7 → together-2.0.0a9}/examples/image.py +0 -0
  43. {together-2.0.0a7 → together-2.0.0a9}/examples/models.py +0 -0
  44. {together-2.0.0a7 → together-2.0.0a9}/examples/streaming.py +0 -0
  45. {together-2.0.0a7 → together-2.0.0a9}/release-please-config.json +0 -0
  46. {together-2.0.0a7 → together-2.0.0a9}/src/together/__init__.py +0 -0
  47. {together-2.0.0a7 → together-2.0.0a9}/src/together/_base_client.py +0 -0
  48. {together-2.0.0a7 → together-2.0.0a9}/src/together/_client.py +0 -0
  49. {together-2.0.0a7 → together-2.0.0a9}/src/together/_compat.py +0 -0
  50. {together-2.0.0a7 → together-2.0.0a9}/src/together/_constants.py +0 -0
  51. {together-2.0.0a7 → together-2.0.0a9}/src/together/_exceptions.py +0 -0
  52. {together-2.0.0a7 → together-2.0.0a9}/src/together/_files.py +0 -0
  53. {together-2.0.0a7 → together-2.0.0a9}/src/together/_models.py +0 -0
  54. {together-2.0.0a7 → together-2.0.0a9}/src/together/_qs.py +0 -0
  55. {together-2.0.0a7 → together-2.0.0a9}/src/together/_resource.py +0 -0
  56. {together-2.0.0a7 → together-2.0.0a9}/src/together/_response.py +0 -0
  57. {together-2.0.0a7 → together-2.0.0a9}/src/together/_types.py +0 -0
  58. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/__init__.py +0 -0
  59. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_compat.py +0 -0
  60. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_datetime_parse.py +0 -0
  61. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_logs.py +0 -0
  62. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_proxy.py +0 -0
  63. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_reflection.py +0 -0
  64. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_resources_proxy.py +0 -0
  65. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_streams.py +0 -0
  66. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_sync.py +0 -0
  67. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_transform.py +0 -0
  68. {together-2.0.0a7 → together-2.0.0a9}/src/together/_utils/_typing.py +0 -0
  69. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/.keep +0 -0
  70. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/__init__.py +0 -0
  71. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/__init__.py +0 -0
  72. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/__init__.py +0 -0
  73. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/evals.py +0 -0
  74. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/files.py +0 -0
  75. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/fine_tuning.py +0 -0
  76. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/models.py +0 -0
  77. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/api/utils.py +0 -0
  78. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/cli/cli.py +0 -0
  79. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/constants.py +0 -0
  80. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/resources/__init__.py +0 -0
  81. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/resources/files.py +0 -0
  82. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/resources/fine_tuning.py +0 -0
  83. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/resources/models.py +0 -0
  84. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/types/__init__.py +0 -0
  85. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/types/error.py +0 -0
  86. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/utils/__init__.py +0 -0
  87. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/utils/_log.py +0 -0
  88. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/utils/files.py +0 -0
  89. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/utils/serializer.py +0 -0
  90. {together-2.0.0a7 → together-2.0.0a9}/src/together/lib/utils/tools.py +0 -0
  91. {together-2.0.0a7 → together-2.0.0a9}/src/together/py.typed +0 -0
  92. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/__init__.py +0 -0
  93. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/__init__.py +0 -0
  94. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/audio.py +0 -0
  95. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/speech.py +0 -0
  96. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/translations.py +0 -0
  97. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/audio/voices.py +0 -0
  98. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/batches.py +0 -0
  99. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/chat/__init__.py +0 -0
  100. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/chat/chat.py +0 -0
  101. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/chat/completions.py +0 -0
  102. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/code_interpreter/__init__.py +0 -0
  103. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/code_interpreter/code_interpreter.py +0 -0
  104. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/code_interpreter/sessions.py +0 -0
  105. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/completions.py +0 -0
  106. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/embeddings.py +0 -0
  107. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/endpoints.py +0 -0
  108. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/evals.py +0 -0
  109. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/files.py +0 -0
  110. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/hardware.py +0 -0
  111. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/jobs.py +0 -0
  112. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/models.py +0 -0
  113. {together-2.0.0a7 → together-2.0.0a9}/src/together/resources/rerank.py +0 -0
  114. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/__init__.py +0 -0
  115. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/speech_create_params.py +0 -0
  116. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/transcription_create_response.py +0 -0
  117. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/translation_create_params.py +0 -0
  118. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/translation_create_response.py +0 -0
  119. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio/voice_list_response.py +0 -0
  120. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/audio_speech_stream_chunk.py +0 -0
  121. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/autoscaling.py +0 -0
  122. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/autoscaling_param.py +0 -0
  123. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/batch_create_params.py +0 -0
  124. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/batch_create_response.py +0 -0
  125. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/batch_job.py +0 -0
  126. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/batch_list_response.py +0 -0
  127. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/__init__.py +0 -0
  128. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion.py +0 -0
  129. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_chunk.py +0 -0
  130. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_structured_message_image_url_param.py +0 -0
  131. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_structured_message_text_param.py +0 -0
  132. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_structured_message_video_url_param.py +0 -0
  133. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_usage.py +0 -0
  134. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/chat_completion_warning.py +0 -0
  135. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/chat/completion_create_params.py +0 -0
  136. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/code_interpreter/__init__.py +0 -0
  137. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/code_interpreter/session_list_response.py +0 -0
  138. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/code_interpreter_execute_params.py +0 -0
  139. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/completion.py +0 -0
  140. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/completion_chunk.py +0 -0
  141. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/completion_create_params.py +0 -0
  142. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/dedicated_endpoint.py +0 -0
  143. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/embedding.py +0 -0
  144. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/embedding_create_params.py +0 -0
  145. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/endpoint_create_params.py +0 -0
  146. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/endpoint_list_avzones_response.py +0 -0
  147. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/endpoint_list_params.py +0 -0
  148. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/endpoint_list_response.py +0 -0
  149. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/endpoint_update_params.py +0 -0
  150. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/eval_create_params.py +0 -0
  151. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/eval_create_response.py +0 -0
  152. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/eval_list_params.py +0 -0
  153. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/eval_list_response.py +0 -0
  154. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/eval_status_response.py +0 -0
  155. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/evaluation_job.py +0 -0
  156. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/execute_response.py +0 -0
  157. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/file_delete_response.py +0 -0
  158. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/file_list.py +0 -0
  159. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/file_purpose.py +0 -0
  160. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/file_response.py +0 -0
  161. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/file_type.py +0 -0
  162. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_cancel_response.py +0 -0
  163. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_content_params.py +0 -0
  164. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_delete_response.py +0 -0
  165. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_list_checkpoints_response.py +0 -0
  166. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_list_events_response.py +0 -0
  167. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/fine_tuning_list_response.py +0 -0
  168. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/finetune_event.py +0 -0
  169. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/finetune_event_type.py +0 -0
  170. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/finetune_response.py +0 -0
  171. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/hardware_list_params.py +0 -0
  172. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/hardware_list_response.py +0 -0
  173. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/image_data_b64.py +0 -0
  174. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/image_data_url.py +0 -0
  175. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/image_file.py +0 -0
  176. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/job_list_response.py +0 -0
  177. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/job_retrieve_response.py +0 -0
  178. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/log_probs.py +0 -0
  179. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/model_list_response.py +0 -0
  180. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/model_object.py +0 -0
  181. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/model_upload_params.py +0 -0
  182. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/model_upload_response.py +0 -0
  183. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/rerank_create_params.py +0 -0
  184. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/rerank_create_response.py +0 -0
  185. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/tool_choice.py +0 -0
  186. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/tool_choice_param.py +0 -0
  187. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/tools_param.py +0 -0
  188. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/training_method_dpo.py +0 -0
  189. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/training_method_sft.py +0 -0
  190. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/video_create_params.py +0 -0
  191. {together-2.0.0a7 → together-2.0.0a9}/src/together/types/video_job.py +0 -0
  192. {together-2.0.0a7 → together-2.0.0a9}/tests/__init__.py +0 -0
  193. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/__init__.py +0 -0
  194. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/audio/__init__.py +0 -0
  195. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/audio/test_speech.py +0 -0
  196. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/audio/test_translations.py +0 -0
  197. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/audio/test_voices.py +0 -0
  198. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/chat/__init__.py +0 -0
  199. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/chat/test_completions.py +0 -0
  200. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/code_interpreter/__init__.py +0 -0
  201. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/code_interpreter/test_sessions.py +0 -0
  202. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_batches.py +0 -0
  203. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_code_interpreter.py +0 -0
  204. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_completions.py +0 -0
  205. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_embeddings.py +0 -0
  206. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_endpoints.py +0 -0
  207. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_evals.py +0 -0
  208. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_files.py +0 -0
  209. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_hardware.py +0 -0
  210. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_jobs.py +0 -0
  211. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_models.py +0 -0
  212. {together-2.0.0a7 → together-2.0.0a9}/tests/api_resources/test_rerank.py +0 -0
  213. {together-2.0.0a7 → together-2.0.0a9}/tests/conftest.py +0 -0
  214. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/__init__.py +0 -0
  215. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/constants.py +0 -0
  216. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/resources/__init__.py +0 -0
  217. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/resources/generate_hyperparameters.py +0 -0
  218. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/resources/test_completion.py +0 -0
  219. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/resources/test_completion_stream.py +0 -0
  220. {together-2.0.0a7 → together-2.0.0a9}/tests/integration/resources/test_files.py +0 -0
  221. {together-2.0.0a7 → together-2.0.0a9}/tests/sample_file.txt +0 -0
  222. {together-2.0.0a7 → together-2.0.0a9}/tests/test_client.py +0 -0
  223. {together-2.0.0a7 → together-2.0.0a9}/tests/test_deepcopy.py +0 -0
  224. {together-2.0.0a7 → together-2.0.0a9}/tests/test_extract_files.py +0 -0
  225. {together-2.0.0a7 → together-2.0.0a9}/tests/test_files.py +0 -0
  226. {together-2.0.0a7 → together-2.0.0a9}/tests/test_models.py +0 -0
  227. {together-2.0.0a7 → together-2.0.0a9}/tests/test_qs.py +0 -0
  228. {together-2.0.0a7 → together-2.0.0a9}/tests/test_required_args.py +0 -0
  229. {together-2.0.0a7 → together-2.0.0a9}/tests/test_response.py +0 -0
  230. {together-2.0.0a7 → together-2.0.0a9}/tests/test_streaming.py +0 -0
  231. {together-2.0.0a7 → together-2.0.0a9}/tests/test_transform.py +0 -0
  232. {together-2.0.0a7 → together-2.0.0a9}/tests/test_utils/test_datetime_parse.py +0 -0
  233. {together-2.0.0a7 → together-2.0.0a9}/tests/test_utils/test_proxy.py +0 -0
  234. {together-2.0.0a7 → together-2.0.0a9}/tests/test_utils/test_typing.py +0 -0
  235. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_async_client.py +0 -0
  236. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_client.py +0 -0
  237. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_code_interpreter.py +0 -0
  238. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_files_checks.py +0 -0
  239. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_files_resource.py +0 -0
  240. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_imports.py +0 -0
  241. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_multipart_upload_manager.py +0 -0
  242. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_preference_openai.py +0 -0
  243. {together-2.0.0a7 → together-2.0.0a9}/tests/unit/test_video_url.py +0 -0
  244. {together-2.0.0a7 → together-2.0.0a9}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.0.0-alpha.9"
3
+ }
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-alpha.9 (2025-12-03)
4
+
5
+ Full Changelog: [v2.0.0-alpha.8...v2.0.0-alpha.9](https://github.com/togethercomputer/together-py/compare/v2.0.0-alpha.8...v2.0.0-alpha.9)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([fa5e6f3](https://github.com/togethercomputer/together-py/commit/fa5e6f3eb27475ac2e377bbea9150d45bf4e141e))
10
+ * **api:** api update ([236996f](https://github.com/togethercomputer/together-py/commit/236996f0eba5c0a33d2da59b438a830684e89192))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * ensure streams are always closed ([db990c7](https://github.com/togethercomputer/together-py/commit/db990c744ebfffcfe48f52dc44b1ca7b47f1f79a))
16
+
17
+
18
+ ### Chores
19
+
20
+ * bump required `uv` version ([1dfec56](https://github.com/togethercomputer/together-py/commit/1dfec5659c5a8e6c8abc7a1035d602a3e47ff67a))
21
+ * **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([2235b95](https://github.com/togethercomputer/together-py/commit/2235b95d3e8dc11c9edc308e2b4b69b1463d21cb))
22
+ * **docs:** use environment variables for authentication in code snippets ([051c1b4](https://github.com/togethercomputer/together-py/commit/051c1b489cb80ded1ad60f6b8722512dd2efae3f))
23
+ * fix internal type issues ([4a2b0f1](https://github.com/togethercomputer/together-py/commit/4a2b0f1cfebc013102e21d54318269a0fe037b7a))
24
+ * update lockfile ([e93c953](https://github.com/togethercomputer/together-py/commit/e93c95338756fb37f279aec946d0c5f74cf22877))
25
+
26
+ ## 2.0.0-alpha.8 (2025-11-26)
27
+
28
+ Full Changelog: [v2.0.0-alpha.7...v2.0.0-alpha.8](https://github.com/togethercomputer/together-py/compare/v2.0.0-alpha.7...v2.0.0-alpha.8)
29
+
30
+ ### Features
31
+
32
+ * **api:** api update ([49bb5d4](https://github.com/togethercomputer/together-py/commit/49bb5d4ba69ca118ecc34be2d69c4253665e2e81))
33
+ * **api:** Fix internal references for VideoJob spec ([fb5e7bb](https://github.com/togethercomputer/together-py/commit/fb5e7bb3dbaa9427d291de7440c201529b6cf528))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * Address incorrect logic for `endpoint [command] --wait false` logic ([31236a9](https://github.com/togethercomputer/together-py/commit/31236a9df29c22fe7444c2dbb0d4bfc518bc79aa))
39
+
40
+
41
+ ### Chores
42
+
43
+ * Remove incorrect file upload docs ([5bb847e](https://github.com/togethercomputer/together-py/commit/5bb847e33b55e5d0978c742e86cf931a2c08f919))
44
+ * Remove incorrect file upload docs ([bb97093](https://github.com/togethercomputer/together-py/commit/bb970938650b6f9580538528979221d142f74b6a))
45
+
3
46
  ## 2.0.0-alpha.7 (2025-11-26)
4
47
 
5
48
  Full Changelog: [v2.0.0-alpha.6...v2.0.0-alpha.7](https://github.com/togethercomputer/together-py/compare/v2.0.0-alpha.6...v2.0.0-alpha.7)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 2.0.0a7
3
+ Version: 2.0.0a9
4
4
  Summary: The official Python library for the together API
5
5
  Project-URL: Homepage, https://github.com/togethercomputer/together-py
6
6
  Project-URL: Repository, https://github.com/togethercomputer/together-py
@@ -144,6 +144,7 @@ pip install 'together[aiohttp] @ git+ssh://git@github.com/togethercomputer/toget
144
144
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
145
145
 
146
146
  ```python
147
+ import os
147
148
  import asyncio
148
149
  from together import DefaultAioHttpClient
149
150
  from together import AsyncTogether
@@ -151,7 +152,7 @@ from together import AsyncTogether
151
152
 
152
153
  async def main() -> None:
153
154
  async with AsyncTogether(
154
- api_key="My API Key",
155
+ api_key=os.environ.get("TOGETHER_API_KEY"), # This is the default and can be omitted
155
156
  http_client=DefaultAioHttpClient(),
156
157
  ) as client:
157
158
  chat_completion = await client.chat.completions.create(
@@ -244,22 +245,6 @@ chat_completion = client.chat.completions.create(
244
245
  print(chat_completion.response_format)
245
246
  ```
246
247
 
247
- ## File uploads
248
-
249
- Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
250
-
251
- ```python
252
- from pathlib import Path
253
- from together import Together
254
-
255
- client = Together()
256
-
257
- client.files.upload(
258
- file=Path("/path/to/file"),
259
- purpose="fine-tune",
260
- )
261
- ```
262
-
263
248
  The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
264
249
 
265
250
  ## Handling errors
@@ -528,40 +513,6 @@ with Together() as client:
528
513
 
529
514
  ## Usage – CLI
530
515
 
531
- ### Chat Completions
532
-
533
- ```bash
534
- together chat.completions \
535
- --message "system" "You are a helpful assistant named Together" \
536
- --message "user" "What is your name?" \
537
- --model mistralai/Mixtral-8x7B-Instruct-v0.1
538
- ```
539
-
540
- The Chat Completions CLI enables streaming tokens to stdout by default. To disable streaming, use `--no-stream`.
541
-
542
- ### Completions
543
-
544
- ```bash
545
- together completions \
546
- "Large language models are " \
547
- --model mistralai/Mixtral-8x7B-v0.1 \
548
- --max-tokens 512 \
549
- --stop "."
550
- ```
551
-
552
- The Completions CLI enables streaming tokens to stdout by default. To disable streaming, use `--no-stream`.
553
-
554
- ### Image Generations
555
-
556
- ```bash
557
- together images generate \
558
- "space robots" \
559
- --model stabilityai/stable-diffusion-xl-base-1.0 \
560
- --n 4
561
- ```
562
-
563
- The image is opened in the default image viewer by default. To disable this, use `--no-show`.
564
-
565
516
  ### Files
566
517
 
567
518
  ```bash
@@ -98,6 +98,7 @@ pip install 'together[aiohttp] @ git+ssh://git@github.com/togethercomputer/toget
98
98
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
99
99
 
100
100
  ```python
101
+ import os
101
102
  import asyncio
102
103
  from together import DefaultAioHttpClient
103
104
  from together import AsyncTogether
@@ -105,7 +106,7 @@ from together import AsyncTogether
105
106
 
106
107
  async def main() -> None:
107
108
  async with AsyncTogether(
108
- api_key="My API Key",
109
+ api_key=os.environ.get("TOGETHER_API_KEY"), # This is the default and can be omitted
109
110
  http_client=DefaultAioHttpClient(),
110
111
  ) as client:
111
112
  chat_completion = await client.chat.completions.create(
@@ -198,22 +199,6 @@ chat_completion = client.chat.completions.create(
198
199
  print(chat_completion.response_format)
199
200
  ```
200
201
 
201
- ## File uploads
202
-
203
- Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
204
-
205
- ```python
206
- from pathlib import Path
207
- from together import Together
208
-
209
- client = Together()
210
-
211
- client.files.upload(
212
- file=Path("/path/to/file"),
213
- purpose="fine-tune",
214
- )
215
- ```
216
-
217
202
  The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
218
203
 
219
204
  ## Handling errors
@@ -482,40 +467,6 @@ with Together() as client:
482
467
 
483
468
  ## Usage – CLI
484
469
 
485
- ### Chat Completions
486
-
487
- ```bash
488
- together chat.completions \
489
- --message "system" "You are a helpful assistant named Together" \
490
- --message "user" "What is your name?" \
491
- --model mistralai/Mixtral-8x7B-Instruct-v0.1
492
- ```
493
-
494
- The Chat Completions CLI enables streaming tokens to stdout by default. To disable streaming, use `--no-stream`.
495
-
496
- ### Completions
497
-
498
- ```bash
499
- together completions \
500
- "Large language models are " \
501
- --model mistralai/Mixtral-8x7B-v0.1 \
502
- --max-tokens 512 \
503
- --stop "."
504
- ```
505
-
506
- The Completions CLI enables streaming tokens to stdout by default. To disable streaming, use `--no-stream`.
507
-
508
- ### Image Generations
509
-
510
- ```bash
511
- together images generate \
512
- "space robots" \
513
- --model stabilityai/stable-diffusion-xl-base-1.0 \
514
- --n 4
515
- ```
516
-
517
- The image is opened in the default image viewer by default. To disable this, use `--no-show`.
518
-
519
470
  ### Files
520
471
 
521
472
  ```bash
@@ -134,12 +134,12 @@ Methods:
134
134
  Types:
135
135
 
136
136
  ```python
137
- from together.types import VideoJob, VideoCreateResponse
137
+ from together.types import VideoJob
138
138
  ```
139
139
 
140
140
  Methods:
141
141
 
142
- - <code title="post /videos">client.videos.<a href="./src/together/resources/videos.py">create</a>(\*\*<a href="src/together/types/video_create_params.py">params</a>) -> <a href="./src/together/types/video_create_response.py">VideoCreateResponse</a></code>
142
+ - <code title="post /videos">client.videos.<a href="./src/together/resources/videos.py">create</a>(\*\*<a href="src/together/types/video_create_params.py">params</a>) -> <a href="./src/together/types/video_job.py">VideoJob</a></code>
143
143
  - <code title="get /videos/{id}">client.videos.<a href="./src/together/resources/videos.py">retrieve</a>(id) -> <a href="./src/together/types/video_job.py">VideoJob</a></code>
144
144
 
145
145
  # Audio
@@ -1,19 +1,20 @@
1
1
  [project]
2
2
  name = "together"
3
- version = "2.0.0-alpha.7"
3
+ version = "2.0.0-alpha.9"
4
4
  description = "The official Python library for the together API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
7
7
  authors = [
8
8
  { name = "Together", email = "dev-feedback@TogetherAI.com" },
9
9
  ]
10
+
10
11
  dependencies = [
11
- "httpx>=0.23.0, <1",
12
- "pydantic>=1.9.0, <3",
13
- "typing-extensions>=4.10, <5",
14
- "anyio>=3.5.0, <5",
15
- "distro>=1.7.0, <2",
16
- "sniffio",
12
+ "httpx>=0.23.0, <1",
13
+ "pydantic>=1.9.0, <3",
14
+ "typing-extensions>=4.10, <5",
15
+ "anyio>=3.5.0, <5",
16
+ "distro>=1.7.0, <2",
17
+ "sniffio",
17
18
  "click>=8.1.7",
18
19
  "rich>=13.7.1",
19
20
  "tabulate>=0.9.0",
@@ -23,6 +24,7 @@ dependencies = [
23
24
  "types-tqdm>=4.67.0.20250516",
24
25
  "filelock>=3.13.1",
25
26
  ]
27
+
26
28
  requires-python = ">= 3.9"
27
29
  classifiers = [
28
30
  "Typing :: Typed",
@@ -55,7 +57,7 @@ together = "together.lib.cli.cli:main"
55
57
 
56
58
  [tool.uv]
57
59
  managed = true
58
- required-version = ">=0.5.0"
60
+ required-version = ">=0.9"
59
61
  conflicts = [
60
62
  [
61
63
  { group = "pydantic-v1" },
@@ -67,7 +69,7 @@ conflicts = [
67
69
  # version pins are in uv.lock
68
70
  dev = [
69
71
  "pyright==1.1.399",
70
- "mypy",
72
+ "mypy==1.17",
71
73
  "respx",
72
74
  "pytest",
73
75
  "pytest-asyncio",
@@ -8,7 +8,7 @@ aiosignal==1.4.0
8
8
  # via aiohttp
9
9
  annotated-types==0.7.0
10
10
  # via pydantic
11
- anyio==4.11.0
11
+ anyio==4.12.0
12
12
  # via
13
13
  # httpx
14
14
  # together
@@ -76,7 +76,7 @@ multidict==6.7.0
76
76
  # via
77
77
  # aiohttp
78
78
  # yarl
79
- mypy==1.18.2
79
+ mypy==1.17.0
80
80
  mypy-extensions==1.1.0
81
81
  # via mypy
82
82
  nodeenv==1.9.1
@@ -95,7 +95,7 @@ propcache==0.4.1
95
95
  # via
96
96
  # aiohttp
97
97
  # yarl
98
- pydantic==2.12.4
98
+ pydantic==2.12.5
99
99
  # via together
100
100
  pydantic-core==2.41.5
101
101
  # via pydantic
@@ -123,13 +123,11 @@ python-dateutil==2.9.0.post0 ; python_full_version < '3.10'
123
123
  respx==0.22.0
124
124
  rich==14.2.0
125
125
  # via together
126
- ruff==0.14.6
126
+ ruff==0.14.7
127
127
  six==1.17.0 ; python_full_version < '3.10'
128
128
  # via python-dateutil
129
129
  sniffio==1.3.1
130
- # via
131
- # anyio
132
- # together
130
+ # via together
133
131
  tabulate==0.9.0
134
132
  # via together
135
133
  time-machine==2.19.0 ; python_full_version < '3.10'
@@ -55,30 +55,31 @@ class Stream(Generic[_T]):
55
55
  process_data = self._client._process_response_data
56
56
  iterator = self._iter_events()
57
57
 
58
- for sse in iterator:
59
- if sse.data.startswith("[DONE]"):
60
- break
61
-
62
- if sse.event is None:
63
- data = sse.json()
64
- if is_mapping(data) and data.get("error"):
65
- message = None
66
- error = data.get("error")
67
- if is_mapping(error):
68
- message = error.get("message")
69
- if not message or not isinstance(message, str):
70
- message = "An error occurred during streaming"
71
-
72
- raise APIError(
73
- message=message,
74
- request=self.response.request,
75
- body=data["error"],
76
- )
77
-
78
- yield process_data(data=data, cast_to=cast_to, response=response)
79
-
80
- # As we might not fully consume the response stream, we need to close it explicitly
81
- response.close()
58
+ try:
59
+ for sse in iterator:
60
+ if sse.data.startswith("[DONE]"):
61
+ break
62
+
63
+ if sse.event is None:
64
+ data = sse.json()
65
+ if is_mapping(data) and data.get("error"):
66
+ message = None
67
+ error = data.get("error")
68
+ if is_mapping(error):
69
+ message = error.get("message")
70
+ if not message or not isinstance(message, str):
71
+ message = "An error occurred during streaming"
72
+
73
+ raise APIError(
74
+ message=message,
75
+ request=self.response.request,
76
+ body=data["error"],
77
+ )
78
+
79
+ yield process_data(data=data, cast_to=cast_to, response=response)
80
+ finally:
81
+ # Ensure the response is closed even if the consumer doesn't read all data
82
+ response.close()
82
83
 
83
84
  def __enter__(self) -> Self:
84
85
  return self
@@ -137,30 +138,31 @@ class AsyncStream(Generic[_T]):
137
138
  process_data = self._client._process_response_data
138
139
  iterator = self._iter_events()
139
140
 
140
- async for sse in iterator:
141
- if sse.data.startswith("[DONE]"):
142
- break
143
-
144
- if sse.event is None:
145
- data = sse.json()
146
- if is_mapping(data) and data.get("error"):
147
- message = None
148
- error = data.get("error")
149
- if is_mapping(error):
150
- message = error.get("message")
151
- if not message or not isinstance(message, str):
152
- message = "An error occurred during streaming"
153
-
154
- raise APIError(
155
- message=message,
156
- request=self.response.request,
157
- body=data["error"],
158
- )
159
-
160
- yield process_data(data=data, cast_to=cast_to, response=response)
161
-
162
- # As we might not fully consume the response stream, we need to close it explicitly
163
- await response.aclose()
141
+ try:
142
+ async for sse in iterator:
143
+ if sse.data.startswith("[DONE]"):
144
+ break
145
+
146
+ if sse.event is None:
147
+ data = sse.json()
148
+ if is_mapping(data) and data.get("error"):
149
+ message = None
150
+ error = data.get("error")
151
+ if is_mapping(error):
152
+ message = error.get("message")
153
+ if not message or not isinstance(message, str):
154
+ message = "An error occurred during streaming"
155
+
156
+ raise APIError(
157
+ message=message,
158
+ request=self.response.request,
159
+ body=data["error"],
160
+ )
161
+
162
+ yield process_data(data=data, cast_to=cast_to, response=response)
163
+ finally:
164
+ # Ensure the response is closed even if the consumer doesn't read all data
165
+ await response.aclose()
164
166
 
165
167
  async def __aenter__(self) -> Self:
166
168
  return self
@@ -373,7 +373,7 @@ def get_required_header(headers: HeadersLike, header: str) -> str:
373
373
  lower_header = header.lower()
374
374
  if is_mapping_t(headers):
375
375
  # mypy doesn't understand the type narrowing here
376
- for k, v in headers.items(): # type: ignore[misc, has-type]
376
+ for k, v in headers.items(): # type: ignore[misc, has-type, attr-defined]
377
377
  if k.lower() == lower_header and isinstance(v, str): # type: ignore[has-type]
378
378
  return v # type: ignore[has-type]
379
379
 
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "together"
4
- __version__ = "2.0.0-alpha.7" # x-release-please-version
4
+ __version__ = "2.0.0-alpha.9" # x-release-please-version
@@ -128,8 +128,7 @@ def endpoints(ctx: click.Context) -> None:
128
128
  help="Start endpoint in specified availability zone (e.g., us-central-4b)",
129
129
  )
130
130
  @click.option(
131
- "--wait",
132
- is_flag=True,
131
+ "--wait/--no-wait",
133
132
  default=True,
134
133
  help="Wait for the endpoint to be ready after creation",
135
134
  )
@@ -272,7 +271,7 @@ def fetch_and_print_hardware_options(client: Together, model: str | None, print_
272
271
 
273
272
  @endpoints.command()
274
273
  @click.argument("endpoint-id", required=True)
275
- @click.option("--wait", is_flag=True, default=True, help="Wait for the endpoint to stop")
274
+ @click.option("--wait/--no-wait", default=True, help="Wait for the endpoint to stop")
276
275
  @click.pass_obj
277
276
  @handle_api_errors
278
277
  def stop(client: Together, endpoint_id: str, wait: bool) -> None:
@@ -293,7 +292,7 @@ def stop(client: Together, endpoint_id: str, wait: bool) -> None:
293
292
 
294
293
  @endpoints.command()
295
294
  @click.argument("endpoint-id", required=True)
296
- @click.option("--wait", is_flag=True, default=True, help="Wait for the endpoint to start")
295
+ @click.option("--wait/--no-wait", default=True, help="Wait for the endpoint to start")
297
296
  @click.pass_obj
298
297
  @handle_api_errors
299
298
  def start(client: Together, endpoint_id: str, wait: bool) -> None:
@@ -70,9 +70,6 @@ class FinetuneEventLevels(str, Enum):
70
70
  INFO = "Info"
71
71
  WARNING = "Warning"
72
72
  ERROR = "Error"
73
- LEGACY_INFO = "info"
74
- LEGACY_IWARNING = "warning"
75
- LEGACY_IERROR = "error"
76
73
 
77
74
 
78
75
  class FinetuneEvent(BaseModel):
@@ -85,7 +82,7 @@ class FinetuneEvent(BaseModel):
85
82
  # created at datetime stamp
86
83
  created_at: Union[str, None] = None
87
84
  # event log level
88
- level: Union[FinetuneEventLevels, None] = None
85
+ level: Union[FinetuneEventLevels, str, None] = None
89
86
  # event message string
90
87
  message: Union[str, None] = None
91
88
  # event type
@@ -120,7 +117,20 @@ class LoRATrainingType(BaseModel):
120
117
  type: Literal["Lora"] = "Lora"
121
118
 
122
119
 
123
- TrainingType: TypeAlias = Union[FullTrainingType, LoRATrainingType]
120
+ class UnknownTrainingType(BaseModel):
121
+ """
122
+ Catch-all for unknown training types (forward compatibility).
123
+ Accepts any training type not explicitly defined.
124
+ """
125
+
126
+ type: str
127
+
128
+
129
+ TrainingType: TypeAlias = Union[
130
+ FullTrainingType,
131
+ LoRATrainingType,
132
+ UnknownTrainingType,
133
+ ]
124
134
 
125
135
 
126
136
  class FinetuneFullTrainingLimits(BaseModel):
@@ -163,7 +173,19 @@ class TrainingMethodDPO(BaseModel):
163
173
  simpo_gamma: Union[float, None] = None
164
174
 
165
175
 
166
- TrainingMethod: TypeAlias = Union[TrainingMethodSFT, TrainingMethodDPO]
176
+ class TrainingMethodUnknown(BaseModel):
177
+ """
178
+ Catch-all for unknown training methods (forward compatibility).
179
+ Accepts any training method not explicitly defined.
180
+ """
181
+
182
+ method: str
183
+
184
+ TrainingMethod: TypeAlias = Union[
185
+ TrainingMethodSFT,
186
+ TrainingMethodDPO,
187
+ TrainingMethodUnknown,
188
+ ]
167
189
 
168
190
 
169
191
  class FinetuneTrainingLimits(BaseModel):
@@ -175,31 +197,67 @@ class FinetuneTrainingLimits(BaseModel):
175
197
 
176
198
 
177
199
  class LinearLRSchedulerArgs(BaseModel):
200
+ """
201
+ Linear learning rate scheduler arguments
202
+ """
203
+
178
204
  min_lr_ratio: Union[float, None] = 0.0
179
205
 
180
206
 
181
207
  class CosineLRSchedulerArgs(BaseModel):
208
+ """
209
+ Cosine learning rate scheduler arguments
210
+ """
211
+
182
212
  min_lr_ratio: Union[float, None] = 0.0
183
213
  num_cycles: Union[float, None] = 0.5
184
214
 
185
215
 
186
216
  class LinearLRScheduler(BaseModel):
217
+ """
218
+ Linear learning rate scheduler
219
+ """
220
+
187
221
  lr_scheduler_type: Literal["linear"] = "linear"
188
222
  lr_scheduler_args: Union[LinearLRSchedulerArgs, None] = None
189
223
 
190
224
 
191
225
  class CosineLRScheduler(BaseModel):
226
+ """
227
+ Cosine learning rate scheduler
228
+ """
229
+
192
230
  lr_scheduler_type: Literal["cosine"] = "cosine"
193
231
  lr_scheduler_args: Union[CosineLRSchedulerArgs, None] = None
194
232
 
195
233
 
196
- # placeholder for old fine-tuning jobs with no lr_scheduler_type specified
197
234
  class EmptyLRScheduler(BaseModel):
235
+ """
236
+ Empty learning rate scheduler
237
+
238
+ Placeholder for old fine-tuning jobs with no lr_scheduler_type specified
239
+ """
240
+
198
241
  lr_scheduler_type: Literal[""]
199
242
  lr_scheduler_args: None = None
200
243
 
244
+ class UnknownLRScheduler(BaseModel):
245
+ """
246
+ Unknown learning rate scheduler
247
+
248
+ Catch-all for unknown LR scheduler types (forward compatibility)
249
+ """
250
+
251
+ lr_scheduler_type: str
252
+ lr_scheduler_args: Optional[Any] = None
253
+
201
254
 
202
- FinetuneLRScheduler: TypeAlias = Union[LinearLRScheduler, CosineLRScheduler, EmptyLRScheduler]
255
+ FinetuneLRScheduler: TypeAlias = Union[
256
+ LinearLRScheduler,
257
+ CosineLRScheduler,
258
+ EmptyLRScheduler,
259
+ UnknownLRScheduler,
260
+ ]
203
261
 
204
262
 
205
263
  class FinetuneResponse(BaseModel):
@@ -213,8 +271,8 @@ class FinetuneResponse(BaseModel):
213
271
  created_at: datetime
214
272
  """Creation timestamp of the fine-tune job"""
215
273
 
216
- status: Optional[FinetuneJobStatus] = None
217
- """Status of the fine-tune job"""
274
+ status: Optional[Union[FinetuneJobStatus, str]] = None
275
+ """Status of the fine-tune job (accepts known enum values or string for forward compatibility)"""
218
276
 
219
277
  updated_at: datetime
220
278
  """Last update timestamp of the fine-tune job"""
@@ -222,8 +280,8 @@ class FinetuneResponse(BaseModel):
222
280
  batch_size: Optional[int] = None
223
281
  """Batch size used for training"""
224
282
 
225
- events: Optional[List[FinetuneEvent]] = None
226
- """Events related to this fine-tune job"""
283
+ events: Optional[List[Union[FinetuneEvent, str]]] = None
284
+ """Events related to this fine-tune job (accepts known enum values or string for forward compatibility)"""
227
285
 
228
286
  from_checkpoint: Optional[str] = None
229
287
  """Checkpoint used to continue training"""
@@ -361,7 +419,7 @@ class FinetuneRequest(BaseModel):
361
419
  # training learning rate
362
420
  learning_rate: float
363
421
  # learning rate scheduler type and args
364
- lr_scheduler: Union[LinearLRScheduler, CosineLRScheduler, None] = None
422
+ lr_scheduler: Union[FinetuneLRScheduler, None] = None
365
423
  # learning rate warmup ratio
366
424
  warmup_ratio: float
367
425
  # max gradient norm
@@ -387,7 +445,7 @@ class FinetuneRequest(BaseModel):
387
445
  # training type
388
446
  training_type: Union[TrainingType, None] = None
389
447
  # training method
390
- training_method: Union[TrainingMethodSFT, TrainingMethodDPO] = Field(default_factory=TrainingMethodSFT)
448
+ training_method: TrainingMethod = Field(default_factory=TrainingMethodSFT)
391
449
  # from step
392
450
  from_checkpoint: Union[str, None] = None
393
451
  from_hf_model: Union[str, None] = None