feat: add Kimi-K3 video input support

#172
by ai-eks - opened

Summary

  • add video / video_url inputs to the Kimi-K3 remote processor
  • decode local paths, HTTP(S) URLs, raw bytes, and Base64 data URLs with PyAV
  • uniformly sample frames and emit timestamped 4-frame MoonViT3d chunks
  • apply the configured per-frame and whole-video patch limits
  • document support as video (without audio track)
  • add focused tests for sampling, chunk prompts, temporal grids, and OpenAI-style message extraction

Open question for maintainers

Kimi-K3's preprocessor_config.json defines both in_patch_limit_each_frame=16384 and in_patch_limit_video=655360. This PR interprets in_patch_limit_video as one global patch budget shared by all sampled frames from a source video, consistent with Kimi-K2.5's navit_resize_video behavior.

Could you confirm whether that is the intended Kimi-K3 contract, or whether in_patch_limit_video should instead apply independently to each temporal chunk?

Validation

  • pytest -q tests/test_video_processing.py — 4 passed
  • real MP4 path and Base64 decoding smoke test
  • full AutoProcessor.from_pretrained(..., trust_remote_code=True) smoke test with a real MP4
  • git diff --check

@YyWangMsh @bigeagle @ai-eks Is there any process??

@YyWangMsh @bigeagle @ai-eks Is there any process??

Haven’t heard back from the Kimi team yet. For reference, I also have an open PR for SGLang that’s already been tested on real hardware: https://github.com/sgl-project/sglang/pull/35325

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment