Skip to content

docs(examples): fix QB payload envelope and routes (SLS-346) - #50

Open
deanq wants to merge 5 commits into
mainfrom
deanq/sls-346-qb-payload-wrappers
Open

deanq wants to merge 5 commits into
mainfrom
deanq/sls-346-qb-payload-wrappers

Conversation

@deanq

@deanq deanq commented Sep 25, 2026

Copy link
Copy Markdown
Member

Description

Fixes the queue-based (/runsync) request examples across the READMEs so they work when copy-pasted into flash dev. Two independent bugs made them fail:

  1. Missing input envelope (422). QB routes require {"input": {"<function-param-name>": ...}}. The docs showed the raw body. The inner key is the worker function's parameter name (input_data, payload, or prompt), so it varies per example.
  2. Wrong route for multi-function modules (404). When a module defines more than one @Endpoint function, flash dev mounts /<module>/<function>/runsync; /<module>/runsync only exists for single-function modules. Affected: 03_mixed_workers (cpu_worker), 01_text_to_speech, 01_autoscaling (README curls, load-test examples, and load_test.py's DEFAULT_ENDPOINT).

Also wraps the placeholder payloads in CLI-REFERENCE.md, CONTRIBUTING.md, and docs/cli/commands.md, and load_test.py's DEFAULT_PAYLOAD (the load test previously 422'd on every request).

Load-balanced routes (@endpoint.post/get, e.g. /pipeline/classify) take the body directly and are unchanged. Single-function modules (01_hello_world, 02_cpu_worker, 01_network_volumes, 05_volume_warm_cache, mixed_workers gpu_worker) keep /<module>/runsync.

Linear: SLS-346

Type of Change

  • Bug fix
  • Documentation update

Testing

Run with flash dev. Runpod Flash is 1.17.0 unless noted.

Route Old payload / path New payload / path
02_cpu_worker /cpu_worker/runsync 422 200 COMPLETED
autoscaling /cpu_worker/cpu_scale_to_zero/runsync 422 200 COMPLETED
autoscaling old path /cpu_worker/runsync (1.17.0 and 1.20.0) 404 n/a
  • Re-checked on runpod-flash 1.20.0 (latest): every /runsync route's OpenAPI request schema requires input, the unwrapped payload still 422s, and multi-function routes are still /<module>/<fn>/runsync.
  • Checked every edited path against the route table flash dev prints at startup. All exist.
  • GPU and text-to-speech routes were only checked against the route table. I didn't call them, to avoid provisioning GPUs.
  • make quality-check passes.
  • Endpoints created during testing were torn down, and the account API confirms they are deleted.
cd 04_scaling_performance/01_autoscaling
uv run flash dev
curl -X POST http://localhost:8888/cpu_worker/cpu_scale_to_zero/runsync \
  -H "Content-Type: application/json" \
  -d '{"input": {"payload": {"text": "Hello autoscaling"}}}'

🤖 Generated with Claude Code

flash dev mounts QB routes at /<module>/<fn>/runsync when a module
defines more than one @endpoint function; /<module>/runsync only
exists for single-function modules. The documented paths 404'd.

- mixed_workers: cpu_worker -> preprocess_text
- text_to_speech: generate_speech, get_voices
- autoscaling: README curls, load_test examples, DEFAULT_ENDPOINT

Verified against flash dev route listing on runpod-flash 1.20.0.

SLS-346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant