truss 0.10.0rc1__tar.gz → 0.60.0__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.
Potentially problematic release.
This version of truss might be problematic. Click here for more details.
- {truss-0.10.0rc1 → truss-0.60.0}/CONTRIBUTING.md +6 -5
- {truss-0.10.0rc1 → truss-0.60.0}/PKG-INFO +18 -16
- {truss-0.10.0rc1 → truss-0.60.0}/context_builder.Dockerfile +5 -2
- truss-0.60.0/pyproject.toml +231 -0
- truss-0.60.0/truss/__init__.py +21 -0
- truss-0.60.0/truss/api/__init__.py +123 -0
- truss-0.60.0/truss/api/definitions.py +51 -0
- truss-0.60.0/truss/base/constants.py +116 -0
- truss-0.60.0/truss/base/custom_types.py +29 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/base}/errors.py +4 -0
- truss-0.60.0/truss/base/trt_llm_config.py +310 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/base}/truss_config.py +344 -31
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/base}/truss_spec.py +20 -6
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/base}/validation.py +60 -11
- truss-0.60.0/truss/cli/cli.py +1360 -0
- {truss-0.10.0rc1/truss/remote → truss-0.60.0/truss/cli}/remote_cli.py +2 -7
- truss-0.60.0/truss/contexts/docker_build_setup.py +67 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/image_builder/cache_warmer.py +2 -8
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/image_builder/image_builder.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/image_builder/serving_image_builder.py +292 -46
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/image_builder/util.py +1 -3
- truss-0.60.0/truss/contexts/local_loader/docker_build_emulator.py +58 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/local_loader/load_model_local.py +2 -2
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/local_loader/truss_module_loader.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/local_loader/utils.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/local/local_config.py +2 -6
- {truss-0.10.0rc1 → truss-0.60.0}/truss/local/local_config_handler.py +20 -5
- truss-0.60.0/truss/patch/__init__.py +1 -0
- truss-0.60.0/truss/patch/hash.py +5 -0
- truss-0.60.0/truss/patch/signature.py +5 -0
- truss-0.60.0/truss/patch/truss_dir_patch_applier.py +5 -0
- truss-0.60.0/truss/remote/baseten/api.py +536 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/remote/baseten/auth.py +3 -3
- truss-0.60.0/truss/remote/baseten/core.py +430 -0
- truss-0.60.0/truss/remote/baseten/custom_types.py +44 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/remote/baseten/error.py +4 -0
- truss-0.60.0/truss/remote/baseten/remote.py +561 -0
- truss-0.60.0/truss/remote/baseten/service.py +189 -0
- truss-0.60.0/truss/remote/baseten/utils/status.py +29 -0
- truss-0.60.0/truss/remote/baseten/utils/tar.py +72 -0
- truss-0.60.0/truss/remote/baseten/utils/transfer.py +50 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/remote/remote_factory.py +14 -5
- {truss-0.10.0rc1 → truss-0.60.0}/truss/remote/truss_remote.py +72 -45
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/base.Dockerfile.jinja +18 -16
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/cache.Dockerfile.jinja +3 -3
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/application.py +14 -35
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/endpoints.py +39 -9
- truss-0.10.0rc1/truss/server/control/patch/types.py → truss-0.60.0/truss/templates/control/control/helpers/custom_types.py +13 -52
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/helpers/inference_server_controller.py +4 -8
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/helpers/inference_server_process_controller.py +2 -4
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/helpers/inference_server_starter.py +5 -10
- {truss-0.10.0rc1/truss/server/control/patch → truss-0.60.0/truss/templates/control/control/helpers/truss_patch}/model_code_patch_applier.py +8 -7
- {truss-0.10.0rc1/truss/server/control/patch → truss-0.60.0/truss/templates/control/control/helpers/truss_patch}/model_container_patch_applier.py +18 -26
- truss-0.60.0/truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py +66 -0
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/server.py +11 -6
- truss-0.60.0/truss/templates/control/requirements.txt +9 -0
- truss-0.60.0/truss/templates/custom_python_dx/my_model.py +28 -0
- truss-0.60.0/truss/templates/docker_server/proxy.conf.jinja +42 -0
- truss-0.60.0/truss/templates/docker_server/supervisord.conf.jinja +27 -0
- truss-0.60.0/truss/templates/docker_server_requirements.txt +1 -0
- truss-0.60.0/truss/templates/server/common/errors.py +231 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/templates}/server/common/patches/whisper/patch.py +1 -0
- truss-0.10.0rc1/truss/server/common/patches/__init__.py → truss-0.60.0/truss/templates/server/common/patches.py +1 -3
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/templates}/server/common/retry.py +1 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/templates}/server/common/schema.py +11 -9
- truss-0.60.0/truss/templates/server/common/tracing.py +157 -0
- truss-0.60.0/truss/templates/server/main.py +9 -0
- truss-0.60.0/truss/templates/server/model_wrapper.py +961 -0
- truss-0.60.0/truss/templates/server/requirements.txt +21 -0
- truss-0.60.0/truss/templates/server/truss_server.py +447 -0
- truss-0.60.0/truss/templates/server.Dockerfile.jinja +128 -0
- truss-0.60.0/truss/templates/shared/dynamic_config_resolver.py +28 -0
- truss-0.60.0/truss/templates/shared/lazy_data_resolver.py +164 -0
- truss-0.60.0/truss/templates/shared/log_config.py +125 -0
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates}/shared/secrets_resolver.py +1 -2
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates}/shared/serialization.py +31 -9
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates}/shared/util.py +3 -13
- truss-0.60.0/truss/templates/trtllm-audio/model/model.py +49 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/sigint_patch.py +14 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/__init__.py +215 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/assets.py +25 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/batching.py +52 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/custom_types.py +26 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/modeling.py +184 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/tokenizer.py +185 -0
- truss-0.60.0/truss/templates/trtllm-audio/packages/whisper_trt/utils.py +245 -0
- truss-0.60.0/truss/templates/trtllm-briton/src/extension.py +64 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/conftest.py +302 -94
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/contexts/image_builder/test_serving_image_builder.py +74 -31
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/contexts/local_loader/test_load_local.py +2 -2
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/contexts/local_loader/test_truss_module_finder.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_calc_patch.py +439 -127
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_dir_signature.py +3 -12
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_hash.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_signature.py +1 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_truss_dir_patch_applier.py +23 -11
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/patch/test_types.py +2 -2
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/remote/baseten/test_api.py +153 -58
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/remote/baseten/test_auth.py +2 -1
- truss-0.60.0/truss/tests/remote/baseten/test_core.py +234 -0
- truss-0.60.0/truss/tests/remote/baseten/test_remote.py +682 -0
- truss-0.60.0/truss/tests/remote/baseten/test_service.py +55 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/remote/test_remote_factory.py +16 -18
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/remote/test_truss_remote.py +26 -17
- truss-0.60.0/truss/tests/templates/control/control/helpers/test_context_managers.py +11 -0
- truss-0.60.0/truss/tests/templates/control/control/helpers/test_model_container_patch_applier.py +184 -0
- truss-0.60.0/truss/tests/templates/control/control/helpers/test_requirement_name_identifier.py +89 -0
- {truss-0.10.0rc1/truss/tests/server → truss-0.60.0/truss/tests/templates/control}/control/test_server.py +79 -24
- {truss-0.10.0rc1/truss/tests/server → truss-0.60.0/truss/tests/templates/control}/control/test_server_integration.py +24 -16
- truss-0.60.0/truss/tests/templates/core/server/test_dynamic_config_resolver.py +108 -0
- truss-0.60.0/truss/tests/templates/core/server/test_lazy_data_resolver.py +329 -0
- truss-0.60.0/truss/tests/templates/core/server/test_lazy_data_resolver_v2.py +79 -0
- {truss-0.10.0rc1/truss/tests/server → truss-0.60.0/truss/tests/templates}/core/server/test_secrets_resolver.py +1 -1
- {truss-0.10.0rc1/truss/tests → truss-0.60.0/truss/tests/templates}/server/common/test_retry.py +3 -3
- truss-0.60.0/truss/tests/templates/server/test_model_wrapper.py +248 -0
- {truss-0.10.0rc1/truss/tests → truss-0.60.0/truss/tests/templates}/server/test_schema.py +3 -5
- {truss-0.10.0rc1/truss/tests/server/core/server/common → truss-0.60.0/truss/tests/templates/server}/test_truss_server.py +8 -5
- truss-0.60.0/truss/tests/test_build.py +20 -0
- truss-0.60.0/truss/tests/test_config.py +572 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_context_builder_image.py +3 -11
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_control_truss_patching.py +7 -12
- truss-0.60.0/truss/tests/test_custom_server.py +38 -0
- truss-0.60.0/truss/tests/test_data/context_builder_image_test/test.py +3 -0
- truss-0.60.0/truss/tests/test_data/gcs_fix/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/gcs_fix/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/happy.ipynb +56 -0
- truss-0.60.0/truss/tests/test_data/model_load_failure_test/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/model_load_failure_test/config.yaml +2 -0
- truss-0.60.0/truss/tests/test_data/model_load_failure_test/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/patch_ping_test_server/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/patch_ping_test_server/app.py +3 -9
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/server.Dockerfile +20 -21
- truss-0.60.0/truss/tests/test_data/server_conformance_test_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/server_conformance_test_truss/model/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/server_conformance_test_truss/model/model.py +1 -3
- truss-0.60.0/truss/tests/test_data/test_async_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_async_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_basic_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_basic_truss/config.yaml +16 -0
- truss-0.60.0/truss/tests/test_data/test_basic_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands/config.yaml +13 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands/model/__init__.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_streaming_async_generator_truss → truss-0.60.0/truss/tests/test_data/test_build_commands}/model/model.py +2 -3
- truss-0.60.0/truss/tests/test_data/test_build_commands_failure/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands_failure/config.yaml +14 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands_failure/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_build_commands_failure/model/model.py +17 -0
- truss-0.60.0/truss/tests/test_data/test_concurrency_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_concurrency_truss/config.yaml +4 -0
- truss-0.60.0/truss/tests/test_data/test_concurrency_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/config.yaml +20 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/Dockerfile +17 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/README.md +10 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/VERSION +1 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/app.py +19 -0
- truss-0.60.0/truss/tests/test_data/test_custom_server_truss/test_docker_image/build_upload_new_image.sh +6 -0
- truss-0.60.0/truss/tests/test_data/test_openai/__init__.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_basic_truss → truss-0.60.0/truss/tests/test_data/test_openai}/config.yaml +1 -2
- truss-0.60.0/truss/tests/test_data/test_openai/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_openai/model/model.py +15 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v1/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v1/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v1/model/model.py +28 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v1/requirements.txt +1 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v2/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v2/config.yaml +13 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v2/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v2/model/model.py +30 -0
- truss-0.60.0/truss/tests/test_data/test_pyantic_v2/requirements.txt +1 -0
- truss-0.60.0/truss/tests/test_data/test_requirements_file_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_requirements_file_truss/config.yaml +13 -0
- truss-0.60.0/truss/tests/test_data/test_requirements_file_truss/model/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_requirements_file_truss/model/model.py +1 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_async_generator_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_async_generator_truss/config.yaml +4 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_async_generator_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_async_generator_truss/model/model.py +7 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_read_timeout/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_read_timeout/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss/config.yaml +4 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_error/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_error/model/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_streaming_truss_with_error/model/model.py +3 -11
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_error/packages/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_error/packages/helpers_1.py +5 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_error/packages/helpers_2.py +2 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_tracing/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_tracing/config.yaml +43 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_tracing/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_streaming_truss_with_tracing/model/model.py +65 -0
- truss-0.60.0/truss/tests/test_data/test_trt_llm_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_trt_llm_truss/config.yaml +15 -0
- truss-0.60.0/truss/tests/test_data/test_trt_llm_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_trt_llm_truss/model/model.py +15 -0
- truss-0.60.0/truss/tests/test_data/test_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss/config.yaml +4 -0
- truss-0.60.0/truss/tests/test_data/test_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss/model/dummy +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss/packages/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss/packages/test_package/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_server_caching_truss/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_server_caching_truss/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/config.yaml +4 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/model/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/model/model.py +8 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/packages/__init__.py +0 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/packages/helpers_1.py +5 -0
- truss-0.60.0/truss/tests/test_data/test_truss_with_error/packages/helpers_2.py +2 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_docker.py +2 -1
- truss-0.60.0/truss/tests/test_model_inference.py +1861 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_model_schema.py +33 -26
- truss-0.60.0/truss/tests/test_testing_utilities_for_other_tests.py +100 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_truss_gatherer.py +3 -5
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_truss_handle.py +62 -59
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_util.py +2 -1
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/test_validation.py +15 -13
- truss-0.60.0/truss/tests/trt_llm/test_trt_llm_config.py +41 -0
- truss-0.60.0/truss/tests/trt_llm/test_validation.py +91 -0
- truss-0.60.0/truss/tests/util/test_config_checks.py +40 -0
- truss-0.60.0/truss/tests/util/test_env_vars.py +14 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/util/test_path.py +10 -23
- truss-0.60.0/truss/trt_llm/config_checks.py +43 -0
- truss-0.60.0/truss/trt_llm/validation.py +42 -0
- truss-0.60.0/truss/truss_handle/__init__.py +0 -0
- truss-0.60.0/truss/truss_handle/build.py +122 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/decorators.py +1 -1
- truss-0.60.0/truss/truss_handle/patch/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/calc_patch.py +146 -92
- truss-0.10.0rc1/truss/types.py → truss-0.60.0/truss/truss_handle/patch/custom_types.py +35 -27
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/dir_signature.py +1 -1
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/hash.py +2 -2
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/local_truss_patch_applier.py +6 -4
- truss-0.60.0/truss/truss_handle/patch/signature.py +22 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/truss_dir_patch_applier.py +34 -27
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/readme_generator.py +3 -2
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/truss_gatherer.py +3 -2
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/truss_handle.py +174 -78
- {truss-0.10.0rc1 → truss-0.60.0}/truss/util/.truss_ignore +3 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/util}/docker.py +6 -2
- {truss-0.10.0rc1 → truss-0.60.0}/truss/util/download.py +6 -15
- truss-0.60.0/truss/util/env_vars.py +41 -0
- truss-0.60.0/truss/util/log_utils.py +52 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/util/path.py +20 -20
- truss-0.60.0/truss/util/requirements.py +11 -0
- truss-0.60.0/truss-chains/truss_chains/__init__.py +71 -0
- truss-0.60.0/truss-chains/truss_chains/definitions.py +756 -0
- truss-0.60.0/truss-chains/truss_chains/deployment/code_gen.py +816 -0
- truss-0.60.0/truss-chains/truss_chains/deployment/deployment_client.py +871 -0
- truss-0.60.0/truss-chains/truss_chains/framework.py +1480 -0
- truss-0.60.0/truss-chains/truss_chains/public_api.py +231 -0
- truss-0.60.0/truss-chains/truss_chains/pydantic_numpy.py +131 -0
- truss-0.60.0/truss-chains/truss_chains/reference_code/reference_chainlet.py +34 -0
- truss-0.60.0/truss-chains/truss_chains/reference_code/reference_model.py +10 -0
- truss-0.60.0/truss-chains/truss_chains/remote_chainlet/model_skeleton.py +60 -0
- truss-0.60.0/truss-chains/truss_chains/remote_chainlet/stub.py +380 -0
- truss-0.60.0/truss-chains/truss_chains/remote_chainlet/utils.py +332 -0
- truss-0.60.0/truss-chains/truss_chains/streaming.py +378 -0
- truss-0.60.0/truss-chains/truss_chains/utils.py +178 -0
- truss-0.10.0rc1/pyproject.toml +0 -108
- truss-0.10.0rc1/truss/__init__.py +0 -14
- truss-0.10.0rc1/truss/blob/blob_backend.py +0 -10
- truss-0.10.0rc1/truss/blob/blob_backend_registry.py +0 -23
- truss-0.10.0rc1/truss/blob/http_public_blob_backend.py +0 -23
- truss-0.10.0rc1/truss/build/__init__.py +0 -2
- truss-0.10.0rc1/truss/build/build.py +0 -143
- truss-0.10.0rc1/truss/build/configure.py +0 -63
- truss-0.10.0rc1/truss/cli/__init__.py +0 -2
- truss-0.10.0rc1/truss/cli/cli.py +0 -607
- truss-0.10.0rc1/truss/cli/console.py +0 -5
- truss-0.10.0rc1/truss/cli/create.py +0 -5
- truss-0.10.0rc1/truss/config/trt_llm.py +0 -81
- truss-0.10.0rc1/truss/constants.py +0 -61
- truss-0.10.0rc1/truss/model_inference.py +0 -123
- truss-0.10.0rc1/truss/patch/signature.py +0 -17
- truss-0.10.0rc1/truss/patch/types.py +0 -30
- truss-0.10.0rc1/truss/pytest.ini +0 -7
- truss-0.10.0rc1/truss/remote/baseten/api.py +0 -251
- truss-0.10.0rc1/truss/remote/baseten/core.py +0 -223
- truss-0.10.0rc1/truss/remote/baseten/remote.py +0 -310
- truss-0.10.0rc1/truss/remote/baseten/service.py +0 -82
- truss-0.10.0rc1/truss/remote/baseten/utils/tar.py +0 -60
- truss-0.10.0rc1/truss/remote/baseten/utils/transfer.py +0 -37
- truss-0.10.0rc1/truss/server/common/errors.py +0 -100
- truss-0.10.0rc1/truss/server/common/termination_handler_middleware.py +0 -64
- truss-0.10.0rc1/truss/server/common/truss_server.py +0 -389
- truss-0.10.0rc1/truss/server/control/patch/requirement_name_identifier.py +0 -17
- truss-0.10.0rc1/truss/server/control/truss_patch/model_code_patch_applier.py +0 -45
- truss-0.10.0rc1/truss/server/inference_server.py +0 -29
- truss-0.10.0rc1/truss/server/model_wrapper.py +0 -434
- truss-0.10.0rc1/truss/server/shared/logging.py +0 -81
- truss-0.10.0rc1/truss/templates/server.Dockerfile.jinja +0 -80
- truss-0.10.0rc1/truss/templates/trtllm/model/model.py +0 -97
- truss-0.10.0rc1/truss/templates/trtllm/packages/build_engine_utils.py +0 -34
- truss-0.10.0rc1/truss/templates/trtllm/packages/constants.py +0 -11
- truss-0.10.0rc1/truss/templates/trtllm/packages/schema.py +0 -216
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/ensemble/config.pbtxt +0 -246
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/postprocessing/1/model.py +0 -181
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/postprocessing/config.pbtxt +0 -64
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/preprocessing/1/model.py +0 -260
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/preprocessing/config.pbtxt +0 -99
- truss-0.10.0rc1/truss/templates/trtllm/packages/tensorrt_llm_model_repository/tensorrt_llm/config.pbtxt +0 -208
- truss-0.10.0rc1/truss/templates/trtllm/packages/triton_client.py +0 -150
- truss-0.10.0rc1/truss/templates/trtllm/packages/utils.py +0 -43
- truss-0.10.0rc1/truss/test_data/context_builder_image_test/test.py +0 -4
- truss-0.10.0rc1/truss/test_data/happy.ipynb +0 -54
- truss-0.10.0rc1/truss/test_data/model_load_failure_test/config.yaml +0 -2
- truss-0.10.0rc1/truss/test_data/test_concurrency_truss/config.yaml +0 -2
- truss-0.10.0rc1/truss/test_data/test_streaming_async_generator_truss/config.yaml +0 -2
- truss-0.10.0rc1/truss/test_data/test_streaming_truss/config.yaml +0 -3
- truss-0.10.0rc1/truss/test_data/test_truss/config.yaml +0 -2
- truss-0.10.0rc1/truss/tests/remote/baseten/test_core.py +0 -86
- truss-0.10.0rc1/truss/tests/remote/baseten/test_remote.py +0 -270
- truss-0.10.0rc1/truss/tests/server/common/test_termination_handler_middleware.py +0 -93
- truss-0.10.0rc1/truss/tests/server/control/test_model_container_patch_applier.py +0 -203
- truss-0.10.0rc1/truss/tests/server/core/server/common/test_util.py +0 -19
- truss-0.10.0rc1/truss/tests/server/test_model_wrapper.py +0 -87
- truss-0.10.0rc1/truss/tests/test_build.py +0 -63
- truss-0.10.0rc1/truss/tests/test_config.py +0 -313
- truss-0.10.0rc1/truss/tests/test_model_inference.py +0 -813
- truss-0.10.0rc1/truss/tests/test_testing_utilities_for_other_tests.py +0 -55
- truss-0.10.0rc1/truss/util/data_structures.py +0 -16
- {truss-0.10.0rc1 → truss-0.60.0}/CODE_OF_CONDUCT.md +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/LICENSE +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/README.md +0 -0
- {truss-0.10.0rc1/truss/test_data/annotated_types_truss/model → truss-0.60.0/truss/base}/__init__.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/contexts/truss_context.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/remote/baseten/__init__.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/README.md.jinja +0 -0
- {truss-0.10.0rc1/truss/test_data/gcs_fix/model → truss-0.60.0/truss/templates}/__init__.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/cache_requirements.txt +0 -0
- {truss-0.10.0rc1/truss/server → truss-0.60.0/truss/templates/control}/control/helpers/context_managers.py +0 -0
- {truss-0.10.0rc1/truss/server/control → truss-0.60.0/truss/templates/control/control/helpers}/errors.py +0 -0
- {truss-0.10.0rc1/truss/server/control/patch → truss-0.60.0/truss/templates/control/control/helpers/truss_patch}/__init__.py +0 -0
- {truss-0.10.0rc1/truss/server/control/patch → truss-0.60.0/truss/templates/control/control/helpers/truss_patch}/system_packages.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/copy_cache_files.Dockerfile.jinja +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/custom/examples.yaml +0 -0
- {truss-0.10.0rc1/truss/test_data/server_conformance_test_truss → truss-0.60.0/truss/templates/custom}/model/__init__.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/templates/custom/model/model.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_basic_truss/model → truss-0.60.0/truss/templates/server}/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/templates}/server/common/__init__.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_requirements_file_truss/model → truss-0.60.0/truss/templates/shared}/__init__.py +0 -0
- {truss-0.10.0rc1/truss/templates/trtllm → truss-0.60.0/truss/templates/trtllm-briton}/README.md +0 -0
- {truss-0.10.0rc1/truss/test_data/test_truss/model → truss-0.60.0/truss/tests}/__init__.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/helpers.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/tests/local/test_local_config_handler.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_truss_server_caching_truss/model → truss-0.60.0/truss/tests/test_data}/__init__.py +0 -0
- {truss-0.10.0rc1/truss/tests → truss-0.60.0/truss/tests/test_data/annotated_types_truss}/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/annotated_types_truss/config.yaml +0 -0
- {truss-0.10.0rc1/truss/tests/local → truss-0.60.0/truss/tests/test_data/annotated_types_truss/model}/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/annotated_types_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/auto-mpg.data +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/context_builder_image_test/Dockerfile +0 -0
- truss-0.10.0rc1/truss/test_data/test_truss/model/dummy → truss-0.60.0/truss/tests/test_data/context_builder_image_test/__init__.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/gcs_fix/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/gcs_fix/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/model_load_failure_test/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/pima-indians-diabetes.csv +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/readme_int_example.md +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/readme_no_example.md +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/readme_str_example.md +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/server_conformance_test_truss/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_async_truss/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_async_truss/model/model.py +3 -3
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_basic_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_concurrency_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss/test_data/test_requirements_file_truss → truss-0.60.0/truss/tests/test_data/test_pyantic_v1}/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_requirements_file_truss/requirements.txt +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_streaming_read_timeout/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_streaming_read_timeout/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_streaming_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_streaming_truss_with_error/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_truss/examples.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_truss/packages/test_package/test.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_truss_server_caching_truss/config.yaml +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/tests}/test_data/test_truss_server_caching_truss/model/model.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/truss_handle}/patch/constants.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/util/gpu.py +0 -0
- {truss-0.10.0rc1 → truss-0.60.0}/truss/util/jinja.py +0 -0
- {truss-0.10.0rc1/truss → truss-0.60.0/truss/util}/notebook.py +0 -0
- {truss-0.10.0rc1/truss/server/shared → truss-0.60.0/truss-chains/truss_chains/deployment}/__init__.py +0 -0
- /truss-0.10.0rc1/truss/templates/__init__.py → /truss-0.60.0/truss-chains/truss_chains/py.typed +0 -0
- {truss-0.10.0rc1/truss/templates/custom/model → truss-0.60.0/truss-chains/truss_chains/remote_chainlet}/__init__.py +0 -0
|
@@ -4,8 +4,8 @@ Truss was first created at [Baseten](https://baseten.co), but as an open and liv
|
|
|
4
4
|
|
|
5
5
|
We use GitHub features for project management on Truss:
|
|
6
6
|
|
|
7
|
-
* For bugs and feature requests, file an issue.
|
|
8
|
-
* For changes and updates, create a pull request.
|
|
7
|
+
* For bugs and feature requests, [file an issue](https://github.com/basetenlabs/truss/issues).
|
|
8
|
+
* For changes and updates, create a [pull request](https://github.com/basetenlabs/truss/pulls).
|
|
9
9
|
* To view and comment on the roadmap, [check the projects tab](https://github.com/orgs/basetenlabs/projects/3).
|
|
10
10
|
|
|
11
11
|
## Local development
|
|
@@ -20,16 +20,17 @@ We use `asdf` to manage Python binaries and `poetry` to manage Python dependenci
|
|
|
20
20
|
|
|
21
21
|
For development in a macOS environment, we use `brew` to manage system packages.
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```bash
|
|
24
24
|
# Install asdf (or use another method https://asdf-vm.com/)
|
|
25
25
|
brew install asdf
|
|
26
26
|
|
|
27
27
|
# Install `asdf` managed python and poetry
|
|
28
28
|
asdf plugin add python
|
|
29
29
|
asdf plugin add poetry
|
|
30
|
+
asdf install
|
|
30
31
|
|
|
31
32
|
# Install poetry dependencies
|
|
32
|
-
poetry install
|
|
33
|
+
poetry install --with=dev,dev-server --extras=all
|
|
33
34
|
|
|
34
35
|
# And finally precommit
|
|
35
36
|
poetry run pre-commit install
|
|
@@ -37,7 +38,7 @@ poetry run pre-commit install
|
|
|
37
38
|
|
|
38
39
|
Then to run the entire test suite
|
|
39
40
|
|
|
40
|
-
```
|
|
41
|
+
```bash
|
|
41
42
|
poetry run pytest truss/tests
|
|
42
43
|
```
|
|
43
44
|
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: truss
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.60.0
|
|
4
4
|
Summary: A seamless bridge from model development to model delivery
|
|
5
|
-
Home-page: https://github.com/basetenlabs/truss
|
|
6
5
|
License: MIT
|
|
7
6
|
Keywords: MLOps,AI,Model Serving,Model Deployment,Machine Learning
|
|
8
7
|
Author: Pankaj Gupta
|
|
9
8
|
Author-email: pankaj@baseten.co
|
|
10
|
-
Requires-Python: >=3.8,<3.
|
|
9
|
+
Requires-Python: >=3.8,<3.13
|
|
11
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
12
11
|
Classifier: Programming Language :: Python :: 3
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.8
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Provides-Extra: all
|
|
17
18
|
Requires-Dist: Jinja2 (>=3.1.2,<4.0.0)
|
|
18
|
-
Requires-Dist: PyYAML (>=6.0
|
|
19
|
+
Requires-Dist: PyYAML (>=6.0)
|
|
20
|
+
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
|
|
21
|
+
Requires-Dist: aiohttp (>=3.10.10,<4.0.0)
|
|
19
22
|
Requires-Dist: blake3 (>=0.3.3,<0.4.0)
|
|
20
|
-
Requires-Dist: boto3 (>=1.
|
|
21
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: boto3 (>=1.34.85,<2.0.0)
|
|
24
|
+
Requires-Dist: click (>=8.0.3,<9.0.0)
|
|
25
|
+
Requires-Dist: fastapi (>=0.109.1)
|
|
22
26
|
Requires-Dist: google-cloud-storage (==2.10.0)
|
|
23
|
-
Requires-Dist: httpx (>=0.24.1
|
|
24
|
-
Requires-Dist: huggingface_hub (>=0.
|
|
27
|
+
Requires-Dist: httpx (>=0.24.1)
|
|
28
|
+
Requires-Dist: huggingface_hub (>=0.25.0)
|
|
25
29
|
Requires-Dist: inquirerpy (>=0.3.4,<0.4.0)
|
|
30
|
+
Requires-Dist: libcst (<1.2.0)
|
|
26
31
|
Requires-Dist: loguru (>=0.7.2)
|
|
27
|
-
Requires-Dist: msgpack (>=1.0.2)
|
|
28
|
-
Requires-Dist: msgpack-numpy (>=0.4.7.1)
|
|
29
|
-
Requires-Dist: numpy (>=1.23.5)
|
|
30
32
|
Requires-Dist: packaging (>=20.9)
|
|
31
33
|
Requires-Dist: pathspec (>=0.9.0)
|
|
32
|
-
Requires-Dist: psutil (>=5.9.4
|
|
33
|
-
Requires-Dist: pydantic (>=
|
|
34
|
+
Requires-Dist: psutil (>=5.9.4)
|
|
35
|
+
Requires-Dist: pydantic (>=1.10.0)
|
|
34
36
|
Requires-Dist: python-json-logger (>=2.0.2)
|
|
35
37
|
Requires-Dist: python-on-whales (>=0.68.0,<0.69.0)
|
|
38
|
+
Requires-Dist: requests (>=2.31)
|
|
36
39
|
Requires-Dist: rich (>=13.4.2,<14.0.0)
|
|
37
40
|
Requires-Dist: rich-click (>=1.6.1,<2.0.0)
|
|
41
|
+
Requires-Dist: ruff (>=0.4.8)
|
|
38
42
|
Requires-Dist: single-source (>=0.3.0,<0.4.0)
|
|
39
43
|
Requires-Dist: tenacity (>=8.0.1,<9.0.0)
|
|
40
|
-
Requires-Dist: uvicorn (>=0.24.0,<0.25.0)
|
|
41
|
-
Requires-Dist: uvloop (>=0.19.0,<0.20.0)
|
|
42
44
|
Requires-Dist: watchfiles (>=0.19.0,<0.20.0)
|
|
43
45
|
Project-URL: Bug Reports, https://github.com/basetenlabs/truss/issues
|
|
44
46
|
Project-URL: Baseten, https://baseten.co
|
|
@@ -14,11 +14,14 @@ RUN curl -sSL https://install.python-poetry.org | python -
|
|
|
14
14
|
|
|
15
15
|
ENV PATH="/root/.local/bin:${PATH}"
|
|
16
16
|
COPY ./truss ./truss
|
|
17
|
+
# Chains source code is not actually needed (and deps from chains group won't be
|
|
18
|
+
# installed when using `--only builder`). But nonetheless poetry fails the install
|
|
19
|
+
# if this directory is not present/empty - so we copy it.
|
|
20
|
+
COPY ./truss-chains ./truss-chains
|
|
17
21
|
COPY ./pyproject.toml ./pyproject.toml
|
|
18
22
|
COPY ./poetry.lock ./poetry.lock
|
|
19
23
|
COPY ./README.md ./README.md
|
|
20
24
|
|
|
21
25
|
# https://python-poetry.org/docs/configuration/#virtualenvsin-project
|
|
22
26
|
# to write to project root .venv file to be used for context builder test
|
|
23
|
-
RUN poetry config virtualenvs.in-project true
|
|
24
|
-
&& poetry install --only builder
|
|
27
|
+
RUN poetry config virtualenvs.in-project true && poetry install --extras=all
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "truss"
|
|
3
|
+
version = "0.60.0"
|
|
4
|
+
description = "A seamless bridge from model development to model delivery"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
authors = ["Pankaj Gupta <pankaj@baseten.co>", "Phil Howes <phil@baseten.co>"]
|
|
8
|
+
include = ["*.txt", "*.Dockerfile", "*.md"]
|
|
9
|
+
repository = "https://github.com/basetenlabs/truss"
|
|
10
|
+
keywords = [
|
|
11
|
+
"MLOps",
|
|
12
|
+
"AI",
|
|
13
|
+
"Model Serving",
|
|
14
|
+
"Model Deployment",
|
|
15
|
+
"Machine Learning",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
packages = [
|
|
19
|
+
{ include = "truss", from = "." },
|
|
20
|
+
{ include = "truss_chains", from = "./truss-chains" },
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
requires-poetry = ">=2.0"
|
|
24
|
+
|
|
25
|
+
[tool.poetry.scripts]
|
|
26
|
+
truss = "truss.cli.cli:truss_cli"
|
|
27
|
+
truss-docker-build-setup = "truss.contexts.docker_build_setup:docker_build_setup"
|
|
28
|
+
|
|
29
|
+
[tool.poetry.urls]
|
|
30
|
+
"Homepage" = "https://truss.baseten.co"
|
|
31
|
+
"Bug Reports" = "https://github.com/basetenlabs/truss/issues"
|
|
32
|
+
"Documentation" = "https://truss.baseten.co"
|
|
33
|
+
"Baseten" = "https://baseten.co"
|
|
34
|
+
|
|
35
|
+
# Note: *why* are dependencies and defined like this?
|
|
36
|
+
# The goal is to factorize the overall truss package into a light-weight `base` part that includes
|
|
37
|
+
# e.g. the Truss config and has no heavy dependencies. Other functionalities are organzied into
|
|
38
|
+
# components (or "extras") sub-packages, that can be selectively installed (and heavy dependencies
|
|
39
|
+
# are only installed as needed).
|
|
40
|
+
#
|
|
41
|
+
# These sub-packages should have clear separation of concerns, and it should be carefully designed
|
|
42
|
+
# how they depend on and import each other (e.g. `base` must not depend on anything else, the
|
|
43
|
+
# server does not need local CLI tools).
|
|
44
|
+
#
|
|
45
|
+
# We want components to be selectable via pip installs (e.g. `pip install truss[server]`).
|
|
46
|
+
# Unfortunately poetry dependency groups don't integrate natively with the "extras" concept:
|
|
47
|
+
# Specifically, dependencies listed in groups (other than the implicit main group) cannot be used
|
|
48
|
+
# for extras.
|
|
49
|
+
#
|
|
50
|
+
# This leaves us with the following process:
|
|
51
|
+
#
|
|
52
|
+
# * Use poetry groups only for dev dependencies. These are never included in pip. For dev envs
|
|
53
|
+
# use the following installation command `poetry install --with=dev,dev-server --extras=all`.
|
|
54
|
+
# * All other dependencies are in the main group `tool.poetry.dependencies`. Base dependencies are
|
|
55
|
+
# at the top and non-optional.
|
|
56
|
+
# * Dependencies from other compoents are listed after, and marked with `optional = false`. If a
|
|
57
|
+
# dependency is needed by mutlipe extras, only add it once, but see next step. This also ensures
|
|
58
|
+
# that poetry resolves *all* dependencies from all extras to be globally consistent.
|
|
59
|
+
# * Since poetry groups don't work with extras, we need to make the association between a dependency
|
|
60
|
+
# and the componnent(s) in which it is used in a different way. Because it's cumbersome to fill
|
|
61
|
+
# in `tool.poetry.extras` manually, we automate this process and only define
|
|
62
|
+
# `tool.dependency_metadata` where we map for each extra dependency to one or multiple components
|
|
63
|
+
# that need it.
|
|
64
|
+
# * As a pre-commit step `pyproject_toml_linter.py` populates `tool.poetry.extras` groups and also
|
|
65
|
+
# creates an "all"-extras.
|
|
66
|
+
#
|
|
67
|
+
# TODO: The full factorization is WIP, so far only `base` has been cleanly factored out.
|
|
68
|
+
# All other dependencies are lumped together in "other". Customers should install truss
|
|
69
|
+
# as `pip install truss[local]`, so we temporarily fill local with all deps, until it is properly
|
|
70
|
+
# isolated.
|
|
71
|
+
[tool.poetry.dependencies]
|
|
72
|
+
# "base" dependencies.
|
|
73
|
+
# "When using chains, 3.9 will be required at runtime, but other truss functionality works with 3.8.
|
|
74
|
+
python = ">=3.8,<3.13"
|
|
75
|
+
huggingface_hub = ">=0.25.0"
|
|
76
|
+
pydantic = ">=1.10.0" # We cannot upgrade to v2, due to customer constraints.
|
|
77
|
+
PyYAML = ">=6.0"
|
|
78
|
+
single-source = "^0.3.0"
|
|
79
|
+
# "non-base" dependencies.
|
|
80
|
+
# TODO: until we have resolved the question on how users can install the local tools frictionless
|
|
81
|
+
# (extras cannot be marked to be included by default), all below packages are non-optional.
|
|
82
|
+
# This also means that so far extras defined in `[tool.poetry.extras]` don't have any meaning,
|
|
83
|
+
# since everything is globally included anyway.
|
|
84
|
+
Jinja2 = { version = "^3.1.2", optional = false }
|
|
85
|
+
aiofiles = { version = "^24.1.0", optional = false }
|
|
86
|
+
aiohttp = { version = "^3.10.10", optional = false }
|
|
87
|
+
blake3 = { version = "^0.3.3", optional = false }
|
|
88
|
+
boto3 = { version = "^1.34.85", optional = false }
|
|
89
|
+
click = { version = "^8.0.3", optional = false }
|
|
90
|
+
fastapi = { version =">=0.109.1", optional = false }
|
|
91
|
+
google-cloud-storage = { version = "2.10.0", optional = false }
|
|
92
|
+
httpx = { version = ">=0.24.1", optional = false }
|
|
93
|
+
inquirerpy = { version = "^0.3.4", optional = false }
|
|
94
|
+
libcst = { version = "<1.2.0", optional = false }
|
|
95
|
+
loguru = { version = ">=0.7.2", optional = false }
|
|
96
|
+
packaging = { version = ">=20.9", optional = false }
|
|
97
|
+
pathspec = { version = ">=0.9.0", optional = false }
|
|
98
|
+
psutil = { version = ">=5.9.4", optional = false }
|
|
99
|
+
python-json-logger = { version = ">=2.0.2", optional = false }
|
|
100
|
+
python-on-whales = { version = "^0.68.0", optional = false }
|
|
101
|
+
requests = { version = ">=2.31", optional = false }
|
|
102
|
+
rich = { version = "^13.4.2", optional = false }
|
|
103
|
+
rich-click = { version = "^1.6.1", optional = false }
|
|
104
|
+
ruff = { version = ">=0.4.8", optional = false } # Not a dev dep, needed for chains code gen.
|
|
105
|
+
tenacity = { version = "^8.0.1", optional = false }
|
|
106
|
+
watchfiles = { version = "^0.19.0", optional = false }
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
[tool.dependency_metadata]
|
|
110
|
+
# `base` / `main` deps which are non-optional are always included and don't need to be added here.
|
|
111
|
+
Jinja2 = { components = "other" }
|
|
112
|
+
aiofiles = { components = "other" }
|
|
113
|
+
aiohttp = { components = "other" }
|
|
114
|
+
blake3 = { components = "other" }
|
|
115
|
+
boto3 = { components = "other" }
|
|
116
|
+
click = { components = "other" }
|
|
117
|
+
google-cloud-storage = { components = "other" }
|
|
118
|
+
httpx = { components = "other" }
|
|
119
|
+
inquirerpy = { components = "other" }
|
|
120
|
+
libcst = { components = "other" }
|
|
121
|
+
loguru = { components = "other" }
|
|
122
|
+
packaging = { components = "other" }
|
|
123
|
+
pathspec = { components = "other" }
|
|
124
|
+
psutil = { components = "other" }
|
|
125
|
+
python-json-logger = { components = "other" }
|
|
126
|
+
python-on-whales = { components = "other" }
|
|
127
|
+
requests = { components = "other" }
|
|
128
|
+
rich = { components = "other" }
|
|
129
|
+
rich-click = { components = "other" }
|
|
130
|
+
ruff = { components = "other" }
|
|
131
|
+
tenacity = { components = "other" }
|
|
132
|
+
watchfiles = { components = "other" }
|
|
133
|
+
|
|
134
|
+
[tool.poetry.group.dev.dependencies]
|
|
135
|
+
# These packages are needed as the dev/testing tooling
|
|
136
|
+
ruff = "^0.9.0" # pinning ruff to a higher version for development
|
|
137
|
+
coverage = "^6.4.1"
|
|
138
|
+
httpx = { extras = ["cli"], version = "*" }
|
|
139
|
+
ipdb = "^0.13.9"
|
|
140
|
+
ipykernel = "^6.16.0"
|
|
141
|
+
ipython = "^7.16"
|
|
142
|
+
mypy = "^1.0.0"
|
|
143
|
+
nbconvert = "^7.2.1"
|
|
144
|
+
pre-commit = "^2.18.1"
|
|
145
|
+
pytest = "7.2.0"
|
|
146
|
+
pytest-asyncio = "^0.23.6"
|
|
147
|
+
pytest-check = "^2.4.1"
|
|
148
|
+
pytest-cov = "^3.0.0"
|
|
149
|
+
pytest-split = "^0.8.1"
|
|
150
|
+
requests-mock = ">=1.11.0"
|
|
151
|
+
tomlkit = ">=0.12"
|
|
152
|
+
types-PyYAML = "^6.0.12.12"
|
|
153
|
+
types-aiofiles = ">=24.1.0"
|
|
154
|
+
types-requests = "==2.31.0.2"
|
|
155
|
+
types-setuptools = "^69.0.0.0"
|
|
156
|
+
|
|
157
|
+
[tool.poetry.group.dev-server.dependencies]
|
|
158
|
+
# These packages are needed to run local tests of server components. Note that the actual
|
|
159
|
+
# server deps for building the docker image are (so far) defined in `requirements.txt`-files.
|
|
160
|
+
dockerfile = "^3.2.0"
|
|
161
|
+
fastapi =">=0.109.1"
|
|
162
|
+
flask = "^2.3.3"
|
|
163
|
+
msgpack = ">=1.0.2"
|
|
164
|
+
msgpack-numpy = ">=0.4.8"
|
|
165
|
+
numpy = ">=1.23.5"
|
|
166
|
+
opentelemetry-api = ">=1.25.0"
|
|
167
|
+
opentelemetry-exporter-otlp = ">=1.25.0"
|
|
168
|
+
opentelemetry-sdk = ">=1.25.0"
|
|
169
|
+
truss_transfer="0.0.1"
|
|
170
|
+
uvicorn = ">=0.24.0"
|
|
171
|
+
uvloop = ">=0.17.0"
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
[build-system]
|
|
175
|
+
build-backend = "poetry.core.masonry.api"
|
|
176
|
+
requires = ["poetry-core>=1.2.1"]
|
|
177
|
+
|
|
178
|
+
[tool.mypy]
|
|
179
|
+
ignore_missing_imports = true
|
|
180
|
+
python_version = "3.8"
|
|
181
|
+
plugins = ["pydantic.mypy"]
|
|
182
|
+
|
|
183
|
+
[tool.pytest.ini_options]
|
|
184
|
+
markers = [
|
|
185
|
+
"integration: marks tests as integration (deselect with '-m \"not integration\"').",
|
|
186
|
+
"asyncio: marks tests as async.",
|
|
187
|
+
]
|
|
188
|
+
addopts = "--ignore=smoketests"
|
|
189
|
+
|
|
190
|
+
[tool.ruff]
|
|
191
|
+
src = ["truss", "truss-chains", "truss-utils"]
|
|
192
|
+
target-version = "py38"
|
|
193
|
+
line-length = 88
|
|
194
|
+
lint.extend-select = [
|
|
195
|
+
"I", # isort
|
|
196
|
+
]
|
|
197
|
+
lint.ignore = [
|
|
198
|
+
"E402", # module-import-not-at-top
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
[tool.ruff.format]
|
|
202
|
+
skip-magic-trailing-comma = true
|
|
203
|
+
|
|
204
|
+
[tool.ruff.lint.isort]
|
|
205
|
+
# Matches the Google Python Style Guide.
|
|
206
|
+
section-order = [
|
|
207
|
+
"future",
|
|
208
|
+
"standard-library",
|
|
209
|
+
"third-party",
|
|
210
|
+
"first-party",
|
|
211
|
+
"local-folder",
|
|
212
|
+
]
|
|
213
|
+
split-on-trailing-comma = false
|
|
214
|
+
|
|
215
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
216
|
+
"**tests/samples.py" = [
|
|
217
|
+
"I", # isort
|
|
218
|
+
"F", # flake8
|
|
219
|
+
]
|
|
220
|
+
"config.py" = [
|
|
221
|
+
"I", # isort
|
|
222
|
+
"F", # flake8
|
|
223
|
+
]
|
|
224
|
+
|
|
225
|
+
[tool.ruff.lint.pycodestyle]
|
|
226
|
+
# The formatter can go sometimes go over the 88-character limit, so we want to provide some buffer.
|
|
227
|
+
max-line-length = 120
|
|
228
|
+
|
|
229
|
+
# Note: `tool.poetry.extras` was autogenerated by `pyproject_toml_linter.py`, do not edit manually.
|
|
230
|
+
[tool.poetry.extras]
|
|
231
|
+
all = []
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from pydantic import PydanticDeprecatedSince20
|
|
5
|
+
from single_source import get_version
|
|
6
|
+
|
|
7
|
+
# Suppress Pydantic V1 warnings, because we have to use it for backwards compat.
|
|
8
|
+
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
|
|
9
|
+
|
|
10
|
+
__version__ = get_version(__name__, Path(__file__).parent.parent)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def version():
|
|
14
|
+
return __version__
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
from truss.api import login, push, whoami
|
|
18
|
+
from truss.base import truss_config
|
|
19
|
+
from truss.truss_handle.build import load # TODO: Refactor all usages and remove.
|
|
20
|
+
|
|
21
|
+
__all__ = ["push", "login", "load", "whoami", "truss_config"]
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional, Type, cast
|
|
2
|
+
|
|
3
|
+
if TYPE_CHECKING:
|
|
4
|
+
from rich import progress
|
|
5
|
+
|
|
6
|
+
from truss.api import definitions
|
|
7
|
+
from truss.remote.baseten.service import BasetenService
|
|
8
|
+
from truss.remote.remote_factory import RemoteFactory
|
|
9
|
+
from truss.remote.truss_remote import RemoteConfig
|
|
10
|
+
from truss.truss_handle.build import load
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def login(api_key: str):
|
|
14
|
+
"""
|
|
15
|
+
Logs user into Baseten account. Persists information to ~/.trussrc file,
|
|
16
|
+
so only needs to be invoked once.
|
|
17
|
+
Args:
|
|
18
|
+
api_key: Baseten API Key
|
|
19
|
+
"""
|
|
20
|
+
remote_url = "https://app.baseten.co"
|
|
21
|
+
remote_config = RemoteConfig(
|
|
22
|
+
name="baseten",
|
|
23
|
+
configs={
|
|
24
|
+
"remote_provider": "baseten",
|
|
25
|
+
"api_key": api_key,
|
|
26
|
+
"remote_url": remote_url,
|
|
27
|
+
},
|
|
28
|
+
)
|
|
29
|
+
RemoteFactory.update_remote_config(remote_config)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def whoami(remote: Optional[str] = None):
|
|
33
|
+
"""
|
|
34
|
+
Returns account information for the current user.
|
|
35
|
+
"""
|
|
36
|
+
if not remote:
|
|
37
|
+
available_remotes = RemoteFactory.get_available_config_names()
|
|
38
|
+
if len(available_remotes) == 1:
|
|
39
|
+
remote = available_remotes[0]
|
|
40
|
+
elif len(available_remotes) == 0:
|
|
41
|
+
raise ValueError(
|
|
42
|
+
"Please authenticate via truss.login and pass it as an argument."
|
|
43
|
+
)
|
|
44
|
+
else:
|
|
45
|
+
raise ValueError(
|
|
46
|
+
"Multiple remotes found. Please pass the remote as an argument."
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
remote_provider = RemoteFactory.create(remote=remote)
|
|
50
|
+
return remote_provider.whoami()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def push(
|
|
54
|
+
target_directory: str,
|
|
55
|
+
remote: Optional[str] = None,
|
|
56
|
+
model_name: Optional[str] = None,
|
|
57
|
+
publish: bool = False,
|
|
58
|
+
promote: bool = False,
|
|
59
|
+
preserve_previous_production_deployment: bool = False,
|
|
60
|
+
trusted: bool = False,
|
|
61
|
+
deployment_name: Optional[str] = None,
|
|
62
|
+
environment: Optional[str] = None,
|
|
63
|
+
progress_bar: Optional[Type["progress.Progress"]] = None,
|
|
64
|
+
) -> definitions.ModelDeployment:
|
|
65
|
+
"""
|
|
66
|
+
Pushes a Truss to Baseten.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
target_directory: Directory of Truss to push.
|
|
70
|
+
remote: Name of the remote in .trussrc to patch changes to.
|
|
71
|
+
model_name: The name of the model, if different from the one in the config.yaml.
|
|
72
|
+
publish: Push the truss as a published deployment. If no production deployment exists,
|
|
73
|
+
promote the truss to production after deploy completes.
|
|
74
|
+
promote: Push the truss as a published deployment. Even if a production deployment exists,
|
|
75
|
+
promote the truss to production after deploy completes.
|
|
76
|
+
preserve_previous_production_deployment: Preserve the previous production deployment’s autoscaling
|
|
77
|
+
setting. When not specified, the previous production deployment will be updated to allow it to
|
|
78
|
+
scale to zero. Can only be use in combination with `promote` option.
|
|
79
|
+
trusted: Give Truss access to secrets on remote host.
|
|
80
|
+
deployment_name: Name of the deployment created by the push. Can only be
|
|
81
|
+
used in combination with `publish` or `promote`. Deployment name must
|
|
82
|
+
only contain alphanumeric, ’.’, ’-’ or ’_’ characters.
|
|
83
|
+
environment: Name of stable environment on baseten.
|
|
84
|
+
progress_bar: Optional `rich.progress.Progress` if output is desired.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
The newly created ModelDeployment.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
if not remote:
|
|
91
|
+
available_remotes = RemoteFactory.get_available_config_names()
|
|
92
|
+
if len(available_remotes) == 1:
|
|
93
|
+
remote = available_remotes[0]
|
|
94
|
+
elif len(available_remotes) == 0:
|
|
95
|
+
raise ValueError(
|
|
96
|
+
"Please authenticate via truss.login and pass it as an argument."
|
|
97
|
+
)
|
|
98
|
+
else:
|
|
99
|
+
raise ValueError(
|
|
100
|
+
"Multiple remotes found. Please pass the remote as an argument."
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
remote_provider = RemoteFactory.create(remote=remote)
|
|
104
|
+
tr = load(target_directory)
|
|
105
|
+
model_name = model_name or tr.spec.config.model_name
|
|
106
|
+
if not model_name:
|
|
107
|
+
raise ValueError(
|
|
108
|
+
"No model name provided. Please specify a model name in config.yaml."
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
service = remote_provider.push(
|
|
112
|
+
tr,
|
|
113
|
+
model_name=model_name,
|
|
114
|
+
publish=publish,
|
|
115
|
+
trusted=trusted,
|
|
116
|
+
promote=promote,
|
|
117
|
+
preserve_previous_prod_deployment=preserve_previous_production_deployment,
|
|
118
|
+
deployment_name=deployment_name,
|
|
119
|
+
environment=environment,
|
|
120
|
+
progress_bar=progress_bar,
|
|
121
|
+
) # type: ignore
|
|
122
|
+
|
|
123
|
+
return definitions.ModelDeployment(cast(BasetenService, service))
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from truss.remote.baseten import service
|
|
6
|
+
from truss.remote.baseten.core import ACTIVE_STATUS, DEPLOYING_STATUSES
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ModelDeployment:
|
|
10
|
+
model_config = pydantic.ConfigDict(protected_namespaces=())
|
|
11
|
+
|
|
12
|
+
model_id: str
|
|
13
|
+
model_deployment_id: str
|
|
14
|
+
_baseten_service: service.BasetenService
|
|
15
|
+
|
|
16
|
+
def __init__(self, service: service.BasetenService):
|
|
17
|
+
self.model_id = service._model_id
|
|
18
|
+
self.model_deployment_id = service._model_version_id
|
|
19
|
+
self._baseten_service = service
|
|
20
|
+
|
|
21
|
+
def wait_for_active(self, timeout_seconds: int = 600) -> bool:
|
|
22
|
+
"""
|
|
23
|
+
Waits for the deployment to be active.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
timeout_seconds: The maximum time to wait for the deployment to be active.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
The status of the deployment.
|
|
30
|
+
"""
|
|
31
|
+
start_time = time.time()
|
|
32
|
+
for deployment_status in self._baseten_service.poll_deployment_status():
|
|
33
|
+
if (
|
|
34
|
+
timeout_seconds is not None
|
|
35
|
+
and time.time() - start_time > timeout_seconds
|
|
36
|
+
):
|
|
37
|
+
raise TimeoutError("Deployment timed out.")
|
|
38
|
+
|
|
39
|
+
if deployment_status == ACTIVE_STATUS:
|
|
40
|
+
return True
|
|
41
|
+
|
|
42
|
+
if deployment_status not in DEPLOYING_STATUSES:
|
|
43
|
+
raise Exception(f"Deployment failed with status: {deployment_status}")
|
|
44
|
+
|
|
45
|
+
raise RuntimeError("Error polling deployment status.")
|
|
46
|
+
|
|
47
|
+
def __repr__(self):
|
|
48
|
+
return (
|
|
49
|
+
f"ModelDeployment(model_id={self.model_id}, "
|
|
50
|
+
f"model_deployment_id={self.model_deployment_id})"
|
|
51
|
+
)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
from typing import Set
|
|
3
|
+
|
|
4
|
+
SKLEARN = "sklearn"
|
|
5
|
+
TENSORFLOW = "tensorflow"
|
|
6
|
+
KERAS = "keras"
|
|
7
|
+
XGBOOST = "xgboost"
|
|
8
|
+
PYTORCH = "pytorch"
|
|
9
|
+
CUSTOM = "custom"
|
|
10
|
+
HUGGINGFACE_TRANSFORMER = "huggingface_transformer"
|
|
11
|
+
LIGHTGBM = "lightgbm"
|
|
12
|
+
|
|
13
|
+
_TRUSS_ROOT = pathlib.Path(__file__).parent.parent.resolve()
|
|
14
|
+
|
|
15
|
+
TEMPLATES_DIR = _TRUSS_ROOT / "templates"
|
|
16
|
+
TRADITIONAL_CUSTOM_TEMPLATE_DIR = TEMPLATES_DIR / "custom"
|
|
17
|
+
PYTHON_DX_CUSTOM_TEMPLATE_DIR = TEMPLATES_DIR / "custom_python_dx"
|
|
18
|
+
DOCKER_SERVER_TEMPLATES_DIR = TEMPLATES_DIR / "docker_server"
|
|
19
|
+
SERVER_CODE_DIR: pathlib.Path = TEMPLATES_DIR / "server"
|
|
20
|
+
TRITON_SERVER_CODE_DIR: pathlib.Path = TEMPLATES_DIR / "triton"
|
|
21
|
+
TRTLLM_TRUSS_DIR: pathlib.Path = TEMPLATES_DIR / "trtllm-briton"
|
|
22
|
+
SHARED_SERVING_AND_TRAINING_CODE_DIR_NAME = "shared"
|
|
23
|
+
SHARED_SERVING_AND_TRAINING_CODE_DIR: pathlib.Path = (
|
|
24
|
+
TEMPLATES_DIR / SHARED_SERVING_AND_TRAINING_CODE_DIR_NAME
|
|
25
|
+
)
|
|
26
|
+
CONTROL_SERVER_CODE_DIR: pathlib.Path = TEMPLATES_DIR / "control"
|
|
27
|
+
CHAINS_CODE_DIR: pathlib.Path = _TRUSS_ROOT.parent / "truss-chains" / "truss_chains"
|
|
28
|
+
|
|
29
|
+
SUPPORTED_PYTHON_VERSIONS = {"3.8", "3.9", "3.10", "3.11"}
|
|
30
|
+
MAX_SUPPORTED_PYTHON_VERSION_IN_CUSTOM_BASE_IMAGE = "3.12"
|
|
31
|
+
MIN_SUPPORTED_PYTHON_VERSION_IN_CUSTOM_BASE_IMAGE = "3.8"
|
|
32
|
+
|
|
33
|
+
TRTLLM_PREDICT_CONCURRENCY = 512
|
|
34
|
+
BEI_TRTLLM_CLIENT_BATCH_SIZE = 128
|
|
35
|
+
BEI_MAX_CONCURRENCY_TARGET_REQUESTS = 2048
|
|
36
|
+
BEI_REQUIRED_MAX_NUM_TOKENS = 16384
|
|
37
|
+
|
|
38
|
+
TRTLLM_MIN_MEMORY_REQUEST_GI = 16
|
|
39
|
+
HF_MODELS_API_URL = "https://huggingface.co/api/models"
|
|
40
|
+
HF_ACCESS_TOKEN_KEY = "hf_access_token"
|
|
41
|
+
TRUSSLESS_MAX_PAYLOAD_SIZE = "64M"
|
|
42
|
+
# Alias for TEMPLATES_DIR
|
|
43
|
+
SERVING_DIR: pathlib.Path = TEMPLATES_DIR
|
|
44
|
+
|
|
45
|
+
REQUIREMENTS_TXT_FILENAME = "requirements.txt"
|
|
46
|
+
USER_SUPPLIED_REQUIREMENTS_TXT_FILENAME = "user_requirements.txt"
|
|
47
|
+
BASE_SERVER_REQUIREMENTS_TXT_FILENAME = "base_server_requirements.txt"
|
|
48
|
+
SERVER_REQUIREMENTS_TXT_FILENAME = "server_requirements.txt"
|
|
49
|
+
SYSTEM_PACKAGES_TXT_FILENAME = "system_packages.txt"
|
|
50
|
+
|
|
51
|
+
FILENAME_CONSTANTS_MAP = {
|
|
52
|
+
"config_requirements_filename": REQUIREMENTS_TXT_FILENAME,
|
|
53
|
+
"user_supplied_requirements_filename": USER_SUPPLIED_REQUIREMENTS_TXT_FILENAME,
|
|
54
|
+
"base_server_requirements_filename": BASE_SERVER_REQUIREMENTS_TXT_FILENAME,
|
|
55
|
+
"server_requirements_filename": SERVER_REQUIREMENTS_TXT_FILENAME,
|
|
56
|
+
"system_packages_filename": SYSTEM_PACKAGES_TXT_FILENAME,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
SERVER_DOCKERFILE_TEMPLATE_NAME = "server.Dockerfile.jinja"
|
|
60
|
+
MODEL_DOCKERFILE_NAME = "Dockerfile"
|
|
61
|
+
|
|
62
|
+
README_TEMPLATE_NAME = "README.md.jinja"
|
|
63
|
+
MODEL_README_NAME = "README.md"
|
|
64
|
+
|
|
65
|
+
CONFIG_FILE = "config.yaml"
|
|
66
|
+
DOCKERFILE = "Dockerfile"
|
|
67
|
+
# Used to indicate whether to associate a container with Truss
|
|
68
|
+
TRUSS = "truss"
|
|
69
|
+
# Used to create unique identifier based on last time truss was updated
|
|
70
|
+
TRUSS_MODIFIED_TIME = "truss_modified_time"
|
|
71
|
+
# Path of the Truss used to identify which Truss is being referred
|
|
72
|
+
TRUSS_DIR = "truss_dir"
|
|
73
|
+
TRUSS_HASH = "truss_hash"
|
|
74
|
+
|
|
75
|
+
HUGGINGFACE_TRANSFORMER_MODULE_NAME: Set[str] = set({})
|
|
76
|
+
|
|
77
|
+
# list from https://scikit-learn.org/stable/developers/advanced_installation.html
|
|
78
|
+
SKLEARN_REQ_MODULE_NAMES: Set[str] = {
|
|
79
|
+
"numpy",
|
|
80
|
+
"scipy",
|
|
81
|
+
"joblib",
|
|
82
|
+
"scikit-learn",
|
|
83
|
+
"threadpoolctl",
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
XGBOOST_REQ_MODULE_NAMES: Set[str] = {"xgboost"}
|
|
87
|
+
|
|
88
|
+
# list from https://www.tensorflow.org/install/pip
|
|
89
|
+
# if problematic, lets look to https://www.tensorflow.org/install/source
|
|
90
|
+
TENSORFLOW_REQ_MODULE_NAMES: Set[str] = {"tensorflow"}
|
|
91
|
+
|
|
92
|
+
LIGHTGBM_REQ_MODULE_NAMES: Set[str] = {"lightgbm"}
|
|
93
|
+
|
|
94
|
+
# list from https://pytorch.org/get-started/locally/
|
|
95
|
+
PYTORCH_REQ_MODULE_NAMES: Set[str] = {"torch", "torchvision", "torchaudio"}
|
|
96
|
+
|
|
97
|
+
MLFLOW_REQ_MODULE_NAMES: Set[str] = {"mlflow"}
|
|
98
|
+
|
|
99
|
+
INFERENCE_SERVER_PORT = 8080
|
|
100
|
+
|
|
101
|
+
HTTP_PUBLIC_BLOB_BACKEND = "http_public"
|
|
102
|
+
|
|
103
|
+
REGISTRY_BUILD_SECRET_PREFIX = "DOCKER_REGISTRY_"
|
|
104
|
+
|
|
105
|
+
TRTLLM_SPEC_DEC_TARGET_MODEL_NAME = "target"
|
|
106
|
+
TRTLLM_SPEC_DEC_DRAFT_MODEL_NAME = "draft"
|
|
107
|
+
TRTLLM_BASE_IMAGE = "baseten/briton-server:v0.16.0-5be7b58"
|
|
108
|
+
TRTLLM_PYTHON_EXECUTABLE = "/usr/local/briton/venv/bin/python"
|
|
109
|
+
BASE_TRTLLM_REQUIREMENTS = ["briton==0.4.2"]
|
|
110
|
+
BEI_TRTLLM_BASE_IMAGE = "baseten/bei:0.0.17@sha256:9c3577f6ec672d6da5aca18e9c0ebdddd65ed80c8858e757fbde7e9cf48de01d"
|
|
111
|
+
|
|
112
|
+
BEI_TRTLLM_PYTHON_EXECUTABLE = "/usr/bin/python3"
|
|
113
|
+
|
|
114
|
+
OPENAI_COMPATIBLE_TAG = "openai-compatible"
|
|
115
|
+
|
|
116
|
+
PRODUCTION_ENVIRONMENT_NAME = "production"
|