Skip to content

ui-svelte,internal/server: add video generation API support (/v1/videos) - #991

Open
dkruyt wants to merge 5 commits into
mostlygeek:mainfrom
dkruyt:feat/video
Open

ui-svelte,internal/server: add video generation API support (/v1/videos)#991
dkruyt wants to merge 5 commits into
mostlygeek:mainfrom
dkruyt:feat/video

Conversation

@dkruyt

@dkruyt dkruyt commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds video generation support to llama-swap: OpenAI/vLLM-omni-compatible
/v1/videos routing 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

  • Route POST /v1/videos and POST /v1/videos/sync (multipart, model in
    form field) the same way /v1/audio/transcriptions and
    /v1/images/edits are already routed.
  • Route GET /v1/videos, GET /v1/videos/{video_id},
    GET /v1/videos/{video_id}/content, and DELETE /v1/videos/{video_id}
    via a required ?model= query param — job ids don't carry a model, so
    this follows the same convention /props already uses.
  • Add "video" as a valid capabilities modality and derive
    video_understanding / video_generation / image_to_video /
    video_to_video flags for /v1/models, mirroring the existing
    image/audio capability derivation.
  • No changes needed to multipart/model-extraction handling
    (internal/shared/http.go) — it only ever reads/rewrites the model
    field and passes every other field (and any uploaded file) through
    untouched, so arbitrary backend-specific fields already work.
  • Update README.md and config.example.yaml docs.

Playground UI

  • New "Video" tab (VideoInterface.svelte, videoApi.ts) with:
    • Sync and async generation modes (async polls job status to
      completion, with cancel support).
    • Model selector filtered by the new video capability flags.
    • Reference image/video upload for image-to-video and video-to-video.
    • Size/duration/FPS controls covering the OpenAI-style baseline fields
      (size, seconds, fps) most backends are likely to honor.
    • An optional negative prompt field.
    • A collapsible Advanced parameters JSON box that flattens
      arbitrary backend-specific fields onto the request (e.g. vLLM-omni's
      width/height/num_frames/seed/extra_params), so the UI isn't
      limited to one backend's field names — advanced values override
      same-named basic fields, and model can never be overridden this way.
  • Result rendering via a native <video controls> element with
    blob-URL playback and download.
image

fix: #990

dkruyt added 4 commits August 6, 2026 17:03
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).
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c1e9d3d0-3994-42fc-a145-2153125ac68b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Greptile Summary

Adds video capability metadata, model-dispatched video API routes, and a Playground interface supporting synchronous and asynchronous generation.

  • Extends model modalities and derived capability flags for video understanding and generation.
  • Proxies multipart creation and query-dispatched status, content, and deletion endpoints.
  • Adds video generation controls, polling, uploads, playback, download, and backend-specific advanced parameters.

Confidence Score: 4/5

The DELETE routing defect should be fixed before merging because video job deletion fails to forward rewritten backend model IDs for aliases and selectors.

The new DELETE endpoint enters routing paths that rewrite model identities, but the shared rewriter updates URL parameters only for GET and therefore forwards the original public model ID to the video backend.

Files Needing Attention: internal/server/server.go and internal/shared/http.go

Important Files Changed

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

Comment thread internal/server/server.go
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
@dkruyt dkruyt changed the title Feat/video ui-svelte,internal/server: add video generation API support (/v1/videos) Aug 6, 2026
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.

Add video generation API support (/v1/videos)

1 participant