tsbk (Triton Server Build Kit) allows you to define and deploy Triton Inference Server model repositories using simple YAML configuration files.
This example demonstrates an example configuration and how to use tsbk to build, run, and test models based on that configuration.
- Install example requirements:
pip install -r requirements.txt- Start a localstack S3 service for model storage:
docker-compose up -dCreate a model artifact and upload it to the localstack S3 service:
python create-model.pyWe can use tsbk run to build, run, and test the model repository defined in example-repo.yaml:
AWS_S3_ENDPOINT_URL=http://localhost:4566 \
tsbk run example-repo.yaml ./model-repo --testThis command does the following:
- Builds the model repository in
./model-repobased on the configuration inexample-repo.yaml. - Launches Triton Inference Server in a Docker container, pointing to the built model repository.
- Runs the defined test cases against the deployed models to verify functionality
If you want to run the server without testing, you can omit the --test flag:
AWS_ENDPOINT_URL_S3=http://localhost:4566 \
tsbk run example-repo.yaml ./model-repoThis command will build the model repository and start the Triton server without executing tests.
If you only want to build the model repository without running the server, use the tsbk build command:
AWS_ENDPOINT_URL_S3=http://localhost:4566 \
tsbk build example-repo.yaml ./model-repoThis will create the Triton-compatible model repository structure in ./model-repo based on the provided configuration.
You can then start the Triton server manually, pointing it to this repository. This also becomes an artifact you can version control or share.
To run tests against an already deployed Triton server, use the tsbk test command:
AWS_ENDPOINT_URL_S3=http://localhost:4566 \
tsbk test example-repo.yaml ./model-repo --url http://localhost:8000This command will execute all defined test cases in example-repo.yaml against the Triton server running at the specified URL.
After you are done, you can stop the localstack service:
docker-compose down