ui-svelte,internal/server: add video generation API support (/v1/videos) - #991
ui-svelte,internal/server: add video generation API support (/v1/videos)#991dkruyt wants to merge 5 commits into
Conversation
Add OpenAI/vLLM-omni-compatible video generation routing, capability
metadata, and a Playground UI tab.
- route POST /v1/videos and /v1/videos/sync (multipart, model in form
field) like /v1/audio/transcriptions and /v1/images/edits
- route GET/DELETE /v1/videos, /v1/videos/{video_id}, and
/v1/videos/{video_id}/content via a required ?model= query param,
same convention as /props, since job ids don't carry a model
- add "video" as a valid capabilities modality and derive
video_understanding/video_generation/image_to_video/video_to_video
capability flags for /v1/models
- add a Playground "Video" tab (VideoInterface.svelte, videoApi.ts)
with sync/async generation, job status polling, and reference
image/video upload for image-to-video and video-to-video
- update README.md and config.example.yaml docs
Add a negative prompt field and an "Advanced parameters" JSON escape hatch to the Video playground tab, so backend-specific fields (e.g. vLLM-omni's width/height/num_frames/seed/extra_params) can be sent without hardcoding a widget per vendor field. - add negativePrompt/advanced to VideoGenerationParams - flatten params.advanced onto the multipart form in buildVideoFormData, JSON-encoding object values (e.g. extra_params) and overriding same-named basic fields; "model" is never overridable - add a Negative Prompt input and a collapsible Advanced JSON textarea to VideoInterface.svelte, parsed and validated on submit - extend videoApi.test.ts to cover negative_prompt/advanced flattening, extra_params JSON-encoding, and override precedence Verified backend routing needs no changes: internal/shared/http.go's multipart handling only touches the "model" field and passes every other field (and the input_reference file) through untouched.
Add a Wan2.2-TI2V-5B model entry showing how to serve a vLLM-omni video-generation backend (POST /v1/videos, /v1/videos/sync) behind llama-swap, based on a working deployment. - capabilities: in [text, image], out [video] - docker cmd/cmdStop pattern, same convention as the docker-llama example
internal/config/model_config.go already accepts "video" as a valid capabilities modality, but config-schema.json's enums were never updated to match, so config.example.yaml's new video model example failed schema validation (TestConfig_ExampleMatchesSchema).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| internal/server/server.go | Registers video POST, GET, and DELETE routes; the DELETE route exposes incompatible query-model rewriting for aliased or selected models. |
| internal/shared/http.go | Unchanged request-rewrite logic is newly exercised by DELETE routing and rewrites the body rather than the model query parameter. |
| ui-svelte/src/lib/videoApi.ts | Implements multipart creation, polling, content retrieval, and deletion with encoded model/job parameters; no independently publishable client defect was established. |
| ui-svelte/src/components/playground/VideoInterface.svelte | Adds the video generation interface and follows existing Playground component and store patterns. |
| internal/server/api.go | Derives video capability flags consistently from configured input and output modalities. |
| internal/config/model_config.go | Adds video to validated model modalities with corresponding schema and tests. |
Reviews (1): Last reviewed commit: "config-schema.json: add "video" to capab..." | Re-trigger Greptile
ReplaceRequestModel only updated the URL query for GET requests, so a
DELETE /v1/videos/{video_id} routed through a profile pin, selector, or
peer wrote the replacement into an empty form body and forwarded the
original public model id in the query. The rewrite was then undone when
the invalidated context was re-resolved from that untouched query.
- add modelInQuery() and use it in extractContext and ReplaceRequestModel
- keep the query model in sync for body-carrying methods
- add DELETE coverage for the shared rewriter, selectors, and profiles
Summary
Adds video generation support to llama-swap: OpenAI/vLLM-omni-compatible
/v1/videosrouting on the backend, capability metadata for/v1/models,and a new "Video" tab in the Playground UI.
vLLM-omni video API reference: https://docs.vllm.ai/projects/vllm-omni/en/latest/serving/videos_api/
Backend
POST /v1/videosandPOST /v1/videos/sync(multipart, model inform field) the same way
/v1/audio/transcriptionsand/v1/images/editsare already routed.GET /v1/videos,GET /v1/videos/{video_id},GET /v1/videos/{video_id}/content, andDELETE /v1/videos/{video_id}via a required
?model=query param — job ids don't carry a model, sothis follows the same convention
/propsalready uses."video"as a validcapabilitiesmodality and derivevideo_understanding/video_generation/image_to_video/video_to_videoflags for/v1/models, mirroring the existingimage/audio capability derivation.
(
internal/shared/http.go) — it only ever reads/rewrites themodelfield and passes every other field (and any uploaded file) through
untouched, so arbitrary backend-specific fields already work.
README.mdandconfig.example.yamldocs.Playground UI
VideoInterface.svelte,videoApi.ts) with:completion, with cancel support).
(
size,seconds,fps) most backends are likely to honor.arbitrary backend-specific fields onto the request (e.g. vLLM-omni's
width/height/num_frames/seed/extra_params), so the UI isn'tlimited to one backend's field names — advanced values override
same-named basic fields, and
modelcan never be overridden this way.<video controls>element withblob-URL playback and download.
fix: #990