runpod-vllm-deployer 0.2.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.
Files changed (51) hide show
  1. runpod_vllm_deployer-0.2.0/.claude/skills/runpod-vllm-gpu-deploy/SKILL.md +306 -0
  2. runpod_vllm_deployer-0.2.0/.env.example +8 -0
  3. runpod_vllm_deployer-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +48 -0
  4. runpod_vllm_deployer-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  5. runpod_vllm_deployer-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +30 -0
  6. runpod_vllm_deployer-0.2.0/.github/dependabot.yml +14 -0
  7. runpod_vllm_deployer-0.2.0/.github/pull_request_template.md +15 -0
  8. runpod_vllm_deployer-0.2.0/.github/workflows/release.yml +186 -0
  9. runpod_vllm_deployer-0.2.0/.gitignore +31 -0
  10. runpod_vllm_deployer-0.2.0/CHANGELOG.md +25 -0
  11. runpod_vllm_deployer-0.2.0/CODE_OF_CONDUCT.md +73 -0
  12. runpod_vllm_deployer-0.2.0/CONTRIBUTING.md +49 -0
  13. runpod_vllm_deployer-0.2.0/LICENSE +203 -0
  14. runpod_vllm_deployer-0.2.0/Makefile +30 -0
  15. runpod_vllm_deployer-0.2.0/PKG-INFO +512 -0
  16. runpod_vllm_deployer-0.2.0/README.md +278 -0
  17. runpod_vllm_deployer-0.2.0/RELEASING.md +92 -0
  18. runpod_vllm_deployer-0.2.0/SECURITY.md +15 -0
  19. runpod_vllm_deployer-0.2.0/docs/architecture.md +65 -0
  20. runpod_vllm_deployer-0.2.0/docs/configuration.md +130 -0
  21. runpod_vllm_deployer-0.2.0/docs/lifecycle.md +52 -0
  22. runpod_vllm_deployer-0.2.0/docs/quickstart.md +62 -0
  23. runpod_vllm_deployer-0.2.0/docs/security.md +31 -0
  24. runpod_vllm_deployer-0.2.0/docs/troubleshooting.md +73 -0
  25. runpod_vllm_deployer-0.2.0/examples/commands.sh +18 -0
  26. runpod_vllm_deployer-0.2.0/examples/multi-gpu.sh +12 -0
  27. runpod_vllm_deployer-0.2.0/pyproject.toml +97 -0
  28. runpod_vllm_deployer-0.2.0/scripts/safety_scan.py +69 -0
  29. runpod_vllm_deployer-0.2.0/skills/runpod-vllm-gpu-deploy/SKILL.md +306 -0
  30. runpod_vllm_deployer-0.2.0/skills.sh.json +13 -0
  31. runpod_vllm_deployer-0.2.0/src/runpod_vllm/__init__.py +3 -0
  32. runpod_vllm_deployer-0.2.0/src/runpod_vllm/__main__.py +3 -0
  33. runpod_vllm_deployer-0.2.0/src/runpod_vllm/cli.py +831 -0
  34. runpod_vllm_deployer-0.2.0/src/runpod_vllm/client.py +225 -0
  35. runpod_vllm_deployer-0.2.0/src/runpod_vllm/config.py +210 -0
  36. runpod_vllm_deployer-0.2.0/src/runpod_vllm/errors.py +54 -0
  37. runpod_vllm_deployer-0.2.0/src/runpod_vllm/models.py +116 -0
  38. runpod_vllm_deployer-0.2.0/src/runpod_vllm/payload.py +119 -0
  39. runpod_vllm_deployer-0.2.0/src/runpod_vllm/readiness.py +112 -0
  40. runpod_vllm_deployer-0.2.0/src/runpod_vllm/redaction.py +68 -0
  41. runpod_vllm_deployer-0.2.0/src/runpod_vllm/state.py +51 -0
  42. runpod_vllm_deployer-0.2.0/tests/conftest.py +19 -0
  43. runpod_vllm_deployer-0.2.0/tests/test_agent_skills.py +177 -0
  44. runpod_vllm_deployer-0.2.0/tests/test_api_v2.py +428 -0
  45. runpod_vllm_deployer-0.2.0/tests/test_cli.py +423 -0
  46. runpod_vllm_deployer-0.2.0/tests/test_client.py +286 -0
  47. runpod_vllm_deployer-0.2.0/tests/test_config_payload.py +206 -0
  48. runpod_vllm_deployer-0.2.0/tests/test_fault_injection.py +713 -0
  49. runpod_vllm_deployer-0.2.0/tests/test_readiness.py +137 -0
  50. runpod_vllm_deployer-0.2.0/tests/test_state_redaction.py +74 -0
  51. runpod_vllm_deployer-0.2.0/tests/test_v1_retirement.py +69 -0
@@ -0,0 +1,306 @@
1
+ ---
2
+ name: runpod-vllm-gpu-deploy
3
+ description: Deploys OpenAI-compatible vLLM servers on RunPod GPU pods using the runpod-vllm CLI. Use when asked to deploy vLLM on RunPod, spin up a GPU pod, serve an OpenAI-compatible LLM endpoint, plan a deployment offline, validate a deployment config, wait for pod readiness, smoke-test an inference endpoint, recover a partial deployment, or tear down a GPU pod. Do not use for unrelated RunPod tooling or as authorization to create, mutate, or destroy live resources.
4
+ ---
5
+
6
+ # RunPod vLLM Deployer
7
+
8
+ ## Overview
9
+
10
+ Use this repository's `runpod-vllm` CLI to plan, create, inspect, validate, and remove OpenAI-compatible vLLM GPU Pods. Keep configuration validation offline until the user explicitly authorizes a live operation, and preserve the local state needed for verified teardown.
11
+
12
+ ## Use and non-use triggers
13
+
14
+ Use this skill when the current request involves:
15
+
16
+ - Installing or checking the `runpod-vllm-deployer` repository.
17
+ - Producing an offline, redacted deployment plan.
18
+ - Creating a RunPod vLLM Pod after clear user approval.
19
+ - Listing Pods or inspecting the Pod recorded in local state.
20
+ - Waiting for vLLM readiness or running the deterministic endpoint smoke test.
21
+ - Recovering after Pod creation when local state could not be saved.
22
+ - Destroying a specifically verified Pod and confirming provider-side absence.
23
+
24
+ Do not use this skill to operate a different RunPod client, manage Serverless endpoints, alter accounts, estimate costs, or claim that a model will fit a GPU. A request to explain, plan, inspect code, run tests, or validate configuration does not authorize any live resource mutation.
25
+
26
+ ## Hard safety boundaries
27
+
28
+ 1. Treat `deploy` as billable. Do not run it unless the user's current request clearly authorizes creation of the reviewed configuration. Prior approval from another request is not current approval.
29
+ 2. Treat `destroy` as destructive. Do not run it unless the user's current request authorizes termination of the exact verified target.
30
+ 3. Do not use `--yes` to infer consent. It only bypasses the CLI prompt after authorization already exists.
31
+ 4. Do not contact RunPod during repository tests, offline planning, or documentation work. Never substitute `deploy` or `destroy` for a smoke test.
32
+ 5. Keep the default API URL. Use `--api-url` only when the user explicitly selects a trusted RunPod-compatible endpoint. Choose the API version as described in "RunPod REST API version" below.
33
+ 6. Stop if the selected state file, model, Pod name, Pod ID, API URL, or requested operation conflicts with the user's request.
34
+
35
+ ## Installation and prerequisite checks
36
+
37
+ Run from the repository root. Require Python 3.11 or newer.
38
+
39
+ ```bash
40
+ python3 --version
41
+ python3 -m venv .venv
42
+ source .venv/bin/activate
43
+ python -m pip install .
44
+ command -v runpod-vllm
45
+ runpod-vllm --help
46
+ ```
47
+
48
+ For repository development, use `make setup` to install development dependencies. Before any live command, check secret presence without printing values:
49
+
50
+ ```bash
51
+ test -n "${RUNPOD_API_KEY:-}"
52
+ test -z "${HF_TOKEN:-}" || test -n "${HF_TOKEN:-}"
53
+ ```
54
+
55
+ Require `RUNPOD_API_KEY` for `deploy`, `list`, `status`, and `destroy`. Use `HF_TOKEN` only when the model repository requires it. `wait` accesses the vLLM endpoint and does not use the RunPod API key. `smoke-test` optionally reads an endpoint bearer token from `VLLM_API_KEY` or the variable named by `--bearer-token-env`.
56
+
57
+ ## Exact CLI reference
58
+
59
+ Place global options before the command:
60
+
61
+ | Global option | Help definition |
62
+ | --- | --- |
63
+ | `--state-path PATH` | Local teardown state; default `.runpod-vllm-state.json`. |
64
+ | `--env-file PATH` | Optional selected file containing `RUNPOD_API_KEY` and `HF_TOKEN`. |
65
+ | `--api-url TEXT` | RunPod REST base URL; default `https://rest.runpod.io/v1` for v1, `https://api.runpod.io/v2` for v2, or the URL recorded in state. |
66
+ | `--api-version [v1\|v2]` | RunPod REST API version; defaults to `v2` (since RunPod retired v1 on 2026-11-15) or the version recorded in state (legacy v1 state moves to v2 automatically); env var `RUNPOD_API_VERSION`. |
67
+ | `--version` | Show the version and exit. |
68
+ | `--help` | Show help and exit. |
69
+
70
+ Use these exact command forms and options:
71
+
72
+ | Command | Exact form | Command options from current help | Network and effect |
73
+ | --- | --- | --- | --- |
74
+ | `plan` | `runpod-vllm plan --model TEXT [OPTIONS]` | `--model`, `--name`, `--gpu`, `--gpu-type-id`, `--gpu-count`, `--tensor-parallel-size`, `--container-disk-gb`, `--volume-gb`, `--min-vcpu-per-gpu`, `--min-ram-per-gpu`, `--max-model-len`, `--gpu-memory-utilization`, `--dtype`, `--quantization`, `--kv-cache-dtype`, `--revision`, `--trust-remote-code`, `--reasoning-parser`, `--image`, `--cloud-type`, `--data-center`, `--port`, `--env`, `--help` | Offline; validates and prints a redacted payload. |
75
+ | `deploy` | `runpod-vllm deploy --model TEXT [OPTIONS]` | All `plan` options, plus `--yes` or `-y`; `--env` is never printed unredacted. | RunPod API; creates a billable GPU Pod and saves state. |
76
+ | `list` | `runpod-vllm list` | `--help` | RunPod API; lists active GPU Pods without mutation. |
77
+ | `status` | `runpod-vllm status` | `--help` | RunPod API; inspects the state-recorded Pod and shows URLs. |
78
+ | `wait` | `runpod-vllm wait [OPTIONS]` | `--base-url TEXT`, `--timeout FLOAT` default `900.0`, `--interval FLOAT` default `5.0`, `--help` | vLLM endpoint; waits for `/health` and non-empty `/v1/models`, then prints a redacted `OpenAI base URL` and `export OPENAI_BASE_URL=...` snippet. |
79
+ | `smoke-test` | `runpod-vllm smoke-test [OPTIONS]` | `--base-url TEXT`, `--model TEXT`, `--bearer-token-env TEXT` default `VLLM_API_KEY`, `--timeout FLOAT` default `30.0`, `--help` | vLLM endpoint; sends a deterministic four-token chat request, then prints a redacted `OpenAI base URL` and `export OPENAI_BASE_URL=...` snippet. |
80
+ | `destroy` | `runpod-vllm destroy [OPTIONS]` | `--pod-id TEXT`, `--yes` or `-y`, `--verify-timeout FLOAT` default `60.0`, `--verify-interval FLOAT` default `2.0`, `--help` | RunPod API; deletes, verifies absence, then removes matching state. |
81
+
82
+ `plan` and `deploy` share these validated defaults and constraints:
83
+
84
+ | Option | Default or allowed value |
85
+ | --- | --- |
86
+ | `--model TEXT` | Required Hugging Face model ID. |
87
+ | `--name TEXT` | `vllm-server`; sanitized to at most 63 characters. |
88
+ | `--gpu TEXT` | `A40`; allowed profiles are `RTX4090`, `RTX5090`, `A6000`, `A40`, `L40S`, `A100`, `H100`, `H200`, `B200`. |
89
+ | `--gpu-type-id TEXT` | Optional raw RunPod GPU type ID (2 to 120 printable ASCII characters, no leading or trailing whitespace); overrides `--gpu` when set. |
90
+ | `--gpu-count INTEGER` | `1`; range 1 through 8. |
91
+ | `--tensor-parallel-size INTEGER` | `1`; range 1 through 8, no greater than GPU count, and must divide GPU count. |
92
+ | `--container-disk-gb INTEGER` | `50`; validated range 10 through 4096. |
93
+ | `--volume-gb INTEGER` | `40`; validated range 0 through 4096. |
94
+ | `--min-vcpu-per-gpu INTEGER` | `4`; validated range 1 through 128. |
95
+ | `--min-ram-per-gpu INTEGER` | `16`; validated range 1 through 2048 GB. |
96
+ | `--max-model-len INTEGER` | `8192`; validated range 256 through 1048576. |
97
+ | `--gpu-memory-utilization FLOAT` | `0.9`; validated range 0.1 through 0.99. |
98
+ | `--dtype TEXT` | `auto`; allowed `auto`, `bfloat16`, `float16`, `float32`. |
99
+ | `--quantization TEXT` | Optional vLLM quantization method. |
100
+ | `--kv-cache-dtype TEXT` | `auto`; allowed `auto`, `fp8`, `fp8_e4m3`, `fp8_e5m2`. |
101
+ | `--revision TEXT` | Optional model revision or commit. |
102
+ | `--trust-remote-code` | Off; opt in only after reviewing the model repository. |
103
+ | `--reasoning-parser TEXT` | Optional vLLM reasoning parser. |
104
+ | `--image TEXT` | `vllm/vllm-openai:v0.19.1`; must have an explicit tag other than `latest`. |
105
+ | `--cloud-type TEXT` | `SECURE`; allowed `SECURE` or `COMMUNITY`. |
106
+ | `--data-center TEXT` | Optional and repeatable. |
107
+ | `--port INTEGER` | `8000`; validated range 1024 through 65535. |
108
+ | `--env KEY=VALUE` | Optional and repeatable. Never use it for secrets. |
109
+
110
+ Confirm the executable reference when the installed checkout may differ:
111
+
112
+ ```bash
113
+ runpod-vllm --help
114
+ runpod-vllm plan --help
115
+ runpod-vllm deploy --help
116
+ runpod-vllm list --help
117
+ runpod-vllm status --help
118
+ runpod-vllm wait --help
119
+ runpod-vllm smoke-test --help
120
+ runpod-vllm destroy --help
121
+ ```
122
+
123
+ ## RunPod REST API version
124
+
125
+ RunPod retired REST API v1 (`https://rest.runpod.io/v1`) on 2026-11-15. REST API v2 (`https://api.runpod.io/v2`) is the current surface and the automatic CLI default since 2026-11-15.
126
+
127
+ - New deployments default to `v2` (`https://api.runpod.io/v2`), so no `--api-version` flag is needed. You can still pass `--api-version` (a global option, placed before the command) or set `RUNPOD_API_VERSION` when targeting a custom endpoint.
128
+ - Run `plan` before `deploy`; the v2 payload uses nested `gpu`, `image`, `disk`, `entrypoint`, `cloud`, and `mounts` fields.
129
+ - With v2, `--volume-gb` must be `0` or at least `10`.
130
+ - `deploy` records `api_version` in state. `status` and `destroy` reuse it unless `--api-version` is passed, and automatically move legacy v1 state files (including files written without `api_version`) to v2 using the same Pod ID.
131
+ - Do not pass `--api-version v1` against RunPod now that v1 is retired.
132
+ - `--api-url` does not change the version. Pair a custom v2 URL with `--api-version v2`.
133
+
134
+ ## Plan-first workflow
135
+
136
+ 1. Read the request and classify the intended action as offline, read-only network access, billable creation, endpoint validation, or destructive teardown.
137
+ 2. Check installation, CLI help, working directory, selected `--state-path`, and credential presence. Never reveal credential values.
138
+ 3. Gather the exact model revision, GPU profile and count, tensor parallel size, context length, dtype, quantization, storage, cloud type, image tag, and data center constraints.
139
+ 4. Run `plan` with the proposed deployment options. Confirm its header says `offline; no API call`. Review the redacted payload and correct validation errors.
140
+ 5. For `deploy`, restate the reviewed model, GPU count and profile, state path, and billable effect. Continue only with current, unambiguous authorization. Prefer the interactive confirmation.
141
+ 6. Preserve the state file immediately. Record its path in the operational handoff, but do not copy its contents into prompts or shared logs.
142
+ 7. Run `status`, then `wait`, then `smoke-test`. Readiness alone is not an inference that generation works.
143
+ 8. When authorized to tear down, verify the exact target, run `destroy`, confirm the CLI reports verified absence, and verify matching state was removed. Use `list` for a final provider-side check.
144
+
145
+ ## Credential handling
146
+
147
+ - Obtain `RUNPOD_API_KEY`, optional `HF_TOKEN`, and optional endpoint bearer tokens from the user's approved secret manager or an already prepared process environment.
148
+ - Never ask the user to paste a credential into a prompt. Never place a value in commands, `--env`, examples, source files, commits, issue text, chat, terminal transcripts, or logs.
149
+ - Never run `env`, `printenv`, `set`, `set -x`, or shell tracing around credential-bearing commands. Do not echo variables or embed them in URLs.
150
+ - If interactive entry is necessary, use a silent input facility that leaves no value in shell history, then export only into the current process. Do not capture the terminal session.
151
+ - Prefer process environment variables. If the user explicitly selects `--env-file`, require an ignored, local file with restrictive permissions; never inspect or print its values. The process environment overrides the file.
152
+ - `HF_TOKEN` is sent into the Pod only when present. Treat enabling `--trust-remote-code` as a separate code-execution decision, not as a credential requirement.
153
+ - Pass only the endpoint token variable name to `--bearer-token-env`; never pass its value. Rotate any credential exposed in a prompt, log, history, or commit.
154
+
155
+ ## State and resource lifecycle
156
+
157
+ - Default to `.runpod-vllm-state.json`. Use one distinct `--state-path` per Pod when operating multiple deployments.
158
+ - Treat state as the teardown anchor. It contains the Pod ID, model, port, API URL, and derived endpoint URLs, but no credentials.
159
+ - Do not overwrite existing state. If `deploy` reports that state already exists, inspect that Pod or select a deliberate new state path.
160
+ - After creation, verify the state file exists and is not tracked by Git. Do not manually edit or delete it while the Pod may exist.
161
+ - If creation succeeds but state saving fails, the CLI prints an exact recovery command containing the returned target ID. Treat this as an active billable partial deployment. With explicit cleanup authorization, verify the target using `list`, then run the printed `destroy --pod-id ...` recovery command promptly.
162
+ - `wait` succeeds only when `/health` returns HTTP 200 and `/v1/models` returns at least one model ID. A running Pod is not necessarily a ready model server.
163
+ - Run `smoke-test` after readiness. It requires a response containing `choices` from `/v1/chat/completions`.
164
+ - `destroy` treats an already absent Pod as success. It retains state when deletion verification times out and removes matching state only after provider absence is confirmed.
165
+
166
+ ## Destructive target verification
167
+
168
+ Before `destroy`:
169
+
170
+ 1. Resolve the selected global `--state-path` and confirm it is the intended deployment's state file.
171
+ 2. Run `status` and `list`. Match the state-recorded ID, Pod name, model context, and requested environment to the user's exact target.
172
+ 3. If `--pod-id` is required for state-write recovery, obtain it only from the CLI recovery output or a carefully matched `list` result. Never guess, shorten, or reuse an ID from another deployment.
173
+ 4. State the exact target and irreversible termination effect to the user. Require current authorization.
174
+ 5. Prefer interactive `destroy`. Use `--yes` only for explicitly approved unattended cleanup.
175
+ 6. Require the output `verified absent`. If verification times out, retain state, inspect again, and retry. Do not report cleanup complete while the Pod remains or its status is unknown.
176
+
177
+ ## GPU and model sizing
178
+
179
+ Treat every profile as an API identifier, not a compatibility guarantee. Before deployment, consult primary documentation for the exact checkpoint and selected vLLM image. Consider weight precision and quantization, KV cache growth with context and concurrency, dtype support, reasoning parsers, trusted code, tokenizer behavior, tensor parallel support, GPU interconnect, container disk, volume size, and host RAM.
180
+
181
+ Start with the smallest operational context that meets the request and a tensor parallel size supported by the model. If increasing GPU count, keep GPU count divisible by tensor parallel size. Inventory changes continuously. Removing a data center restriction or changing a GPU profile changes placement behavior and must be reviewed in a new offline plan. Never promise that a configuration will fit, start, or be available.
182
+
183
+ ## Troubleshooting decision tree
184
+
185
+ Follow the first matching branch:
186
+
187
+ 1. **CLI or validation error before network access**
188
+ - Run the relevant `--help` and then `plan`.
189
+ - Correct the exact reported issue: model or revision syntax, unsupported GPU, tensor parallel divisibility, disk or memory bounds, context bounds, dtype, KV cache dtype, port, cloud type, data center format, environment syntax, or an unpinned image.
190
+ 2. **`RUNPOD_API_KEY is required`**
191
+ - Check presence without printing it. Confirm the intended process environment or explicit global `--env-file` is selected. Rotate the key if exposed.
192
+ 3. **`State already exists`**
193
+ - Do not overwrite it. Run `status`; destroy the recorded Pod only when authorized, or choose a separate `--state-path` for an independently approved deployment.
194
+ 4. **RunPod request failure or HTTP error**
195
+ - Preserve the redacted diagnostic. For authentication errors, verify secret source and scope without printing it. For unavailable inventory, reconsider GPU profile or data center restrictions and generate a new plan. For transport failures, verify connectivity and the trusted API URL before retrying.
196
+ 5. **Pod exists but `wait` times out**
197
+ - Run `status`. Inspect provider-side Pod and container logs without copying credentials. Look for gated checkpoint access, insufficient disk, incompatible model or image revision, unsupported quantization, out-of-memory errors, or excessive context. Adjust one cause at a time and re-plan before any replacement deployment.
198
+ 6. **Model does not fit**
199
+ - Consider a shorter `--max-model-len`, compatible quantization, supported dtype or KV cache dtype, compatible tensor parallel configuration, or another GPU profile. Verify against exact checkpoint and vLLM documentation; do not guarantee the next choice.
200
+ 7. **Smoke test returns HTTP 401 or 403**
201
+ - Confirm the endpoint bearer token is present under `VLLM_API_KEY` or the selected `--bearer-token-env` name. Never place the token on the command line.
202
+ 8. **Smoke test has invalid JSON or no `choices`**
203
+ - Confirm the base URL, served model ID, OpenAI-compatible route, and server logs. Re-run `wait` before retrying.
204
+ 9. **State is missing after creation**
205
+ - Treat billing as active. Use `list` to identify the exact target. With explicit authorization, use `destroy --pod-id` and verify absence.
206
+ 10. **Deletion verification times out**
207
+ - Keep the state file. Re-run `status`, inspect provider state, and retry `destroy` with reviewed verification timing if needed. Escalate if provider state remains ambiguous.
208
+
209
+ ## Common pitfalls
210
+
211
+ - Putting global options after the subcommand instead of before it.
212
+ - Assuming `plan` reserves inventory or proves a model fits.
213
+ - Passing credentials through `--env`, command arguments, copied transcripts, or debug tracing.
214
+ - Using `--yes` without a separately established billable or destructive authorization.
215
+ - Reusing one state file for multiple Pods or deleting state before verified absence.
216
+ - Treating Pod `RUNNING` status as vLLM readiness or skipping the generation smoke test.
217
+ - Setting tensor parallel size greater than GPU count or to a value that does not divide GPU count.
218
+ - Using an image tagged `latest`, enabling remote code without review, or guessing a quantization method.
219
+ - Restricting data centers without checking changing inventory.
220
+ - Reporting cleanup complete after only a DELETE response, rather than verified absence.
221
+
222
+ ## Copy-pasteable recipes
223
+
224
+ ### Offline planning
225
+
226
+ ```bash
227
+ runpod-vllm plan \
228
+ --model ORG/MODEL \
229
+ --gpu A40 \
230
+ --gpu-count 1 \
231
+ --tensor-parallel-size 1 \
232
+ --max-model-len 8192
233
+ ```
234
+
235
+ ### Approved deployment
236
+
237
+ Run only after the current request authorizes this reviewed billable configuration and required credentials are securely present in the process environment:
238
+
239
+ ```bash
240
+ runpod-vllm --state-path .runpod-vllm-state.json deploy \
241
+ --model ORG/MODEL \
242
+ --gpu A40 \
243
+ --gpu-count 1 \
244
+ --tensor-parallel-size 1 \
245
+ --max-model-len 8192
246
+ ```
247
+
248
+ ### Inspection
249
+
250
+ ```bash
251
+ runpod-vllm list
252
+ runpod-vllm --state-path .runpod-vllm-state.json status
253
+ ```
254
+
255
+ ### Endpoint validation
256
+
257
+ ```bash
258
+ runpod-vllm --state-path .runpod-vllm-state.json wait \
259
+ --timeout 900 \
260
+ --interval 5
261
+ runpod-vllm --state-path .runpod-vllm-state.json smoke-test \
262
+ --timeout 30
263
+ ```
264
+
265
+ For an authenticated endpoint, securely preload the token under the selected variable name and pass only that name:
266
+
267
+ ```bash
268
+ runpod-vllm --state-path .runpod-vllm-state.json smoke-test \
269
+ --bearer-token-env VLLM_API_KEY \
270
+ --timeout 30
271
+ ```
272
+
273
+ ### Verified teardown
274
+
275
+ Run only after status and list output match the exact target and the current request authorizes termination:
276
+
277
+ ```bash
278
+ runpod-vllm --state-path .runpod-vllm-state.json status
279
+ runpod-vllm list
280
+ runpod-vllm --state-path .runpod-vllm-state.json destroy
281
+ runpod-vllm list
282
+ test ! -e .runpod-vllm-state.json
283
+ ```
284
+
285
+ ## Verification checklist
286
+
287
+ - [ ] Run from the intended repository and confirm `runpod-vllm --help` matches this reference.
288
+ - [ ] Confirm Python 3.11 or newer and required credential presence without printing values.
289
+ - [ ] Select one explicit state path and verify it does not conflict with another deployment.
290
+ - [ ] Run the exact proposed configuration through offline `plan` and review the redacted payload.
291
+ - [ ] Confirm current user authorization before `deploy`; record no secrets in command history or logs.
292
+ - [ ] Confirm state exists after creation and remains untracked by Git.
293
+ - [ ] Run `status`, receive successful `wait` readiness, and pass `smoke-test`.
294
+ - [ ] Before `destroy`, match the exact state-recorded target against `status`, `list`, and the user's request.
295
+ - [ ] Receive `verified absent`, confirm matching state removal, and verify the target is absent from `list`.
296
+ - [ ] Report partial failures and retained state; never claim success from an unverified provider state.
297
+
298
+ ## Repository documentation
299
+
300
+ - [README](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/README.md)
301
+ - [Quickstart](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/quickstart.md)
302
+ - [Configuration](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/configuration.md)
303
+ - [Lifecycle and teardown safety](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/lifecycle.md)
304
+ - [Security model](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/security.md)
305
+ - [Troubleshooting](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/troubleshooting.md)
306
+ - [Architecture](https://github.com/1solomonwakhungu/runpod-vllm-deployer/blob/main/docs/architecture.md)
@@ -0,0 +1,8 @@
1
+ # Copy to .env, replace placeholders, and never commit the resulting file.
2
+ RUNPOD_API_KEY=replace_with_your_runpod_api_key
3
+
4
+ # Optional for gated Hugging Face models.
5
+ HF_TOKEN=replace_with_your_hugging_face_token
6
+
7
+ # Optional only when the vLLM endpoint itself requires a bearer token.
8
+ VLLM_API_KEY=replace_with_your_endpoint_bearer_token
@@ -0,0 +1,48 @@
1
+ name: Bug report
2
+ description: Report a reproducible defect without sharing credentials or live resource IDs.
3
+ title: "[Bug]: "
4
+ labels: [bug]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: Do not include API keys, bearer tokens, Pod IDs, private URLs, or sensitive inference content.
9
+ - type: input
10
+ id: version
11
+ attributes:
12
+ label: CLI version
13
+ description: Output from `runpod-vllm --version`.
14
+ validations:
15
+ required: true
16
+ - type: dropdown
17
+ id: command
18
+ attributes:
19
+ label: Command
20
+ options: [plan, deploy, status, wait, smoke-test, destroy, list, other]
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ id: reproduction
25
+ attributes:
26
+ label: Minimal reproduction
27
+ description: Use placeholders for all identifiers and secrets.
28
+ validations:
29
+ required: true
30
+ - type: textarea
31
+ id: expected
32
+ attributes:
33
+ label: Expected behavior
34
+ validations:
35
+ required: true
36
+ - type: textarea
37
+ id: actual
38
+ attributes:
39
+ label: Actual behavior
40
+ validations:
41
+ required: true
42
+ - type: checkboxes
43
+ id: safety
44
+ attributes:
45
+ label: Safety check
46
+ options:
47
+ - label: I removed credentials, Pod IDs, private URLs, and sensitive payloads.
48
+ required: true
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Private security report
4
+ url: https://github.com/1solomonwakhungu/runpod-vllm-deployer/security/advisories/new
5
+ about: Report vulnerabilities through GitHub Security Advisories.
@@ -0,0 +1,30 @@
1
+ name: Feature request
2
+ description: Propose a focused improvement to the CLI or documentation.
3
+ title: "[Feature]: "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem
10
+ description: What workflow or safety gap should be addressed?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposed solution
17
+ description: Include expected CLI behavior and defaults.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: alternatives
22
+ attributes:
23
+ label: Alternatives considered
24
+ - type: checkboxes
25
+ id: billing
26
+ attributes:
27
+ label: Resource impact
28
+ options:
29
+ - label: I described whether this could create, modify, or delete billable resources.
30
+ required: true
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: monthly
7
+ open-pull-requests-limit: 5
8
+ labels: [dependencies]
9
+ - package-ecosystem: github-actions
10
+ directory: "/"
11
+ schedule:
12
+ interval: monthly
13
+ open-pull-requests-limit: 5
14
+ labels: [dependencies, github-actions]
@@ -0,0 +1,15 @@
1
+ ## Summary
2
+
3
+ Describe the change and its user impact.
4
+
5
+ ## Safety impact
6
+
7
+ Explain any effect on billing gates, teardown state, credentials, redaction, network access, or deletion behavior.
8
+
9
+ ## Validation
10
+
11
+ - [ ] `make check` passes
12
+ - [ ] Tests use mocks or offline fixtures only
13
+ - [ ] Documentation matches actual CLI help
14
+ - [ ] The diff contains no credentials, private paths, Pod IDs, private URLs, or sensitive payloads
15
+ - [ ] No live RunPod resource was created or mutated while testing
@@ -0,0 +1,186 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+ inputs:
8
+ version:
9
+ description: "Existing version to publish (for example, 0.1.0)"
10
+ required: true
11
+ type: string
12
+
13
+ # Jobs opt in to the write scopes they need.
14
+ permissions:
15
+ contents: read
16
+
17
+ # One release at a time. A second push waits for the first run to finish
18
+ # instead of racing it to the release commit and tag.
19
+ concurrency:
20
+ group: release
21
+ cancel-in-progress: false
22
+
23
+ jobs:
24
+ lint-and-test:
25
+ name: Quality gate (Python ${{ matrix.python-version }})
26
+ # A manual run republishes a version that already passed this gate.
27
+ if: github.event_name == 'push'
28
+ runs-on: ubuntu-latest
29
+ strategy:
30
+ fail-fast: false
31
+ matrix:
32
+ python-version: ["3.11", "3.12", "3.13"]
33
+ steps:
34
+ - name: Check out repository
35
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
36
+ with:
37
+ persist-credentials: false
38
+ - name: Set up Python
39
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
40
+ with:
41
+ python-version: ${{ matrix.python-version }}
42
+ cache: pip
43
+ - name: Install project and dev dependencies
44
+ run: python -m pip install -e '.[dev]'
45
+ # Ruff lint and format check, mypy, pytest and scripts/safety_scan.py.
46
+ - name: Run complete quality gate
47
+ run: make check
48
+
49
+ release:
50
+ name: Version, tag and publish
51
+ needs: lint-and-test
52
+ if: github.event_name == 'push'
53
+ runs-on: ubuntu-latest
54
+ environment: pypi
55
+ permissions:
56
+ contents: write
57
+ id-token: write
58
+ outputs:
59
+ released: ${{ steps.semantic_release.outputs.released }}
60
+ version: ${{ steps.semantic_release.outputs.version }}
61
+ tag: ${{ steps.semantic_release.outputs.tag }}
62
+ steps:
63
+ # Check out the branch tip so semantic-release runs on main itself. The
64
+ # next step refuses to release unless that tip is the commit this run's
65
+ # gate tested.
66
+ - name: Check out repository
67
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
68
+ with:
69
+ ref: ${{ github.ref_name }}
70
+ fetch-depth: 0
71
+ - name: Set up Python
72
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
73
+ with:
74
+ python-version: "3.12"
75
+ cache: pip
76
+ - name: Install project and dev dependencies
77
+ run: python -m pip install -e '.[dev]'
78
+
79
+ - name: Configure Git for semantic-release
80
+ run: |
81
+ git config user.name "github-actions[bot]"
82
+ git config user.email "github-actions[bot]@users.noreply.github.com"
83
+
84
+ - name: Run semantic-release (version + changelog + tag)
85
+ id: semantic_release
86
+ env:
87
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88
+ run: |
89
+ # --no-vcs-release: the "Create GitHub Release" step below owns
90
+ # publishing the release so it can attach the built distributions.
91
+ before="$(git rev-parse HEAD)"
92
+ # Release only the commit the gate tested. If main has moved on,
93
+ # either a newer push has its own run queued behind this one, or
94
+ # this is a rerun after the release commit already landed. Rerun a
95
+ # failed publish with the manual dispatch instead.
96
+ if [ "$before" != "$GITHUB_SHA" ]; then
97
+ echo "main is at ${before}, not ${GITHUB_SHA}; skipping the release."
98
+ echo "released=false" >> "$GITHUB_OUTPUT"
99
+ exit 0
100
+ fi
101
+ python -m semantic_release version --no-vcs-release
102
+ # A new, tagged commit means semantic-release cut a version in this
103
+ # run. A tag on an unchanged HEAD is an earlier run's release.
104
+ if [ "$(git rev-parse HEAD)" != "$before" ] \
105
+ && tag="$(git describe --tags --exact-match HEAD 2>/dev/null)"; then
106
+ {
107
+ echo "released=true"
108
+ echo "tag=${tag}"
109
+ echo "version=${tag#v}"
110
+ } >> "$GITHUB_OUTPUT"
111
+ else
112
+ echo "released=false" >> "$GITHUB_OUTPUT"
113
+ fi
114
+
115
+ - name: Build distribution
116
+ if: steps.semantic_release.outputs.released == 'true'
117
+ run: python -m build
118
+
119
+ # The GitHub Release comes before PyPI on purpose: it must exist even if
120
+ # the upload fails. A failed upload is retried with the manual dispatch.
121
+ - name: Create GitHub Release
122
+ if: steps.semantic_release.outputs.released == 'true'
123
+ env:
124
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125
+ TAG: ${{ steps.semantic_release.outputs.tag }}
126
+ run: |
127
+ gh release create "$TAG" \
128
+ --verify-tag \
129
+ --title "$TAG" \
130
+ --generate-notes \
131
+ dist/*.whl dist/*.tar.gz
132
+
133
+ - name: Publish to PyPI
134
+ if: steps.semantic_release.outputs.released == 'true'
135
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
136
+
137
+ # Manual retry for a version that is already tagged, for example when the
138
+ # PyPI upload failed after the tag and GitHub Release were created. Both
139
+ # publishing steps are safe to run again.
140
+ publish-existing-version:
141
+ name: Publish an existing version
142
+ if: github.event_name == 'workflow_dispatch'
143
+ runs-on: ubuntu-latest
144
+ environment: pypi
145
+ permissions:
146
+ contents: write
147
+ id-token: write
148
+ env:
149
+ VERSION: ${{ inputs.version }}
150
+ steps:
151
+ - name: Check out the release tag
152
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
153
+ with:
154
+ ref: refs/tags/v${{ inputs.version }}
155
+ persist-credentials: false
156
+ - name: Set up Python
157
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
158
+ with:
159
+ python-version: "3.12"
160
+ - name: Verify the requested version
161
+ run: |
162
+ actual="$(python -c 'from pathlib import Path; namespace = {}; exec(Path("src/runpod_vllm/__init__.py").read_text(), namespace); print(namespace["__version__"])')"
163
+ test "$actual" = "$VERSION"
164
+ # Reuse the files already attached to the GitHub Release so PyPI gets
165
+ # the same bytes. Build only when the release itself is missing.
166
+ - name: Fetch or build the distribution, creating the GitHub Release if missing
167
+ env:
168
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169
+ run: |
170
+ if gh release view "v${VERSION}" >/dev/null 2>&1; then
171
+ echo "GitHub Release v${VERSION} already exists; downloading its files."
172
+ gh release download "v${VERSION}" --dir dist \
173
+ --pattern '*.whl' --pattern '*.tar.gz'
174
+ else
175
+ python -m pip install --upgrade build
176
+ python -m build
177
+ gh release create "v${VERSION}" \
178
+ --verify-tag \
179
+ --title "v${VERSION}" \
180
+ --generate-notes \
181
+ dist/*.whl dist/*.tar.gz
182
+ fi
183
+ - name: Publish to PyPI
184
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
185
+ with:
186
+ skip-existing: true
@@ -0,0 +1,31 @@
1
+ # Credentials and local configuration
2
+ .env
3
+ .env.*
4
+ !.env.example
5
+ *.pem
6
+ *.key
7
+
8
+ # RunPod teardown state
9
+ .runpod-vllm-state.json
10
+ *.runpod-vllm-state.json
11
+
12
+ # Python
13
+ .venv/
14
+ venv/
15
+ __pycache__/
16
+ *.py[cod]
17
+ .pytest_cache/
18
+ .mypy_cache/
19
+ .ruff_cache/
20
+ .coverage
21
+ htmlcov/
22
+ dist/
23
+ build/
24
+ *.egg-info/
25
+
26
+ # Editors and operating systems
27
+ .firecrawl/
28
+ .DS_Store
29
+ .idea/
30
+ .vscode/
31
+ *.swp