Skip to content

FrameFlow · Runtime SDK, ModelFormat v1 & Packaging CLI Reference

5 APIs / Specs

Covers runtime/index.js capability probing & engine init, zero-copy WebGPU/WebGL2 sessions, FrameFlowPacer scheduling, format_version=1 artifacts, and release packaging.

SDKZero npm deps · Zero WASM pure ES modulesCore Public Entrypoint

Capability Probing & Engine Creation (probeCapabilities / createFrameFlow)

import { probeCapabilities, createFrameFlow, loadModelFromUrl } from "frameflow/runtime"

Tries WebGPU Compute (auto-enabling shader-f16 with seamless f32 fallback) first and degrades automatically to WebGL2 RGBA16F + MRT; accepts { device } or { gl } for zero-copy emulator sharing.

Open Browser & Emulator Integration ↗

✅ Supported Capabilities

  • probeCapabilities() checks WebGPU and WebGL2 float FBO support without allocating session textures
  • Supports zero-copy shared { device: GPUDevice } (PVSSPW) and { gl: WebGL2RenderingContext } (PPSSPW)

⛔ Explicit Non-Goals & Limits

  • No CPU / WASM inference fallback: explicitly rejects browsers lacking both WebGPU and float/half-float FBO targets
  • Never call cross-device copyExternalImageToTexture on an OffscreenCanvas-transferred element

Parameters, Options & Validation Guards

backendconfig'auto' | 'webgpu' | 'webgl2'OptionalDefault: 'auto'

Follows device -> webgpu or gl -> webgl2 hints when supplied

deviceconfigGPUDeviceOptional

Reuse host GPUDevice to avoid cross-device texture copies

glconfigWebGL2RenderingContextOptional

Reuse host WebGL2 context

precisionconfig'auto' | 'f16' | 'f32'OptionalDefault: 'auto'

Selects f16 WGSL compute when shader-f16 is exposed

Outcomes & Errors

OK · EngineReadyReturns an initialized FrameFlowEngine with inspectable engine.info()
Error · UnsupportedGPUThrows explicit unsupported error rather than starving emulator CPUs