Skip to content

Add full provider input schemas for all video models #195

@SecurityQQ

Description

@SecurityQQ

Context

PR #194 added model-rules.ts with per-model Zod schemas to normalize duration values before sending to providers. Currently ModelDurationRules only handles duration — but there are many other model-specific input constraints in the if/else chains in fal.ts (lines 520-720).

What needs to happen

Expand model-rules.ts into full provider input schemas that validate and normalize all model-specific fields:

  • aspect_ratio — some models use video_size instead, some restrict to specific ratios
  • resolution — Grok Imagine defaults "720p"
  • generate_audio — Kling v3/v2.6 and LTX-2 default to true
  • delete_video — Sora 2 needs false to keep URLs accessible
  • video_size — LTX-2 uses this instead of aspect_ratio
  • num_frames — LTX-2 converts duration * fps to frame count
  • end_image_url — supported by Kling v3/v2.6 and LTX-2

Once complete, rename ModelDurationRulesModelInputRules and consolidate the remaining if/else logic in fal.ts into the Zod schemas.

Related

  • Gateway companion issue: vargHQ/gateway#88
  • Current implementation: src/ai-sdk/providers/model-rules.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions