mock_server
¶
Mock streaming server — a frontend dev aid.
Boots the same FastAPI app the real streaming server uses, but backs
it with :class:InProcessGpuPool wrapping a synthetic generator that
emits pre-baked RGB frames. No GPU or model weights required.
Use cases:
- Frontend development without a real model loaded.
- Integration tests that exercise the WS protocol end-to-end.
- Reproducing protocol bugs locally.
Launch: python -m fastvideo.entrypoints.streaming.mock_server.
Classes¶
fastvideo.entrypoints.streaming.mock_server.MockGenerator
dataclass
¶
MockGenerator(sleep_ms: float = 0.0)
Generator stand-in that returns synthetic gradient frames.
Each call produces one segment worth of frames whose pixels vary by
a constant derived from the request seed and segment index. Latency
is configurable via sleep_ms so the caller can exercise slow-
generate scenarios without spinning a GPU.
Functions¶
fastvideo.entrypoints.streaming.mock_server.build_mock_app
¶
build_mock_app(*, sleep_ms: float = 0.0)
Build a FastAPI app backed by :class:MockGenerator.