Add one-step recipe serving (#57306)
Signed-off-by: louie-tsai <louie.tsai@intel.com>
Louie Tsai committed
Sep 19, 2026 at 20:24 UTC
03f83013872015f6addb66954e2752d2d9bccd96
2 files changed
+65
tools/recipes/README.md
+15
@@ -21,6 +21,21 @@ flowchart LR
21
The recipe is the baseline. Hardware and workload information can optionally
22
refine the initial configuration. Sweep tuning is an optional validation step.
23
24
+## Getting Started
25
+
26
+Use `serve_with_recipe.sh` to generate the recipe configuration and start vLLM
27
+in one step:
28
+
29
+```bash
30
+tools/recipes/serve_with_recipe.sh \
31
+ --model meta-llama/Llama-3.1-8B-Instruct \
32
+ --hardware xeon6
33
+```
34
+
35
+For `xeon6`, the script enables hardware detection automatically. Generated
36
+`config.yml` and `env.sh` files remain in the directory where the script was
37
+invoked.
38
+
39
## 1. vLLM Recipes Only
40
41
Use the converter directly when the recipe already contains the deployment
tools/recipes/serve_with_recipe.sh
new
+50
@@ -0,0 +1,50 @@
1
+#!/usr/bin/env bash
2
+# SPDX-License-Identifier: Apache-2.0
3
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
4
+
5
+set -euo pipefail
6
+
7
+SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
8
+CONVERTER="${SCRIPT_DIR}/recipe_json_to_vllm_config.py"
9
+OUTPUT_DIR="$(pwd -P)"
10
+CONFIG_PATH="${OUTPUT_DIR}/config.yml"
11
+ENV_PATH="${OUTPUT_DIR}/env.sh"
12
+
13
+args=("$@")
14
+hardware=""
15
+
16
+for ((i = 0; i < ${#args[@]}; i++)); do
17
+ case "${args[$i]}" in
18
+ --hardware)
19
+ if ((i + 1 < ${#args[@]})); then
20
+ hardware="${args[$((i + 1))]}"
21
+ fi
22
+ ;;
23
+ --hardware=*)
24
+ hardware="${args[$i]#*=}"
25
+ ;;
26
+ esac
27
+done
28
+
29
+if [[ "${hardware,,}" == "xeon6" ]]; then
30
+ args+=(--detect-hardware)
31
+fi
32
+
33
+echo "==> Generating vLLM configuration"
34
+python3 "${CONVERTER}" "${args[@]}"
35
+
36
+echo
37
+echo "==> Loading recipe environment"
38
+# shellcheck disable=SC1090
39
+source "${ENV_PATH}"
40
+
41
+# Released vLLM images keep recipe-relative assets such as examples/*.jinja
42
+# under /vllm-workspace. Launch from there when available while keeping the
43
+# generated config and environment files in the caller's output directory.
44
+if [[ -d /vllm-workspace/examples ]]; then
45
+ cd /vllm-workspace
46
+fi
47
+
48
+echo
49
+echo "==> Starting vLLM"
50
+exec vllm serve --config "${CONFIG_PATH}"