truss 0.9.17__tar.gz → 0.9.17.dev2__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 (257) hide show
  1. {truss-0.9.17 → truss-0.9.17.dev2}/PKG-INFO +2 -3
  2. {truss-0.9.17 → truss-0.9.17.dev2}/pyproject.toml +2 -2
  3. {truss-0.9.17 → truss-0.9.17.dev2}/truss/cli/cli.py +44 -38
  4. {truss-0.9.17 → truss-0.9.17.dev2}/truss/config/trt_llm.py +2 -5
  5. {truss-0.9.17 → truss-0.9.17.dev2}/truss/constants.py +1 -22
  6. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/image_builder/serving_image_builder.py +11 -32
  7. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/api.py +0 -1
  8. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/types.py +0 -7
  9. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/remote_factory.py +4 -11
  10. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/endpoints.py +0 -3
  11. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py +3 -3
  12. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm-briton/model/model.py +4 -1
  13. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/path.py +5 -4
  14. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/code_gen.py +0 -1
  15. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/definitions.py +1 -9
  16. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/deploy.py +6 -11
  17. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/framework.py +1 -1
  18. truss-0.9.17/truss/templates/trtllm-audio/model/model.py +0 -44
  19. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/__init__.py +0 -227
  20. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/assets.py +0 -25
  21. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/batching.py +0 -51
  22. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/modeling.py +0 -169
  23. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/tokenizer.py +0 -185
  24. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/types.py +0 -26
  25. truss-0.9.17/truss/templates/trtllm-audio/packages/whisper_trt/utils.py +0 -196
  26. {truss-0.9.17 → truss-0.9.17.dev2}/CODE_OF_CONDUCT.md +0 -0
  27. {truss-0.9.17 → truss-0.9.17.dev2}/CONTRIBUTING.md +0 -0
  28. {truss-0.9.17 → truss-0.9.17.dev2}/LICENSE +0 -0
  29. {truss-0.9.17 → truss-0.9.17.dev2}/README.md +0 -0
  30. {truss-0.9.17 → truss-0.9.17.dev2}/context_builder.Dockerfile +0 -0
  31. {truss-0.9.17 → truss-0.9.17.dev2}/truss/__init__.py +0 -0
  32. {truss-0.9.17 → truss-0.9.17.dev2}/truss/blob/blob_backend.py +0 -0
  33. {truss-0.9.17 → truss-0.9.17.dev2}/truss/blob/blob_backend_registry.py +0 -0
  34. {truss-0.9.17 → truss-0.9.17.dev2}/truss/blob/http_public_blob_backend.py +0 -0
  35. {truss-0.9.17 → truss-0.9.17.dev2}/truss/build.py +0 -0
  36. {truss-0.9.17 → truss-0.9.17.dev2}/truss/cli/__init__.py +0 -0
  37. {truss-0.9.17 → truss-0.9.17.dev2}/truss/cli/console.py +0 -0
  38. {truss-0.9.17 → truss-0.9.17.dev2}/truss/cli/create.py +0 -0
  39. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/image_builder/cache_warmer.py +0 -0
  40. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/image_builder/image_builder.py +0 -0
  41. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/image_builder/util.py +0 -0
  42. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/local_loader/docker_build_emulator.py +0 -0
  43. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/local_loader/load_model_local.py +0 -0
  44. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/local_loader/truss_module_loader.py +0 -0
  45. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/local_loader/utils.py +0 -0
  46. {truss-0.9.17 → truss-0.9.17.dev2}/truss/contexts/truss_context.py +0 -0
  47. {truss-0.9.17 → truss-0.9.17.dev2}/truss/decorators.py +0 -0
  48. {truss-0.9.17 → truss-0.9.17.dev2}/truss/docker.py +0 -0
  49. {truss-0.9.17 → truss-0.9.17.dev2}/truss/errors.py +0 -0
  50. {truss-0.9.17 → truss-0.9.17.dev2}/truss/local/local_config.py +0 -0
  51. {truss-0.9.17 → truss-0.9.17.dev2}/truss/local/local_config_handler.py +0 -0
  52. {truss-0.9.17 → truss-0.9.17.dev2}/truss/model_inference.py +0 -0
  53. {truss-0.9.17 → truss-0.9.17.dev2}/truss/notebook.py +0 -0
  54. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/calc_patch.py +0 -0
  55. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/constants.py +0 -0
  56. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/dir_signature.py +0 -0
  57. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/hash.py +0 -0
  58. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/local_truss_patch_applier.py +0 -0
  59. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/signature.py +0 -0
  60. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/truss_dir_patch_applier.py +0 -0
  61. {truss-0.9.17 → truss-0.9.17.dev2}/truss/patch/types.py +0 -0
  62. {truss-0.9.17 → truss-0.9.17.dev2}/truss/readme_generator.py +0 -0
  63. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/__init__.py +0 -0
  64. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/auth.py +0 -0
  65. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/core.py +0 -0
  66. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/error.py +0 -0
  67. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/remote.py +0 -0
  68. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/service.py +0 -0
  69. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/utils/status.py +0 -0
  70. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/utils/tar.py +0 -0
  71. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/baseten/utils/transfer.py +0 -0
  72. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/remote_cli.py +0 -0
  73. {truss-0.9.17 → truss-0.9.17.dev2}/truss/remote/truss_remote.py +0 -0
  74. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/README.md.jinja +0 -0
  75. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/__init__.py +0 -0
  76. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/base.Dockerfile.jinja +0 -0
  77. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/cache.Dockerfile.jinja +0 -0
  78. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/cache_requirements.txt +0 -0
  79. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/application.py +0 -0
  80. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/context_managers.py +0 -0
  81. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/errors.py +0 -0
  82. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/inference_server_controller.py +0 -0
  83. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/inference_server_process_controller.py +0 -0
  84. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/inference_server_starter.py +0 -0
  85. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/truss_patch/__init__.py +0 -0
  86. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py +0 -0
  87. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py +0 -0
  88. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/truss_patch/system_packages.py +0 -0
  89. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/helpers/types.py +0 -0
  90. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/control/server.py +0 -0
  91. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/control/requirements.txt +0 -0
  92. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/copy_cache_files.Dockerfile.jinja +0 -0
  93. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/custom/examples.yaml +0 -0
  94. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/custom/model/__init__.py +0 -0
  95. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/custom/model/model.py +0 -0
  96. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/__init__.py +0 -0
  97. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/__init__.py +0 -0
  98. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/errors.py +0 -0
  99. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/patches/whisper/patch.py +0 -0
  100. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/patches.py +0 -0
  101. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/retry.py +0 -0
  102. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/schema.py +0 -0
  103. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/termination_handler_middleware.py +0 -0
  104. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/common/truss_server.py +0 -0
  105. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/inference_server.py +0 -0
  106. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/model_wrapper.py +0 -0
  107. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server/requirements.txt +0 -0
  108. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/server.Dockerfile.jinja +0 -0
  109. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/README.md +0 -0
  110. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/__init__.py +0 -0
  111. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/lazy_data_resolver.py +0 -0
  112. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/logging.py +0 -0
  113. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/secrets_resolver.py +0 -0
  114. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/serialization.py +0 -0
  115. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/shared/util.py +0 -0
  116. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/README.md +0 -0
  117. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/model/model.py +0 -0
  118. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/constants.py +0 -0
  119. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/schema.py +0 -0
  120. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/ensemble/config.pbtxt +0 -0
  121. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/postprocessing/1/model.py +0 -0
  122. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/postprocessing/config.pbtxt +0 -0
  123. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/preprocessing/1/model.py +0 -0
  124. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/preprocessing/config.pbtxt +0 -0
  125. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/tensorrt_llm_model_repository/tensorrt_llm/config.pbtxt +0 -0
  126. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/triton_client.py +0 -0
  127. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm/packages/utils.py +0 -0
  128. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm-briton/README.md +0 -0
  129. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm-briton/packages/briton_pb2.py +0 -0
  130. {truss-0.9.17 → truss-0.9.17.dev2}/truss/templates/trtllm-briton/packages/briton_pb2_grpc.py +0 -0
  131. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/annotated_types_truss/config.yaml +0 -0
  132. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/annotated_types_truss/model/__init__.py +0 -0
  133. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/annotated_types_truss/model/model.py +0 -0
  134. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/auto-mpg.data +0 -0
  135. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/context_builder_image_test/Dockerfile +0 -0
  136. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/context_builder_image_test/test.py +0 -0
  137. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/gcs_fix/config.yaml +0 -0
  138. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/gcs_fix/model/__init__.py +0 -0
  139. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/gcs_fix/model/model.py +0 -0
  140. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/happy.ipynb +0 -0
  141. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/model_load_failure_test/config.yaml +0 -0
  142. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/model_load_failure_test/model/model.py +0 -0
  143. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/patch_ping_test_server/app.py +0 -0
  144. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/pima-indians-diabetes.csv +0 -0
  145. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/readme_int_example.md +0 -0
  146. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/readme_no_example.md +0 -0
  147. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/readme_str_example.md +0 -0
  148. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/server.Dockerfile +0 -0
  149. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/server_conformance_test_truss/config.yaml +0 -0
  150. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/server_conformance_test_truss/model/__init__.py +0 -0
  151. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/server_conformance_test_truss/model/model.py +0 -0
  152. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_async_truss/config.yaml +0 -0
  153. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_async_truss/model/model.py +0 -0
  154. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_basic_truss/config.yaml +0 -0
  155. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_basic_truss/model/__init__.py +0 -0
  156. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_basic_truss/model/model.py +0 -0
  157. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_build_commands/config.yaml +0 -0
  158. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_build_commands/model/model.py +0 -0
  159. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_build_commands_failure/config.yaml +0 -0
  160. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_build_commands_failure/model/model.py +0 -0
  161. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_concurrency_truss/config.yaml +0 -0
  162. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_concurrency_truss/model/model.py +0 -0
  163. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v1/config.yaml +0 -0
  164. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v1/model/__init__.py +0 -0
  165. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v1/model/model.py +0 -0
  166. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v1/requirements.txt +0 -0
  167. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v2/config.yaml +0 -0
  168. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v2/model/__init__.py +0 -0
  169. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v2/model/model.py +0 -0
  170. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_pyantic_v2/requirements.txt +0 -0
  171. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_requirements_file_truss/config.yaml +0 -0
  172. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_requirements_file_truss/model/__init__.py +0 -0
  173. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_requirements_file_truss/model/model.py +0 -0
  174. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_requirements_file_truss/requirements.txt +0 -0
  175. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_async_generator_truss/config.yaml +0 -0
  176. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_async_generator_truss/model/model.py +0 -0
  177. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_read_timeout/config.yaml +0 -0
  178. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_read_timeout/model/model.py +0 -0
  179. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_truss/config.yaml +0 -0
  180. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_truss/model/model.py +0 -0
  181. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_truss_with_error/config.yaml +0 -0
  182. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_streaming_truss_with_error/model/model.py +0 -0
  183. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/config.yaml +0 -0
  184. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/examples.yaml +0 -0
  185. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/model/__init__.py +0 -0
  186. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/model/dummy +0 -0
  187. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/model/model.py +0 -0
  188. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss/packages/test_package/test.py +0 -0
  189. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss_server_caching_truss/config.yaml +0 -0
  190. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss_server_caching_truss/model/__init__.py +0 -0
  191. {truss-0.9.17 → truss-0.9.17.dev2}/truss/test_data/test_truss_server_caching_truss/model/model.py +0 -0
  192. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/__init__.py +0 -0
  193. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/conftest.py +0 -0
  194. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/contexts/image_builder/test_serving_image_builder.py +0 -0
  195. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/contexts/local_loader/test_load_local.py +0 -0
  196. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/contexts/local_loader/test_truss_module_finder.py +0 -0
  197. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/helpers.py +0 -0
  198. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/local/__init__.py +0 -0
  199. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/local/test_local_config_handler.py +0 -0
  200. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_calc_patch.py +0 -0
  201. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_dir_signature.py +0 -0
  202. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_hash.py +0 -0
  203. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_signature.py +0 -0
  204. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_truss_dir_patch_applier.py +0 -0
  205. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/patch/test_types.py +0 -0
  206. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/baseten/test_api.py +0 -0
  207. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/baseten/test_auth.py +0 -0
  208. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/baseten/test_core.py +0 -0
  209. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/baseten/test_remote.py +0 -0
  210. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/test_remote_factory.py +0 -0
  211. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/remote/test_truss_remote.py +0 -0
  212. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/control/control/helpers/test_context_managers.py +0 -0
  213. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/control/control/helpers/test_model_container_patch_applier.py +0 -0
  214. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/control/control/helpers/test_requirement_name_identifier.py +0 -0
  215. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/control/control/test_server.py +0 -0
  216. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/control/control/test_server_integration.py +0 -0
  217. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/core/server/common/test_truss_server.py +0 -0
  218. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/core/server/common/test_util.py +0 -0
  219. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/core/server/test_lazy_data_resolver.py +0 -0
  220. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/core/server/test_secrets_resolver.py +0 -0
  221. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/server/common/test_retry.py +0 -0
  222. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/server/common/test_termination_handler_middleware.py +0 -0
  223. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/server/test_model_wrapper.py +0 -0
  224. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/templates/server/test_schema.py +0 -0
  225. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_build.py +0 -0
  226. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_config.py +0 -0
  227. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_context_builder_image.py +0 -0
  228. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_control_truss_patching.py +0 -0
  229. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_docker.py +0 -0
  230. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_model_inference.py +0 -0
  231. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_model_schema.py +0 -0
  232. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_testing_utilities_for_other_tests.py +0 -0
  233. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_truss_gatherer.py +0 -0
  234. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_truss_handle.py +0 -0
  235. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_util.py +0 -0
  236. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/test_validation.py +0 -0
  237. {truss-0.9.17 → truss-0.9.17.dev2}/truss/tests/util/test_path.py +0 -0
  238. {truss-0.9.17 → truss-0.9.17.dev2}/truss/truss_config.py +0 -0
  239. {truss-0.9.17 → truss-0.9.17.dev2}/truss/truss_gatherer.py +0 -0
  240. {truss-0.9.17 → truss-0.9.17.dev2}/truss/truss_handle.py +0 -0
  241. {truss-0.9.17 → truss-0.9.17.dev2}/truss/truss_spec.py +0 -0
  242. {truss-0.9.17 → truss-0.9.17.dev2}/truss/types.py +0 -0
  243. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/.truss_ignore +0 -0
  244. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/data_structures.py +0 -0
  245. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/download.py +0 -0
  246. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/errors.py +0 -0
  247. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/gpu.py +0 -0
  248. {truss-0.9.17 → truss-0.9.17.dev2}/truss/util/jinja.py +0 -0
  249. {truss-0.9.17 → truss-0.9.17.dev2}/truss/validation.py +0 -0
  250. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/__init__.py +0 -0
  251. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/cli.py +0 -0
  252. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/example_chainlet.py +0 -0
  253. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/model_skeleton.py +0 -0
  254. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/public_api.py +0 -0
  255. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/py.typed +0 -0
  256. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/stub.py +0 -0
  257. {truss-0.9.17 → truss-0.9.17.dev2}/truss-chains/truss_chains/utils.py +0 -0
