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.
- together-2.0.0a10/.release-please-manifest.json +3 -0
- {together-2.0.0a8 → together-2.0.0a10}/CHANGELOG.md +46 -0
- {together-2.0.0a8 → together-2.0.0a10}/PKG-INFO +11 -12
- {together-2.0.0a8 → together-2.0.0a10}/README.md +10 -11
- {together-2.0.0a8 → together-2.0.0a10}/api.md +3 -1
- {together-2.0.0a8 → together-2.0.0a10}/pyproject.toml +11 -9
- {together-2.0.0a8 → together-2.0.0a10}/requirements-dev.lock +5 -7
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_streaming.py +50 -48
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_types.py +3 -2
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_utils.py +1 -1
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_version.py +1 -1
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/fine_tuning.py +65 -3
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/models.py +1 -6
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/fine_tuning.py +41 -2
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/transcriptions.py +20 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/completions.py +48 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/fine_tuning.py +213 -5
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/images.py +13 -1
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/models.py +41 -5
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/__init__.py +3 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/transcription_create_params.py +14 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/voice_list_response.py +4 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/autoscaling.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/autoscaling_param.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/completion_create_params.py +78 -5
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/dedicated_endpoint.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_avzones_response.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_response.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/execute_response.py +7 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_cancel_response.py +6 -0
- together-2.0.0a10/src/together/types/fine_tuning_estimate_price_params.py +98 -0
- together-2.0.0a10/src/together/types/fine_tuning_estimate_price_response.py +24 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_response.py +6 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/hardware_list_response.py +8 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_generate_params.py +9 -0
- together-2.0.0a10/src/together/types/model_list_params.py +12 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/video_job.py +8 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_transcriptions.py +4 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/chat/test_completions.py +4 -16
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_fine_tuning.py +97 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_images.py +2 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_models.py +14 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_fine_tuning_resources.py +8 -8
- {together-2.0.0a8 → together-2.0.0a10}/uv.lock +66 -73
- together-2.0.0a8/.release-please-manifest.json +0 -3
- together-2.0.0a8/src/together/lib/resources/models.py +0 -35
- {together-2.0.0a8 → together-2.0.0a10}/.gitignore +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/CONTRIBUTING.md +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/LICENSE +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/SECURITY.md +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/bin/check-release-environment +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/bin/publish-pypi +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/.keep +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/coqa-small.jsonl +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/coqa.jsonl +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/embedding.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/file-upload.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/fine_tuning.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/image.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/models.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/examples/streaming.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/release-please-config.json +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_base_client.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_client.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_compat.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_constants.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_exceptions.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_models.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_qs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_resource.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_compat.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_datetime_parse.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_logs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_proxy.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_reflection.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_resources_proxy.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_streams.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_sync.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_transform.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/_utils/_typing.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/.keep +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/endpoints.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/evals.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/api/utils.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/cli/cli.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/constants.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/resources/files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/error.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/types/fine_tuning.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/_log.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/serializer.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/lib/utils/tools.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/py.typed +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/audio.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/speech.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/translations.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/audio/voices.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/batches.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/chat/chat.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/code_interpreter.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/code_interpreter/sessions.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/completions.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/embeddings.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/endpoints.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/evals.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/hardware.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/jobs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/rerank.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/resources/videos.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/speech_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/transcription_create_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/translation_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio/translation_create_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/audio_speech_stream_chunk.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_create_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_job.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/batch_list_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_chunk.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_image_url_param.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_text_param.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_structured_message_video_url_param.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_usage.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/chat/chat_completion_warning.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter/session_list_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/code_interpreter_execute_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion_chunk.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/completion_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/embedding.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/embedding_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_list_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/endpoint_update_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_create_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_list_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_list_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/eval_status_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/evaluation_job.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_delete_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_list.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_purpose.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/file_type.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_content_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_delete_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_delete_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_checkpoints_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/fine_tuning_list_events_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_event.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_event_type.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/finetune_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/hardware_list_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_data_b64.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_data_url.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/image_file.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/job_list_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/job_retrieve_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/log_probs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_list_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_object.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_upload_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/model_upload_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/rerank_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/rerank_create_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tool_choice.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tool_choice_param.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/tools_param.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/training_method_dpo.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/training_method_sft.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/src/together/types/video_create_params.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_speech.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_translations.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/audio/test_voices.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/chat/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/code_interpreter/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/code_interpreter/test_sessions.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_batches.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_code_interpreter.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_completions.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_embeddings.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_endpoints.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_evals.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_hardware.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_jobs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_rerank.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/api_resources/test_videos.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/conftest.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/constants.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/__init__.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/generate_hyperparameters.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_completion.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_completion_stream.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/integration/resources/test_files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/sample_file.txt +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_client.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_deepcopy.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_extract_files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_files.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_models.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_qs.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_required_args.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_response.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_streaming.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_transform.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_datetime_parse.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_proxy.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/test_utils/test_typing.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_async_client.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_client.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_code_interpreter.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_files_checks.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_files_resource.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_imports.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_multipart_upload_manager.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_preference_openai.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/unit/test_video_url.py +0 -0
- {together-2.0.0a8 → together-2.0.0a10}/tests/utils.py +0 -0
|
@@ -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.
|
|
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="
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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(
|
|
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="
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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(
|
|
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.
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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.
|
|
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
|
+
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
"""
|