Build and serve a TinyLlama engine on a rented GPU
Rented GPUcli180 minoptionalGoal · A TensorRT-LLM engine for TinyLlama-1.1B-Chat built by you, served with trtllm-serve, and queried with the openai client, for under about 3 USD of GPU time.
- 1Rent an hourly L4 or A10 (RunPod, Lambda Cloud or Vast.ai; roughly 0.3 to 0.8 USD per hour) and start the nvcr.io/nvidia/tensorrt-llm/release container or pip install tensorrt-llm per the quick start.
- 2Download TinyLlama/TinyLlama-1.1B-Chat-v1.0 with huggingface-cli and run examples/llama/convert_checkpoint.py to produce a TRT-LLM checkpoint in float16.
- 3Run trtllm-build with max_batch_size 8, max_input_len 1024, max_seq_len 2048 and the paged KV cache plugin enabled; time the build.
- 4Open the produced config.json and write a one-line explanation for each top-level field.
- 5Serve with trtllm-serve <engine_dir> and query /v1/chat/completions with the openai client.
- 6Rebuild with weight-only INT8 quantization (convert_checkpoint.py --use_weight_only --weight_only_precision int8) and compare engine size and decode tokens per second over 20 requests.
- 7Stop the instance and record the total cost.
- Deliverable
- Both config.json files with your annotations, engine sizes, the two tokens-per-second numbers and the cost.
- Check
- The INT8 engine is roughly half the size of the FP16 engine; both answer the openai client correctly; the recorded cost is under 5 USD.
- Fallback
- On colab-gpu or cpu, read the TinyLlama or Llama example README in the TensorRT-LLM repo, pull an engine config.json from a public Hugging Face repo tagged tensorrt-llm, annotate every field, and write the exact trtllm-build command you would run with justification for each flag.