@@ -1,20 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: truss
3
- Version: 0.9.17
3
+ Version: 0.9.17.dev2
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Home-page: https://github.com/basetenlabs/truss
6
6
  License: MIT
7
7
  Keywords: MLOps,AI,Model Serving,Model Deployment,Machine Learning
8
8
  Author: Pankaj Gupta
9
9
  Author-email: pankaj@baseten.co
10
- Requires-Python: >=3.8,<3.13
10
+ Requires-Python: >=3.8,<3.12
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.8
14
14
  Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
17
  Requires-Dist: Jinja2 (>=3.1.2,<4.0.0)
19
18
  Requires-Dist: PyYAML (>=6.0)
20
19
  Requires-Dist: autoflake (<=2.2)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "truss"
3
- version = "0.9.17"
3
+ version = "0.9.17dev2"
4
4
  description = "A seamless bridge from model development to model delivery"
5
5
  license = "MIT"
6
6
  readme = "README.md"
@@ -50,7 +50,7 @@ psutil = ">=5.9.4"
50
50
  pydantic = ">=1.10.0"
51
51
  pytest-asyncio = "^0.23.6"
52
52
  # Note: when using chains, 3.9 will be required at runtime, but other truss functionality works with 3.8.
53
- python = ">=3.8,<3.13"
53
+ python = ">=3.8,<3.12"
54
54
  python-json-logger = ">=2.0.2"
