feat(server): dispatch /v1/videos/sync by model #1

Merged
steve merged 2 commits from feat/video-routes into main 2026-07-12 14:13:05 +00:00
Owner

Registers the blocking video generation endpoint (POST /v1/videos/sync, vLLM-Omni shape — the response body is the encoded clip) as a model-dispatched route, so llama-swap can hot-swap video upstreams the same way it does imagegen (/sdapi/v1/txt2img) and audio.

  • extractContext is content-type driven, so both multipart and JSON bodies dispatch (covered by test).
  • The async POST /v1/videos is deliberately not dispatched: its poll/download companions (GET /v1/videos/{id}[/content]) carry no model field to route by, so registering creation alone would start unretrievable upstream jobs while burning the GPU. A stray OpenAI-videos client gets a clean 404 instead (tested).
  • /v1/videos/sync joins captureFieldsByPath (headers only, both directions) so enabling captures doesn't buffer conditioning frames or whole clips through cbor+zstd.

Known follow-up (pre-existing, worse for video): the metrics middleware's bodyCopier tees the full response into memory for the usage-JSON scan even on binary routes — for multi-MB clips that's a transient second copy per request. Worth a content-type skip someday; out of scope here.

Part of the video-generation rollout (this fork → majordomo#13 videogen/ → mort llamaswap_generate_video). After merge, dispatch build-cuda-image.yml (e.g. version v231) to build the deployable image.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AXQxVhXBw8PwFAtsVrXSmj

Registers the blocking video generation endpoint (`POST /v1/videos/sync`, vLLM-Omni shape — the response body is the encoded clip) as a model-dispatched route, so llama-swap can hot-swap video upstreams the same way it does imagegen (`/sdapi/v1/txt2img`) and audio. - `extractContext` is content-type driven, so both multipart and JSON bodies dispatch (covered by test). - The async `POST /v1/videos` is **deliberately not dispatched**: its poll/download companions (`GET /v1/videos/{id}[/content]`) carry no model field to route by, so registering creation alone would start unretrievable upstream jobs while burning the GPU. A stray OpenAI-videos client gets a clean 404 instead (tested). - `/v1/videos/sync` joins `captureFieldsByPath` (headers only, both directions) so enabling captures doesn't buffer conditioning frames or whole clips through cbor+zstd. Known follow-up (pre-existing, worse for video): the metrics middleware's `bodyCopier` tees the full response into memory for the usage-JSON scan even on binary routes — for multi-MB clips that's a transient second copy per request. Worth a content-type skip someday; out of scope here. Part of the video-generation rollout (this fork → majordomo#13 `videogen/` → mort `llamaswap_generate_video`). After merge, dispatch `build-cuda-image.yml` (e.g. version `v231`) to build the deployable image. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AXQxVhXBw8PwFAtsVrXSmj
steve added 1 commit 2026-07-12 13:26:17 +00:00
Registers the OpenAI/vLLM-Omni video generation endpoints as
model-dispatched routes so llama-swap can swap in video upstreams
(e.g. vllm serve <model> --omni, or a ComfyUI shim exposing the same
shape). Extraction is content-type driven, so both multipart form and
JSON bodies resolve the model field.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXQxVhXBw8PwFAtsVrXSmj
steve added 1 commit 2026-07-12 13:53:34 +00:00
Review findings: the async POST /v1/videos leg is deliberately NOT
dispatched — its poll/download companions carry no model field to route
by, so registering creation alone would start unretrievable upstream
jobs (a stray OpenAI-videos client now gets a clean 404). And
/v1/videos/sync joins captureFieldsByPath (headers only, both
directions) so enabling captures doesn't buffer conditioning frames or
whole clips through cbor+zstd.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXQxVhXBw8PwFAtsVrXSmj
steve changed title from feat(server): dispatch /v1/videos and /v1/videos/sync by model to feat(server): dispatch /v1/videos/sync by model 2026-07-12 14:00:59 +00:00
steve merged commit 7886758053 into main 2026-07-12 14:13:05 +00:00
steve deleted branch feat/video-routes 2026-07-12 14:13:05 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/llama-swap#1