together 2.0.0a8__tar.gz → 2.0.0a10__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 (246) hide show
  1. together-2.0.0a10/.release-please-manifest.json +3 -0
  2. {together-2.0.0a8 → together-2.0.0a10}/CHANGELOG.md +46 -0
  3. {together-2.0.0a8 → together-2.0.0a10}/PKG-INFO +11 -12
  4. {together-2.0.0a8 → together-2.0.0a10}/README.md +10 -11
  5. {together-2.0.0a8 → together-2.0.0a10}/api.md +3 -1
  6. {together-2.0.0a8 → together-2.0.0a10}/pyproject.toml +11 -9
  7. {together-2.0.0a8 → together-2.0.0a10}/requirements-dev.lock +5 -7
  8. {together-2.0.0a8 → together-2.0.0a10}/src/together/_streaming.py +50 -48
  9. {together-2.0.0a8 → together-2.0.0a10}/src/together/_types.py +3 -2
  10. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_utils.py +1 -1
  11. {together-2.0.0a8 → together-2.0.0a10}/src/together/_version.py +1 -1
  12. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/fine_tuning.py +65 -3
  13. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/models.py +1 -6
  14. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/fine_tuning.py +41 -2
  15. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/transcriptions.py +20 -0
  16. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/completions.py +48 -0
  17. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/fine_tuning.py +213 -5
  18. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/images.py +13 -1
  19. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/models.py +41 -5
  20. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/__init__.py +3 -0
  21. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/transcription_create_params.py +14 -0
  22. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/voice_list_response.py +4 -0
  23. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/autoscaling.py +2 -0
  24. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/autoscaling_param.py +2 -0
  25. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/completion_create_params.py +78 -5
  26. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/dedicated_endpoint.py +2 -0
  27. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_avzones_response.py +2 -0
  28. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_response.py +2 -0
  29. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/execute_response.py +7 -0
  30. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_cancel_response.py +6 -0
  31. together-2.0.0a10/src/together/types/fine_tuning_estimate_price_params.py +98 -0
  32. together-2.0.0a10/src/together/types/fine_tuning_estimate_price_response.py +24 -0
  33. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_response.py +6 -0
  34. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/hardware_list_response.py +8 -0
  35. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_generate_params.py +9 -0
  36. together-2.0.0a10/src/together/types/model_list_params.py +12 -0
  37. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/video_job.py +8 -0
  38. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_transcriptions.py +4 -0
  39. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/chat/test_completions.py +4 -16
  40. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_fine_tuning.py +97 -0
  41. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_images.py +2 -0
  42. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_models.py +14 -0
  43. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_fine_tuning_resources.py +8 -8
  44. {together-2.0.0a8 → together-2.0.0a10}/uv.lock +66 -73
  45. together-2.0.0a8/.release-please-manifest.json +0 -3
  46. together-2.0.0a8/src/together/lib/resources/models.py +0 -35
  47. {together-2.0.0a8 → together-2.0.0a10}/.gitignore +0 -0
  48. {together-2.0.0a8 → together-2.0.0a10}/CONTRIBUTING.md +0 -0
  49. {together-2.0.0a8 → together-2.0.0a10}/LICENSE +0 -0
  50. {together-2.0.0a8 → together-2.0.0a10}/SECURITY.md +0 -0
  51. {together-2.0.0a8 → together-2.0.0a10}/bin/check-release-environment +0 -0
  52. {together-2.0.0a8 → together-2.0.0a10}/bin/publish-pypi +0 -0
  53. {together-2.0.0a8 → together-2.0.0a10}/examples/.keep +0 -0
  54. {together-2.0.0a8 → together-2.0.0a10}/examples/coqa-small.jsonl +0 -0
  55. {together-2.0.0a8 → together-2.0.0a10}/examples/coqa.jsonl +0 -0
  56. {together-2.0.0a8 → together-2.0.0a10}/examples/embedding.py +0 -0
  57. {together-2.0.0a8 → together-2.0.0a10}/examples/file-upload.py +0 -0
  58. {together-2.0.0a8 → together-2.0.0a10}/examples/files.py +0 -0
  59. {together-2.0.0a8 → together-2.0.0a10}/examples/fine_tuning.py +0 -0
  60. {together-2.0.0a8 → together-2.0.0a10}/examples/image.py +0 -0
  61. {together-2.0.0a8 → together-2.0.0a10}/examples/models.py +0 -0
  62. {together-2.0.0a8 → together-2.0.0a10}/examples/streaming.py +0 -0
  63. {together-2.0.0a8 → together-2.0.0a10}/release-please-config.json +0 -0
  64. {together-2.0.0a8 → together-2.0.0a10}/src/together/__init__.py +0 -0
  65. {together-2.0.0a8 → together-2.0.0a10}/src/together/_base_client.py +0 -0
  66. {together-2.0.0a8 → together-2.0.0a10}/src/together/_client.py +0 -0
  67. {together-2.0.0a8 → together-2.0.0a10}/src/together/_compat.py +0 -0
  68. {together-2.0.0a8 → together-2.0.0a10}/src/together/_constants.py +0 -0
  69. {together-2.0.0a8 → together-2.0.0a10}/src/together/_exceptions.py +0 -0
  70. {together-2.0.0a8 → together-2.0.0a10}/src/together/_files.py +0 -0
  71. {together-2.0.0a8 → together-2.0.0a10}/src/together/_models.py +0 -0
  72. {together-2.0.0a8 → together-2.0.0a10}/src/together/_qs.py +0 -0
  73. {together-2.0.0a8 → together-2.0.0a10}/src/together/_resource.py +0 -0
  74. {together-2.0.0a8 → together-2.0.0a10}/src/together/_response.py +0 -0
  75. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/__init__.py +0 -0
  76. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_compat.py +0 -0
  77. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_datetime_parse.py +0 -0
  78. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_logs.py +0 -0
  79. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_proxy.py +0 -0
  80. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_reflection.py +0 -0
  81. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_resources_proxy.py +0 -0
  82. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_streams.py +0 -0
  83. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_sync.py +0 -0
  84. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_transform.py +0 -0
  85. {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_typing.py +0 -0
  86. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/.keep +0 -0
  87. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/__init__.py +0 -0
  88. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/__init__.py +0 -0
  89. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/__init__.py +0 -0
  90. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/endpoints.py +0 -0
  91. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/evals.py +0 -0
  92. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/files.py +0 -0
  93. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/utils.py +0 -0
  94. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/cli.py +0 -0
  95. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/constants.py +0 -0
  96. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/__init__.py +0 -0
  97. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/files.py +0 -0
  98. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/__init__.py +0 -0
  99. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/error.py +0 -0
  100. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/fine_tuning.py +0 -0
  101. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/__init__.py +0 -0
  102. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/_log.py +0 -0
  103. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/files.py +0 -0
  104. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/serializer.py +0 -0
  105. {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/tools.py +0 -0
  106. {together-2.0.0a8 → together-2.0.0a10}/src/together/py.typed +0 -0
  107. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/__init__.py +0 -0
  108. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/__init__.py +0 -0
  109. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/audio.py +0 -0
  110. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/speech.py +0 -0
  111. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/translations.py +0 -0
  112. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/voices.py +0 -0
  113. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/batches.py +0 -0
  114. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/__init__.py +0 -0
  115. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/chat.py +0 -0
  116. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/__init__.py +0 -0
  117. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/code_interpreter.py +0 -0
  118. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/sessions.py +0 -0
  119. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/completions.py +0 -0
  120. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/embeddings.py +0 -0
  121. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/endpoints.py +0 -0
  122. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/evals.py +0 -0
  123. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/files.py +0 -0
  124. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/hardware.py +0 -0
  125. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/jobs.py +0 -0
  126. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/rerank.py +0 -0
  127. {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/videos.py +0 -0
  128. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/__init__.py +0 -0
  129. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/speech_create_params.py +0 -0
  130. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/transcription_create_response.py +0 -0
  131. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/translation_create_params.py +0 -0
  132. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/translation_create_response.py +0 -0
  133. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio_speech_stream_chunk.py +0 -0
  134. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_create_params.py +0 -0
  135. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_create_response.py +0 -0
  136. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_job.py +0 -0
  137. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_list_response.py +0 -0
  138. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/__init__.py +0 -0
  139. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion.py +0 -0
  140. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_chunk.py +0 -0
  141. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_image_url_param.py +0 -0
  142. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_text_param.py +0 -0
  143. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_video_url_param.py +0 -0
  144. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_usage.py +0 -0
  145. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_warning.py +0 -0
  146. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter/__init__.py +0 -0
  147. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter/session_list_response.py +0 -0
  148. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter_execute_params.py +0 -0
  149. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion.py +0 -0
  150. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion_chunk.py +0 -0
  151. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion_create_params.py +0 -0
  152. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/embedding.py +0 -0
  153. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/embedding_create_params.py +0 -0
  154. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_create_params.py +0 -0
  155. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_params.py +0 -0
  156. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_update_params.py +0 -0
  157. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_create_params.py +0 -0
  158. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_create_response.py +0 -0
  159. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_list_params.py +0 -0
  160. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_list_response.py +0 -0
  161. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_status_response.py +0 -0
  162. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/evaluation_job.py +0 -0
  163. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_delete_response.py +0 -0
  164. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_list.py +0 -0
  165. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_purpose.py +0 -0
  166. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_response.py +0 -0
  167. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_type.py +0 -0
  168. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_content_params.py +0 -0
  169. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_delete_params.py +0 -0
  170. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_delete_response.py +0 -0
  171. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_checkpoints_response.py +0 -0
  172. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_events_response.py +0 -0
  173. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_event.py +0 -0
  174. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_event_type.py +0 -0
  175. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_response.py +0 -0
  176. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/hardware_list_params.py +0 -0
  177. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_data_b64.py +0 -0
  178. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_data_url.py +0 -0
  179. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_file.py +0 -0
  180. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/job_list_response.py +0 -0
  181. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/job_retrieve_response.py +0 -0
  182. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/log_probs.py +0 -0
  183. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_list_response.py +0 -0
  184. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_object.py +0 -0
  185. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_upload_params.py +0 -0
  186. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_upload_response.py +0 -0
  187. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/rerank_create_params.py +0 -0
  188. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/rerank_create_response.py +0 -0
  189. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tool_choice.py +0 -0
  190. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tool_choice_param.py +0 -0
  191. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tools_param.py +0 -0
  192. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/training_method_dpo.py +0 -0
  193. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/training_method_sft.py +0 -0
  194. {together-2.0.0a8 → together-2.0.0a10}/src/together/types/video_create_params.py +0 -0
  195. {together-2.0.0a8 → together-2.0.0a10}/tests/__init__.py +0 -0
  196. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/__init__.py +0 -0
  197. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/__init__.py +0 -0
  198. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_speech.py +0 -0
  199. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_translations.py +0 -0
  200. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_voices.py +0 -0
  201. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/chat/__init__.py +0 -0
  202. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/code_interpreter/__init__.py +0 -0
  203. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/code_interpreter/test_sessions.py +0 -0
  204. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_batches.py +0 -0
  205. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_code_interpreter.py +0 -0
  206. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_completions.py +0 -0
  207. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_embeddings.py +0 -0
  208. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_endpoints.py +0 -0
  209. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_evals.py +0 -0
  210. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_files.py +0 -0
  211. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_hardware.py +0 -0
  212. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_jobs.py +0 -0
  213. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_rerank.py +0 -0
  214. {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_videos.py +0 -0
  215. {together-2.0.0a8 → together-2.0.0a10}/tests/conftest.py +0 -0
  216. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/__init__.py +0 -0
  217. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/constants.py +0 -0
  218. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/__init__.py +0 -0
  219. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/generate_hyperparameters.py +0 -0
  220. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_completion.py +0 -0
  221. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_completion_stream.py +0 -0
  222. {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_files.py +0 -0
  223. {together-2.0.0a8 → together-2.0.0a10}/tests/sample_file.txt +0 -0
  224. {together-2.0.0a8 → together-2.0.0a10}/tests/test_client.py +0 -0
  225. {together-2.0.0a8 → together-2.0.0a10}/tests/test_deepcopy.py +0 -0
  226. {together-2.0.0a8 → together-2.0.0a10}/tests/test_extract_files.py +0 -0
  227. {together-2.0.0a8 → together-2.0.0a10}/tests/test_files.py +0 -0
  228. {together-2.0.0a8 → together-2.0.0a10}/tests/test_models.py +0 -0
  229. {together-2.0.0a8 → together-2.0.0a10}/tests/test_qs.py +0 -0
  230. {together-2.0.0a8 → together-2.0.0a10}/tests/test_required_args.py +0 -0
  231. {together-2.0.0a8 → together-2.0.0a10}/tests/test_response.py +0 -0
  232. {together-2.0.0a8 → together-2.0.0a10}/tests/test_streaming.py +0 -0
  233. {together-2.0.0a8 → together-2.0.0a10}/tests/test_transform.py +0 -0
  234. {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_datetime_parse.py +0 -0
  235. {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_proxy.py +0 -0
  236. {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_typing.py +0 -0
  237. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_async_client.py +0 -0
  238. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_client.py +0 -0
  239. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_code_interpreter.py +0 -0
  240. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_files_checks.py +0 -0
  241. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_files_resource.py +0 -0
  242. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_imports.py +0 -0
  243. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_multipart_upload_manager.py +0 -0
  244. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_preference_openai.py +0 -0
  245. {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_video_url.py +0 -0
  246. {together-2.0.0a8 → together-2.0.0a10}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.0.0-alpha.10"
3
+ }
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-alpha.10 (2025-12-15)
4
+
5
+ Full Changelog: [v2.0.0-alpha.9...v2.0.0-alpha.10](https://github.com/togethercomputer/together-py/compare/v2.0.0-alpha.9...v2.0.0-alpha.10)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add fine_tuning.estimate_price api ([1582cc4](https://github.com/togethercomputer/together-py/commit/1582cc498e17562a3a23ae5120dfff2d39ae1e41))
10
+ * **api:** api update ([5341347](https://github.com/togethercomputer/together-py/commit/53413475daeeec382968407d47688cf7926f643c))
11
+ * **api:** api update ([96fc9b3](https://github.com/togethercomputer/together-py/commit/96fc9b3b1218bcf0c8dd13a28b8eab5c9690c6fd))
12
+ * **api:** api update ([e5cfa45](https://github.com/togethercomputer/together-py/commit/e5cfa45f476c77965a9249e9ae41b55b029abfaa))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **types:** allow pyright to infer TypedDict types within SequenceNotStr ([048f2b7](https://github.com/togethercomputer/together-py/commit/048f2b7d347aa2ab09a4b49c2770cbf15a70c3e4))
18
+
19
+
20
+ ### Chores
21
+
22
+ * add missing docstrings ([a1c8329](https://github.com/togethercomputer/together-py/commit/a1c8329a0c2562bcdbd22c262eb7a995bfbd0deb))
23
+ * **internal:** avoid using unstable Python versions in tests ([6268112](https://github.com/togethercomputer/together-py/commit/62681124a807a4f718e1711039242d2b9037e33b))
24
+ * Update model list CLI to use api parameter for dedicated filtering ([#195](https://github.com/togethercomputer/together-py/issues/195)) ([95cc672](https://github.com/togethercomputer/together-py/commit/95cc672583e2a908f54dd557cd0f22465da26a4b))
25
+
26
+ ## 2.0.0-alpha.9 (2025-12-03)
27
+
28
+ 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)
29
+
30
+ ### Features
31
+
32
+ * **api:** api update ([fa5e6f3](https://github.com/togethercomputer/together-py/commit/fa5e6f3eb27475ac2e377bbea9150d45bf4e141e))
33
+ * **api:** api update ([236996f](https://github.com/togethercomputer/together-py/commit/236996f0eba5c0a33d2da59b438a830684e89192))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * ensure streams are always closed ([db990c7](https://github.com/togethercomputer/together-py/commit/db990c744ebfffcfe48f52dc44b1ca7b47f1f79a))
39
+
40
+
41
+ ### Chores
42
+
43
+ * bump required `uv` version ([1dfec56](https://github.com/togethercomputer/together-py/commit/1dfec5659c5a8e6c8abc7a1035d602a3e47ff67a))
44
+ * **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([2235b95](https://github.com/togethercomputer/together-py/commit/2235b95d3e8dc11c9edc308e2b4b69b1463d21cb))
45
+ * **docs:** use environment variables for authentication in code snippets ([051c1b4](https://github.com/togethercomputer/together-py/commit/051c1b489cb80ded1ad60f6b8722512dd2efae3f))
46
+ * fix internal type issues ([4a2b0f1](https://github.com/togethercomputer/together-py/commit/4a2b0f1cfebc013102e21d54318269a0fe037b7a))
47
+ * update lockfile ([e93c953](https://github.com/togethercomputer/together-py/commit/e93c95338756fb37f279aec946d0c5f74cf22877))
48
+
3
49
  ## 2.0.0-alpha.8 (2025-11-26)
4
50
 
5
51
  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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 2.0.0a8
3
+ Version: 2.0.0a10
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(
@@ -231,17 +232,15 @@ from together import Together
231
232
 
232
233
  client = Together()
233
234
 
234
- chat_completion = client.chat.completions.create(
235
- messages=[
236
- {
237
- "content": "content",
238
- "role": "system",
239
- }
240
- ],
241
- model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
242
- response_format={},
235
+ dedicated_endpoint = client.endpoints.create(
236
+ autoscaling={
237
+ "max_replicas": 5,
238
+ "min_replicas": 2,
239
+ },
240
+ hardware="1x_nvidia_a100_80gb_sxm",
241
+ model="meta-llama/Llama-3-8b-chat-hf",
243
242
  )
244
- print(chat_completion.response_format)
243
+ print(dedicated_endpoint.autoscaling)
245
244
  ```
246
245
 
247
246
  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.
@@ -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(
@@ -185,17 +186,15 @@ from together import Together
185
186
 
186
187
  client = Together()
187
188
 
188
- chat_completion = client.chat.completions.create(
189
- messages=[
190
- {
191
- "content": "content",
192
- "role": "system",
193
- }
194
- ],
195
- model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
196
- response_format={},
189
+ dedicated_endpoint = client.endpoints.create(
190
+ autoscaling={
191
+ "max_replicas": 5,
192
+ "min_replicas": 2,
193
+ },
194
+ hardware="1x_nvidia_a100_80gb_sxm",
195
+ model="meta-llama/Llama-3-8b-chat-hf",
197
196
  )
198
- print(chat_completion.response_format)
197
+ print(dedicated_endpoint.autoscaling)
199
198
  ```
200
199
 
201
200
  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.
@@ -78,6 +78,7 @@ from together.types import (
78
78
  FineTuningListResponse,
79
79
  FineTuningDeleteResponse,
80
80
  FineTuningCancelResponse,
81
+ FineTuningEstimatePriceResponse,
81
82
  FineTuningListCheckpointsResponse,
82
83
  FineTuningListEventsResponse,
83
84
  )
@@ -90,6 +91,7 @@ Methods:
90
91
  - <code title="delete /fine-tunes/{id}">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">delete</a>(id, \*\*<a href="src/together/types/fine_tuning_delete_params.py">params</a>) -> <a href="./src/together/types/fine_tuning_delete_response.py">FineTuningDeleteResponse</a></code>
91
92
  - <code title="post /fine-tunes/{id}/cancel">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">cancel</a>(id) -> <a href="./src/together/types/fine_tuning_cancel_response.py">FineTuningCancelResponse</a></code>
92
93
  - <code title="get /finetune/download">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">content</a>(\*\*<a href="src/together/types/fine_tuning_content_params.py">params</a>) -> BinaryAPIResponse</code>
94
+ - <code title="post /fine-tunes/estimate-price">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">estimate_price</a>(\*\*<a href="src/together/types/fine_tuning_estimate_price_params.py">params</a>) -> <a href="./src/together/types/fine_tuning_estimate_price_response.py">FineTuningEstimatePriceResponse</a></code>
93
95
  - <code title="get /fine-tunes/{id}/checkpoints">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">list_checkpoints</a>(id) -> <a href="./src/together/types/fine_tuning_list_checkpoints_response.py">FineTuningListCheckpointsResponse</a></code>
94
96
  - <code title="get /fine-tunes/{id}/events">client.fine_tuning.<a href="./src/together/resources/fine_tuning.py">list_events</a>(id) -> <a href="./src/together/types/fine_tuning_list_events_response.py">FineTuningListEventsResponse</a></code>
95
97
 
@@ -202,7 +204,7 @@ from together.types import ModelObject, ModelListResponse, ModelUploadResponse
202
204
 
203
205
  Methods:
204
206
 
205
- - <code title="get /models">client.models.<a href="./src/together/resources/models.py">list</a>() -> <a href="./src/together/types/model_list_response.py">ModelListResponse</a></code>
207
+ - <code title="get /models">client.models.<a href="./src/together/resources/models.py">list</a>(\*\*<a href="src/together/types/model_list_params.py">params</a>) -> <a href="./src/together/types/model_list_response.py">ModelListResponse</a></code>
206
208
  - <code title="post /models">client.models.<a href="./src/together/resources/models.py">upload</a>(\*\*<a href="src/together/types/model_upload_params.py">params</a>) -> <a href="./src/together/types/model_upload_response.py">ModelUploadResponse</a></code>
207
209
 
208
210
  # Jobs
@@ -1,19 +1,20 @@
1
1
  [project]
2
2
  name = "together"
3
- version = "2.0.0-alpha.8"
3
+ version = "2.0.0-alpha.10"
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
@@ -243,6 +243,9 @@ _T_co = TypeVar("_T_co", covariant=True)
243
243
  if TYPE_CHECKING:
244
244
  # This works because str.__contains__ does not accept object (either in typeshed or at runtime)
245
245
  # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
246
+ #
247
+ # Note: index() and count() methods are intentionally omitted to allow pyright to properly
248
+ # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
246
249
  class SequenceNotStr(Protocol[_T_co]):
247
250
  @overload
248
251
  def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
@@ -251,8 +254,6 @@ if TYPE_CHECKING:
251
254
  def __contains__(self, value: object, /) -> bool: ...
252
255
  def __len__(self) -> int: ...
253
256
  def __iter__(self) -> Iterator[_T_co]: ...
254
- def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
255
- def count(self, value: Any, /) -> int: ...
256
257
  def __reversed__(self) -> Iterator[_T_co]: ...
257
258
  else:
258
259
  # just point this to a normal `Sequence` at runtime to avoid having to special case
@@ -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.8" # x-release-please-version
4
+ __version__ = "2.0.0-alpha.10" # x-release-please-version
@@ -13,6 +13,7 @@ from tabulate import tabulate
13
13
  from click.core import ParameterSource # type: ignore[attr-defined]
14
14
 
15
15
  from together import Together
16
+ from together.types import fine_tuning_estimate_price_params as pe_params
16
17
  from together._types import NOT_GIVEN, NotGiven
17
18
  from together.lib.utils import log_warn
18
19
  from together.lib.utils.tools import format_timestamp, finetune_price_to_dollars
@@ -24,13 +25,21 @@ from together.lib.resources.fine_tuning import get_model_limits
24
25
 
25
26
  _CONFIRMATION_MESSAGE = (
26
27
  "You are about to create a fine-tuning job. "
27
- "The cost of your job will be determined by the model size, the number of tokens "
28
+ "The estimated price of this job is {price}. "
29
+ "The actual cost of your job will be determined by the model size, the number of tokens "
28
30
  "in the training file, the number of tokens in the validation file, the number of epochs, and "
29
- "the number of evaluations. Visit https://www.together.ai/pricing to get a price estimate.\n"
31
+ "the number of evaluations. Visit https://www.together.ai/pricing to learn more about pricing.\n"
32
+ "{warning}"
30
33
  "You can pass `-y` or `--confirm` to your command to skip this message.\n\n"
31
34
  "Do you want to proceed?"
32
35
  )
33
36
 
37
+ _WARNING_MESSAGE_INSUFFICIENT_FUNDS = (
38
+ "The estimated price of this job is significantly greater than your current credit limit and balance combined. "
39
+ "It will likely get cancelled due to insufficient funds. "
40
+ "Consider increasing your credit limit at https://api.together.xyz/settings/profile\n"
41
+ )
42
+
34
43
  _FT_JOB_WITH_STEP_REGEX = r"^ft-[\dabcdef-]+:\d+$"
35
44
 
36
45
 
@@ -323,7 +332,60 @@ def create(
323
332
  elif n_evals > 0 and not validation_file:
324
333
  raise click.BadParameter("You have specified a number of evaluation loops but no validation file.")
325
334
 
326
- if confirm or click.confirm(_CONFIRMATION_MESSAGE, default=True, show_default=True):
335
+ training_type_cls: pe_params.TrainingType
336
+ if lora:
337
+ training_type_cls = pe_params.TrainingTypeLoRaTrainingType(
338
+ lora_alpha=int(lora_alpha or 0),
339
+ lora_r=lora_r or 0,
340
+ lora_dropout=lora_dropout or 0,
341
+ lora_trainable_modules=lora_trainable_modules or "all-linear",
342
+ type="Lora",
343
+ )
344
+ else:
345
+ training_type_cls = pe_params.TrainingTypeFullTrainingType(
346
+ type="Full",
347
+ )
348
+
349
+ training_method_cls: pe_params.TrainingMethod
350
+ if training_method == "sft":
351
+ training_method_cls = pe_params.TrainingMethodTrainingMethodSft(
352
+ method="sft",
353
+ train_on_inputs=train_on_inputs or "auto",
354
+ )
355
+ else:
356
+ training_method_cls = pe_params.TrainingMethodTrainingMethodDpo(
357
+ method="dpo",
358
+ dpo_beta=dpo_beta or 0,
359
+ dpo_normalize_logratios_by_length=dpo_normalize_logratios_by_length or False,
360
+ dpo_reference_free=False,
361
+ rpo_alpha=rpo_alpha or 0,
362
+ simpo_gamma=simpo_gamma or 0,
363
+ )
364
+
365
+ finetune_price_estimation_result = client.fine_tuning.estimate_price(
366
+ training_file=training_file,
367
+ validation_file=validation_file,
368
+ model=model or "",
369
+ n_epochs=n_epochs,
370
+ n_evals=n_evals,
371
+ training_type=training_type_cls,
372
+ training_method=training_method_cls,
373
+ )
374
+ price = click.style(
375
+ f"${finetune_price_estimation_result.estimated_total_price:.2f}",
376
+ bold=True,
377
+ )
378
+ if not finetune_price_estimation_result.allowed_to_proceed:
379
+ warning = click.style(_WARNING_MESSAGE_INSUFFICIENT_FUNDS, fg="red", bold=True)
380
+ else:
381
+ warning = ""
382
+
383
+ confirmation_message = _CONFIRMATION_MESSAGE.format(
384
+ price=price,
385
+ warning=warning,
386
+ )
387
+
388
+ if confirm or click.confirm(confirmation_message, default=True, show_default=True):
327
389
  response = client.fine_tuning.create(
328
390
  **training_args,
329
391
  verbose=True,
@@ -7,7 +7,6 @@ from tabulate import tabulate
7
7
  from together import Together, omit
8
8
  from together._models import BaseModel
9
9
  from together._response import APIResponse as APIResponse
10
- from together.lib.resources.models import filter_by_dedicated_models
11
10
  from together.types.model_upload_response import ModelUploadResponse
12
11
 
13
12
 
@@ -34,11 +33,7 @@ def list(ctx: click.Context, type: Optional[str], json: bool) -> None:
34
33
  """List models"""
35
34
  client: Together = ctx.obj
36
35
 
37
- response = client.models.list()
38
- models_list = response
39
-
40
- if type == "dedicated":
41
- models_list = filter_by_dedicated_models(client, models_list)
36
+ models_list = client.models.list(dedicated=type == "dedicated" if type else omit)
42
37
 
43
38
  display_list: List[Dict[str, Any]] = []
44
39
  model: BaseModel
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Literal
4
4
 
5
5
  from rich import print as rprint
6
6
 
7
+ from together.types import fine_tuning_estimate_price_params as pe_params
7
8
  from together.lib.utils import log_warn_once
8
9
 
9
10
  if TYPE_CHECKING:
@@ -66,7 +67,7 @@ def create_finetune_request(
66
67
  hf_model_revision: str | None = None,
67
68
  hf_api_token: str | None = None,
68
69
  hf_output_repo_name: str | None = None,
69
- ) -> FinetuneRequest:
70
+ ) -> tuple[FinetuneRequest, pe_params.TrainingType, pe_params.TrainingMethod]:
70
71
  if model is not None and from_checkpoint is not None:
71
72
  raise ValueError("You must specify either a model or a checkpoint to start a job from, not both")
72
73
 
@@ -233,8 +234,46 @@ def create_finetune_request(
233
234
  hf_output_repo_name=hf_output_repo_name,
234
235
  )
235
236
 
236
- return finetune_request
237
+ training_type_pe, training_method_pe = create_price_estimation_params(finetune_request)
237
238
 
239
+ return finetune_request, training_type_pe, training_method_pe
240
+
241
+ def create_price_estimation_params(finetune_request: FinetuneRequest) -> tuple[pe_params.TrainingType, pe_params.TrainingMethod]:
242
+ training_type_cls: pe_params.TrainingType
243
+ if isinstance(finetune_request.training_type, FullTrainingType):
244
+ training_type_cls = pe_params.TrainingTypeFullTrainingType(
245
+ type="Full",
246
+ )
247
+ elif isinstance(finetune_request.training_type, LoRATrainingType):
248
+ training_type_cls = pe_params.TrainingTypeLoRaTrainingType(
249
+ lora_alpha=finetune_request.training_type.lora_alpha,
250
+ lora_r=finetune_request.training_type.lora_r,
251
+ lora_dropout=finetune_request.training_type.lora_dropout,
252
+ lora_trainable_modules=finetune_request.training_type.lora_trainable_modules,
253
+ type="Lora",
254
+ )
255
+ else:
256
+ raise ValueError(f"Unknown training type: {finetune_request.training_type}")
257
+
258
+ training_method_cls: pe_params.TrainingMethod
259
+ if isinstance(finetune_request.training_method, TrainingMethodSFT):
260
+ training_method_cls = pe_params.TrainingMethodTrainingMethodSft(
261
+ method="sft",
262
+ train_on_inputs=finetune_request.training_method.train_on_inputs,
263
+ )
264
+ elif isinstance(finetune_request.training_method, TrainingMethodDPO):
265
+ training_method_cls = pe_params.TrainingMethodTrainingMethodDpo(
266
+ method="dpo",
267
+ dpo_beta=finetune_request.training_method.dpo_beta or 0,
268
+ dpo_normalize_logratios_by_length=finetune_request.training_method.dpo_normalize_logratios_by_length,
269
+ dpo_reference_free=finetune_request.training_method.dpo_reference_free,
270
+ rpo_alpha=finetune_request.training_method.rpo_alpha or 0,
271
+ simpo_gamma=finetune_request.training_method.simpo_gamma or 0,
272
+ )
273
+ else:
274
+ raise ValueError(f"Unknown training method: {finetune_request.training_method}")
275
+
276
+ return training_type_cls, training_method_cls
238
277
 
239
278
  def get_model_limits(client: Together, model: str) -> FinetuneTrainingLimits:
240
279
  """