55
55
  python-on-whales = "^0.68.0"
56
56
  PyYAML = ">=6.0"
@@ -334,8 +334,8 @@ def _create_chains_table(service) -> Tuple[rich.table.Table, List[str]]:
334
334
  table.add_column("Logs URL")
335
335
  statuses = []
336
336
  # After reversing, the first one is the entrypoint (per order in service).
337
- for i, chainlet in enumerate(reversed(service.get_info())):
338
- displayable_status = get_displayable_status(chainlet.status)
337
+ for i, (name, status, logs_url) in enumerate(reversed(service.get_info())):
338
+ displayable_status = get_displayable_status(status)
339
339
  if displayable_status == ACTIVE_STATUS:
340
340
  spinner_name = "active"
341
341
  elif displayable_status in DEPLOYING_STATUSES:
@@ -348,13 +348,13 @@ def _create_chains_table(service) -> Tuple[rich.table.Table, List[str]]:
348
348
  else:
349
349
  spinner_name = "failed"
350
350
  spinner = rich.spinner.Spinner(spinner_name, text=displayable_status)
351
- if chainlet.is_entrypoint:
352
- display_name = f"{chainlet.name} (entrypoint)"
351
+ if i == 0:
352
+ display_name = f"{name} (entrypoint)"
353
353
  else:
