Files
hao-ai-lab-FastVideo/docs/design/server_contracts/index.md
T
11bdafa812 [docs] streaming: OpenAI HTTP contract reference
docs/design/server_contracts/ lands the contract reference set that PR
8 locks down ahead of the streaming + Dynamo upstreams. This commit
adds the index page plus the OpenAI HTTP reference:

* endpoint catalogue (/v1/videos/generations, list, status, content,
  images, models, health)
* VideoGenerationsRequest shape with SGLang-compatible extensions
* merge precedence (body > default_request > hardcoded fallback)
  with a pointer to the explicit-path tracking mechanism that makes
  it work
* continuation-state roundtrip on the stateless surface
* HTTP error code table
* explicit non-goals: flat legacy kwargs, private Dreamverse fields,
  raw tensor payloads — all excluded from this boundary by design

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00

1.7 KiB

Server Contracts

FastVideo's typed public API (fastvideo.api) is consumed by three server-class integrations that must share one execution substrate so we don't grow three near-duplicate progress loops:

Consumer Transport Request shape State model
Stateless OpenAI HTTP POST /v1/videos VideoGenerationsRequest → GenerationRequest merged onto ServeConfig.default_request Stateless; optional ContinuationState round-trip
Streaming WebSocket WebSocket JSON + binary fMP4 GenerationRequest per segment Server-held SessionStore, snapshot-on-demand
Dynamo native backend Dynamo RPC NvCreateVideoRequest → adapter → GenerationRequest Aggregated today; disaggregated via ContinuationState later

All three consume the same underlying surface:

from fastvideo import VideoGenerator
from fastvideo.api import (
    ContinuationState,
    GenerationRequest,
    InputConfig,
    OutputConfig,
    SamplingConfig,
    ServeConfig,
)

# Sync today, async after PR 7.10 lands VideoGenerator.generate_async.
result = generator.generate(request)

These docs lock down the request/response shapes so drift between FastVideo, the internal UI, and Dynamo can be caught at review time. PR 8 does not ship runtime code; it ships the contract reference and the contract tests that guard it.