354
- display_name = f"{chainlet.name} (dep)"
354
+ display_name = f"{name} (dep)"
355
355
 
356
- table.add_row(spinner, display_name, chainlet.logs_url)
357
- if chainlet.is_entrypoint: # Add section divider after entrypoint.
356
+ table.add_row(spinner, display_name, logs_url)
357
+ if i == 0: # Add section divider after entrypoint.
358
358
  table.add_section()
359
359
  statuses.append(displayable_status)
360
360
  return table, statuses
@@ -480,46 +480,52 @@ def deploy(
480
480
 
481
481
 
482
482
  @chains.command(name="init") # type: ignore
483
- @click.argument("directory", type=Path, required=False)
483
+ @click.option(
484
+ "--target_directory",
485
+ type=str,
486
+ required=False,
487
+ help="Name of the chain to be deployed, if not given, the user will be prompted for a name",
488
+ )
484
489
  @log_level_option
485
490
  @error_handling
486
491
  def chains_init(
487
- directory: Optional[Path],
492
+ target_directory: Optional[str],
488
493
  ) -> None:
489
494
  """
490
- Initializes a chains project directory.
491
-
492
- DIRECTORY: A name of new or existing directory to create the chain in,
493
- it must be empty. If not specified, the current directory is used.
494
-
495
+ Initializes a chains project with hello.py
495
496
  """
496
- if not directory:
497
- directory = Path.cwd()
498
- if directory.exists():
499
- if not directory.is_dir():
500
- raise ValueError(f"The path {directory} must be a directory.")
501
- if any(directory.iterdir()):
502
- raise ValueError(f"Directory {directory} must be empty.")
503
- else:
504
- directory.mkdir()
505
-
506
- filename = (
507
- inquirer.text(
508
- qmark="",
509
- message="Enter the python file name for the chain.",
510
- default="my_chain.py",
511
- ).execute(),
512
- )
513
- filepath = directory / str(filename)
514
- rich.print(f"Creating and populating {filepath}...\n")
497
+ FILENAME = "main.py"
498
+ if not target_directory:
499
+ target_directory = inquirer.text(
500
+ qmark="", message="Enter the target directory for the chain"
501
+ ).execute()
502
+ # Ensure that `None` is replaced to empty string. This will write a main.py
503
+ # file to the cwd.
504
+ if not target_directory:
505
+ target_directory = ""
506
+ # we do this cast to satisfy mypy when handling the output of the inquirer.text call
507
+ target_directory = str(target_directory)
508
+ cur_path = os.getcwd()
509
+ abs_path = os.path.join(cur_path, target_directory)
510
+ filename = os.path.join(abs_path, FILENAME)
511
+ if os.path.exists(filename):
512
+ raise click.UsageError(
513
+ f"Cannot init chains project with {filename}. Path already exists"
514
+ )
515
+ user_friendly_path = os.path.join(target_directory, FILENAME)
516
+ rich.print(f"Creating {user_friendly_path}...\n")
517
+
515
518
  source_code = _load_example_chainlet_code()
516
- filepath.write_text(source_code)
519
+
520
+ if not os.path.exists(abs_path):
521
+ os.mkdir(abs_path)
522
+ with open(filename, "w") as f:
523
+ f.write(source_code)
524
+
517
525
  rich.print(
518
526
  "Next steps:\n",
519
- f"💻 Run [bold green]`python {filepath}`[/bold green] for local debug "
520
- "execution.\n"
521
- f"🚢 Run [bold green]`truss chains deploy {filepath}`[/bold green] "
522
- "to deploy the chain to Baseten.\n",
527
+ f"💻 Run `python {user_friendly_path}` to execute the code locally\n",
528
+ f"🚢 Run `truss chains deploy {user_friendly_path}` to deploy the chain to Baseten\n",
523
529
  )
524
530
 
525
531
 
@@ -13,7 +13,6 @@ class TrussTRTLLMModel(Enum):
13
13
  LLAMA: str = "llama"
14
14
  MISTRAL: str = "mistral"
15
15
  DEEPSEEK: str = "deepseek"
16
- WHISPER: str = "whisper"
17
16
 
18
17
 
19
18
  class TrussTRTLLMQuantizationType(str, Enum):
@@ -37,8 +36,6 @@ class CheckpointSource(Enum):
37
36
  HF: str = "HF"
38
37
  GCS: str = "GCS"
39
38
  LOCAL: str = "LOCAL"
40
- # REMOTE_URL is useful when the checkpoint lives on remote storage accessible via HTTP (e.g a presigned URL)
41
- REMOTE_URL: str = "REMOTE_URL"
42
39
 
43
40
 
44
41
  class CheckpointRepository(BaseModel):
@@ -76,8 +73,8 @@ class TrussTRTLLMBuildConfiguration(BaseModel):
76
73
 
77
74
 
78
75
  class TrussTRTLLMServingConfiguration(BaseModel):
79
- engine_repository: str
80
- tokenizer_repository: str
76
+ engine_repository: Optional[str] = None
77
+ tokenizer_repository: Optional[str] = None
81
78
  tensor_parallel_count: int = 1
82
79
  pipeline_parallel_count: int = 1
83
80
 
@@ -21,7 +21,6 @@ SERVER_CODE_DIR: pathlib.Path = TEMPLATES_DIR / "server"
21
21
  TRITON_SERVER_CODE_DIR: pathlib.Path = TEMPLATES_DIR / "triton"
22
22
  TRTLLM_BRITON_TRUSS_DIR: pathlib.Path = TEMPLATES_DIR / "trtllm-briton"
23
23
  TRTLLM_TRITON_TRUSS_DIR: pathlib.Path = TEMPLATES_DIR / "trtllm"
24
- AUDIO_MODEL_TRTLLM_TRUSS_DIR: pathlib.Path = TEMPLATES_DIR / "trtllm-audio"
25
24
  TRTLLM_TRUSS_DIR: pathlib.Path = (
26
25
  TRTLLM_BRITON_TRUSS_DIR if USE_BRITON else TRTLLM_TRITON_TRUSS_DIR
27
26
  )
@@ -119,26 +118,6 @@ BRITON_BASE_TRTLLM_REQUIREMENTS = [
119
118
  "grpcio==1.64.0",
120
119
  "grpcio-tools==1.64.0",
121
120
  "transformers==4.41.0",
122
- "truss==0.9.17rc2",
123
- ]
124
- AUDIO_MODEL_TRTLLM_REQUIREMENTS = [
125
- "--extra-index-url https://pypi.nvidia.com",
126
- "tensorrt_llm==0.9.0",
127
- "hf_transfer",
128
- "janus",
129
- "kaldialign",
130
- "librosa",
131
- "mpi4py==3.1.4",
132
- "safetensors",
133
- "soundfile",
134
- "tiktoken",
135
- "torchaudio",
136
- "async-batcher>=0.2.0",
137
- "pydantic>=2.7.1",
138
- ]
139
- AUDIO_MODEL_TRTLLM_SYSTEM_PACKAGES = [
140
- "python3.10-venv",
141
- "openmpi-bin",
142
- "libopenmpi-dev",
121
+ "truss==0.9.12",
143
122
  ]
144
123
  OPENAI_COMPATIBLE_TAG = "openai-compatible"
@@ -12,11 +12,7 @@ from botocore.client import Config
12
12
  from google.cloud import storage
13
13
  from huggingface_hub import get_hf_file_metadata, hf_hub_url, list_repo_files
14
14
  from huggingface_hub.utils import filter_repo_objects
15
- from truss.config.trt_llm import TrussTRTLLMModel
16
15
  from truss.constants import (
17
- AUDIO_MODEL_TRTLLM_REQUIREMENTS,
18
- AUDIO_MODEL_TRTLLM_SYSTEM_PACKAGES,
19
- AUDIO_MODEL_TRTLLM_TRUSS_DIR,
20
16
  BASE_SERVER_REQUIREMENTS_TXT_FILENAME,
21
17
  BASE_TRTLLM_REQUIREMENTS,
22
18
  BRITON_BASE_TRTLLM_REQUIREMENTS,
@@ -345,18 +341,7 @@ class ServingImageBuilder(ImageBuilder):
345
341
  # Most of the code is pulled from upstream triton-inference-server tensorrtllm_backend
346
342
  # https://github.com/triton-inference-server/tensorrtllm_backend/tree/v0.9.0/all_models/inflight_batcher_llm
347
343
  if config.trt_llm is not None:
348
- is_audio_model = (
349
- config.trt_llm.build.base_model == TrussTRTLLMModel.WHISPER
350
- if config.trt_llm.build is not None
351
- else False
352
- )
353
-
354
- if is_audio_model:
355
- copy_tree_path(
356
- AUDIO_MODEL_TRTLLM_TRUSS_DIR, build_dir, ignore_patterns=[]
357
- )
358
- else:
359
- copy_tree_path(TRTLLM_TRUSS_DIR, build_dir, ignore_patterns=[])
344
+ copy_tree_path(TRTLLM_TRUSS_DIR, build_dir, ignore_patterns=[])
360
345
 
361
346
  tensor_parallel_count = (
362
347
  config.trt_llm.build.tensor_parallel_count # type: ignore[union-attr]
@@ -371,23 +356,17 @@ class ServingImageBuilder(ImageBuilder):
371
356
 
372
357
  config.runtime.predict_concurrency = TRTLLM_PREDICT_CONCURRENCY
373
358
 
374
- if not is_audio_model:
375
- config.base_image = BaseImage(
376
- image=BRITON_TRTLLM_BASE_IMAGE if USE_BRITON else TRTLLM_BASE_IMAGE,
377
- python_executable_path=TRTLLM_PYTHON_EXECUTABLE,
378
- )
379
-
380
- config.requirements.extend(
381
- BRITON_BASE_TRTLLM_REQUIREMENTS
382
- if USE_BRITON
383
- else BASE_TRTLLM_REQUIREMENTS
384
- )
359
+ config.base_image = BaseImage(
360
+ image=BRITON_TRTLLM_BASE_IMAGE if USE_BRITON else TRTLLM_BASE_IMAGE,
361
+ python_executable_path=TRTLLM_PYTHON_EXECUTABLE,
362
+ )
363
+ config.requirements.extend(
364
+ BRITON_BASE_TRTLLM_REQUIREMENTS
365
+ if USE_BRITON
366
+ else BASE_TRTLLM_REQUIREMENTS
367
+ )
385
368
 
386
- config.model_metadata["tags"] = [OPENAI_COMPATIBLE_TAG]
387
- else:
388
- config.requirements.extend(AUDIO_MODEL_TRTLLM_REQUIREMENTS)
389
- config.system_packages.extend(AUDIO_MODEL_TRTLLM_SYSTEM_PACKAGES)
390
- config.python_version = "py310"
369
+ config.model_metadata["tags"] = [OPENAI_COMPATIBLE_TAG]
391
370
 
392
371
  # Override config.yml
393
372
  with (build_dir / CONFIG_FILE).open("w") as config_file:
@@ -275,7 +275,6 @@ class BasetenApi:
275
275
  chainlets{{
276
276
  name
277
277
  id
278
- is_entrypoint
279
278
  oracle_version {{
280
279
  current_model_deployment_status {{
281
280
  status
@@ -3,13 +3,6 @@ from enum import Enum
3
3
  import pydantic
4
4
 
5
5
 
6
- class DeployedChainlet(pydantic.BaseModel):
7
- name: str
8
- is_entrypoint: bool
9
- status: str
10
- logs_url: str
11
-
12
-
13
6
  class ChainletData(pydantic.BaseModel):
14
7
  name: str
15
8
  oracle_version_id: str
@@ -1,12 +1,5 @@
1
1
  import inspect
2
-
3
- try:
4
- from configparser import DEFAULTSECT
5
- from configparser import SafeConfigParser as ConfigParser
6
- except ImportError:
7
- # We need to do this for py312 and onwards.
8
- from configparser import DEFAULTSECT, ConfigParser # type: ignore
9
-
2
+ from configparser import DEFAULTSECT, SafeConfigParser
10
3
  from functools import partial
11
4
  from operator import is_not
12
5
  from pathlib import Path
@@ -18,13 +11,13 @@ from truss.remote.truss_remote import RemoteConfig, TrussRemote
18
11
  USER_TRUSSRC_PATH = Path("~/.trussrc").expanduser()
19
12
 
20
13
 
21
- def load_config() -> ConfigParser:
22
- config = ConfigParser()
14
+ def load_config() -> SafeConfigParser:
15
+ config = SafeConfigParser()
23
16
  config.read(USER_TRUSSRC_PATH)
24
17
  return config
25
18
 
26
19
 
27
- def update_config(config: ConfigParser):
20
+ def update_config(config: SafeConfigParser):
28
21
  with open(USER_TRUSSRC_PATH, "w") as configfile:
29
22
  config.write(configfile)
30
23
 
@@ -51,9 +51,6 @@ async def proxy(request: Request):
51
51
  retry_if_exception_type(ConnectError)
52
52
  | retry_if_exception_type(ModelNotReady)
53
53
  | retry_if_exception_type(RemoteProtocolError)
54
- | retry_if_exception_type(httpx.ReadError)
55
- | retry_if_exception_type(httpx.ReadTimeout)
56
- | retry_if_exception_type(httpx.ConnectTimeout)
57
54
  ),
58
55
  stop=stop_after_attempt(INFERENCE_SERVER_START_WAIT_SECS),
59
56
  wait=wait_fixed(1),
@@ -1,12 +1,12 @@
1
1
  from typing import Dict, List
2
2
 
3
- from packaging import requirements # type: ignore
3
+ import pkg_resources
4
+ from pkg_resources.extern.packaging import requirements # type: ignore
4
5
 
5
6
 
6
7
  def identify_requirement_name(req: str) -> str:
7
8
  try:
8
-
9
- parsed_req = requirements.Requirement(req)
9
+ parsed_req = pkg_resources.Requirement.parse(req)
10
10
  return parsed_req.name # type: ignore
11
11
  except (requirements.InvalidRequirement, ValueError):
12
12
  # default to the whole line if we can't parse it.
@@ -10,7 +10,10 @@ import briton_pb2
10
10
  import briton_pb2_grpc
11
11
  import grpc
12
12
  from transformers import AutoTokenizer
13
- from truss.config.trt_llm import TrussTRTLLMBuildConfiguration
13
+ from truss.config.trt_llm import (
14
+ TrussTRTLLMBuildConfiguration,
15
+ TrussTRTLLMServingConfiguration,
16
+ )
14
17
  from truss.constants import OPENAI_COMPATIBLE_TAG
15
18
 
16
19
  BRITON_PORT = 50051
@@ -1,9 +1,10 @@
1
1
  import os
2
2
  import random
3
- import shutil
4
3
  import string
5
4
  import tempfile
6
5
  from contextlib import contextmanager
6
+ from distutils.dir_util import remove_tree
7
+ from distutils.file_util import copy_file
7
8
  from pathlib import Path
8
9
  from typing import Iterable, Iterator, List, Optional, Set, Tuple, Union
9
10
 
@@ -32,11 +33,11 @@ def copy_tree_path(src: Path, dest: Path, ignore_patterns: List[str] = []) -> No
32
33
  dest_fp.mkdir(exist_ok=True)
33
34
  else:
34
35
  dest_fp.parent.mkdir(exist_ok=True, parents=True)
35
- shutil.copy2(str(sub_path), str(dest_fp))
36
+ copy_file(str(sub_path), str(dest_fp), verbose=False)
36
37
 
37
38
 
38
39
  def copy_file_path(src: Path, dest: Path) -> Tuple[str, str]:
39
- return shutil.copy2(str(src), str(dest))
40
+ return copy_file(str(src), str(dest), verbose=False)
40
41
 
41
42
 
42
43
  def copy_tree_or_file(src: Path, dest: Path) -> Union[List[str], Tuple[str, str]]:
@@ -47,7 +48,7 @@ def copy_tree_or_file(src: Path, dest: Path) -> Union[List[str], Tuple[str, str]
47
48
 
48
49
 
49
50
  def remove_tree_path(target: Path) -> None:
50
- return shutil.rmtree(str(target))
51
+ return remove_tree(str(target), verbose=0)
51
52
 
52
53
 
53
54
  def get_max_modified_time_of_dir(path: Path) -> float:
@@ -659,7 +659,6 @@ def _make_truss_config(
659
659
  "to secrets - no need to manually add it."
660
660
  )
661
661
  config.model_cache.models = assets.cached
662
- config.external_data = truss_config.ExternalData(items=assets.external_data)
663
662
  # Metadata.
664
663
  chains_metadata: definitions.TrussMetadata = definitions.TrussMetadata(
665
664
  user_config=user_config, chainlet_to_service=chainlet_to_service
@@ -245,7 +245,6 @@ class AssetSpec(SafeModel):
245
245
  # TODO: this is not stable yet and might change or refer back to truss.
246
246
  secrets: dict[str, str] = pydantic.Field({})
247
247
  cached: list[truss_config.ModelRepo] = []
248
- external_data: list[truss_config.ExternalDataItem] = []
249
248
 
250
249
 
251
250
  class Assets:
@@ -274,7 +273,6 @@ class Assets:
274
273
  self,
275
274
  cached: Iterable[truss_config.ModelRepo] = (),
276
275
  secret_keys: Iterable[str] = (),
277
- external_data: Iterable[truss_config.ExternalDataItem] = (),
278
276
  ) -> None:
279
277
  """
280
278
  Args:
@@ -282,15 +280,9 @@ class Assets:
282
280
  secret_keys: Names of secrets stored on baseten, that the
283
281
  chainlet should have access to. You can manage secrets on baseten
284
282
  `here <https://app.baseten.co/settings/secrets>`_.
285
- external_data: Data to be downloaded from public URLs and made available
286
- in the deployment (via ``context.data_dir``). See
287
- `here <https://docs.baseten.co/reference/config#external-data>` for
288
- more details.
289
283
  """
290
284
  self._spec = AssetSpec(
291
- cached=list(cached),
292
- secrets={k: SECRET_DUMMY for k in secret_keys},
293
- external_data=list(external_data),
285
+ cached=list(cached), secrets={k: SECRET_DUMMY for k in secret_keys}
294
286
  )
295
287
 
296
288
  def get_spec(self) -> AssetSpec:
@@ -17,7 +17,6 @@ from typing import (
17
17
  )
18
18
 
19
19
  import truss
20
- from tenacity import retry, stop_after_delay, wait_fixed
21
20
  from truss.remote.baseten import remote as b10_remote
22
21
  from truss.remote.baseten import service as b10_service
23
22
  from truss.remote.baseten import types as b10_types
@@ -171,20 +170,17 @@ class RemoteChainService:
171
170
  self._chain_id = chain_id
172
171
  self._chain_deployment_id = chain_deployment_id
173
172
 
174
- def get_info(self) -> list[b10_types.DeployedChainlet]:
173
+ def get_info(self) -> list[tuple[str, str, str]]:
175
174
  """Return list with elements (name, status, logs_url) for each chainlet."""
176
175
  chainlets = self._remote.get_chainlets(
177
176
  chain_deployment_id=self._chain_deployment_id
178
177
  )
179
178
 
180
179
  return [
181
- b10_types.DeployedChainlet(
182
- name=chainlet["name"],
183
- is_entrypoint=chainlet["is_entrypoint"],
184
- status=chainlet["oracle_version"]["current_model_deployment_status"][
185
- "status"
186
- ],
187
- logs_url=_chainlet_logs_url(
180
+ (
181
+ chainlet["name"],
182
+ chainlet["oracle_version"]["current_model_deployment_status"]["status"],
183
+ _chainlet_logs_url(
188
184
  self._chain_id,
189
185
  self._chain_deployment_id,
190
186
  chainlet["id"],
@@ -289,8 +285,7 @@ class ChainService:
289
285
  The JSON response."""
290
286
  return self.get_entrypoint.predict(json)
291
287
 
292
- @retry(stop=stop_after_delay(60), wait=wait_fixed(1), reraise=True)
293
- def get_info(self) -> list[b10_types.DeployedChainlet]:
288
+ def get_info(self) -> list[tuple[str, str, str]]:
294
289
  """Queries the statuses of all chainlets in the chain.
295
290
 
296
291
  Returns:
@@ -187,7 +187,7 @@ def _validate_endpoint_params(
187
187
  raise definitions.ChainsUsageError(
188
188
  "Inputs of endpoints must have type annotations. For "
189
189
  f"`{cls_name}.{definitions.ENDPOINT_METHOD_NAME}` parameter "
190
- f"`{param.name}` has no type annotation."
190
+ f"`{param.name}` has not type annotation."
191
191
  )
192
192
  _validate_io_type(param)
193
193
  type_descriptor = definitions.TypeDescriptor(raw=param.annotation)
@@ -1,44 +0,0 @@
1
- import base64
2
-
3
- import requests
4
- from whisper_trt import WhisperModel
5
- from whisper_trt.types import WhisperResult
6
-
7
-
8
- class Model:
9
- def __init__(self, **kwargs):
10
- self._data_dir = kwargs["data_dir"]
11
- self._secrets = kwargs["secrets"]
12
- self._model = None
13
-
14
- def load(self):
15
- self._model = WhisperModel(str(self._data_dir), max_queue_time=0.050)
16
-
17
- def preprocess(self, request: dict):
18
- audio_base64 = request.get("audio")
19
- audio_url = request.get("url")
20
-
21
- if audio_base64 and audio_url:
22
- return {
23
- "error": "Only a base64 audio file OR a URL can be passed to the API, not both of them.",
24
- }
25
- if not audio_base64 and not audio_url:
26
- return {
27
- "error": "Please provide either an audio file in base64 string format or a URL to an audio file.",
28
- }
29
-
30
- binary_data = None
31
-
32
- if audio_base64:
33
- binary_data = base64.b64decode(audio_base64.encode("utf-8"))
34
- elif audio_url:
35
- resp = requests.get(audio_url)
36
- binary_data = resp.content
37
- return binary_data, request
38
-
39
- async def predict(self, preprocessed_request) -> WhisperResult:
40
- binary_data, request = preprocessed_request
41
- waveform = self._model.preprocess_audio(binary_data)
42
- return await self._model.transcribe(
43
- waveform, language="english", timestamps=True
44
- )