Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
Prompts and workflows

Kimi K2.7 Code · configuration

Kimi K2.7 Code: Official Multimodal Video Tool Calling & Agent Loop

The official multimodal example combines video input, tool calls, and a bounded agent loop; it is not a guarantee of autonomous execution.

Source not verifiedOfficial Kimi API, video input, tool schema, and an external executor.

Prerequisites and inputs

  • Task goal and source material
  • Client or API
  • Output format and acceptance checks

Prerequisites

Official Kimi API, video input, tool schema, and an external executor.

Task steps

Pin the video segment, tool allowlist, and stop condition; save each tool return and timestamp.

Task result

Return the observed event, tool action, and unresolved uncertainty for the selected clip.

Output and acceptance

The video is accepted at the stated resolution; every tool call has a returned result; no action is claimed without evidence.

Failure correction

If a frame or tool call fails, retry the smallest segment and preserve the error before changing the schema.

Source and boundary

The official example is an API capability demonstration, not an autonomous-agent success rate.

Read the source research notes

One-Line Summary

Kimi K2.7 Code natively integrates MoonViT vision/video embeddings and autonomously invokes local ffmpeg tools to slice video intervals and ingest Base64 multimodal return blocks inside iterative agent loops.

Applicable Scenarios

  • Suitable tasks: UI animation review, video bug replication, screencast-to-code generation, and temporal visual reasoning.

  • Unsuitable tasks: Raw video files exceeding FHD (1920x1080) resolution without compression, non-thinking mode API calls.

  • Applicable model versions: kimi-k2.7-code.

  • Applicable clients/APIs: OpenAI Python SDK (openai>=1.0), Kimi Official API (https://api.moonshot.ai/v1).

  • Recommended inference parameters: tool_choice="auto", video resolution $\le$ FHD, request body $\le$ 100MB.

Directly Usable Content

import base64
import json
import os
import subprocess
import tempfile
from pathlib import Path
from openai import OpenAI

tools = [{
    "type": "function",
    "function": {
        "name": "watch_video_clip",
        "description": "Watch a video file or a sub-clip of it. If start_time and end_time are not provided, the entire video will be returned.",
        "parameters": {
            "type": "object",
            "properties": {
                "path": {
                    "type": "string", 
                    "description": "The path to the video file to watch"
                },
                "start_time": {
                    "type": "number",
                    "description": "The start time of the clip in seconds (optional, defaults to 0)"
                },
                "end_time": {
                    "type": "number",
                    "description": "The end time of the clip in seconds (optional, defaults to end of video)"
                }
            },
            "required": ["path"]
        }
    }
}]

def watch_video_clip(path: str, start_time: float | None = None, end_time: float | None = None) -> list[dict]:
    video_path = Path(path)
    if not video_path.exists():
        raise FileNotFoundError(f"Video file not found: {path}")

    if start_time is None and end_time is None:
        with open(path, "rb") as f:
            video_base64 = base64.b64encode(f.read()).decode("utf-8")
        return [
            {"type": "video_url", "video_url": {"url": f"data:video/mp4;base64,{video_base64}"}},
            {"type": "text", "text": f"Full video: {video_path.name}"}
        ]

    probe = subprocess.run(
        ["ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", path],
        capture_output=True, text=True
    )
    duration = float(json.loads(probe.stdout)["format"]["duration"])
    start_time = start_time or 0
    end_time = end_time or duration
    clip_duration = end_time - start_time

    with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmp:
        tmp_path = tmp.name

    try:
        subprocess.run([
            "ffmpeg", "-y", "-ss", str(start_time), "-i", path,
            "-t", str(clip_duration), "-c:v", "libx264", "-c:a", "aac",
            "-preset", "fast", "-crf", "23", "-movflags", "+faststart",
            "-loglevel", "error", tmp_path
        ], check=True)

        with open(tmp_path, "rb") as f:
            video_base64 = base64.b64encode(f.read()).decode("utf-8")

        return [
            {"type": "video_url", "video_url": {"url": f"data:video/mp4;base64,{video_base64}"}},
            {"type": "text", "text": f"Clip from {video_path.name}: {start_time}s - {end_time}s"}
        ]
    finally:
        if os.path.exists(tmp_path):
            os.unlink(tmp_path)

client = OpenAI(
    api_key=os.environ.get("MOONSHOT_API_KEY"),
    base_url="https://api.moonshot.ai/v1"
)

def agent_loop(user_message: str):
    messages = [
        {"role": "system", "content": "You are a video analysis assistant. Use watch_video_clip to examine specific portions of videos."},
        {"role": "user", "content": user_message}
    ]

    while True:
        response = client.chat.completions.create(
            model="kimi-k2.7-code",
            messages=messages,
            tools=tools,
            tool_choice="auto"
        )
        message = response.choices[0].message
        messages.append(message.model_dump())

        if not message.tool_calls:
            return message.content

        for tool_call in message.tool_calls:
            if tool_call.function.name == "watch_video_clip":
                args = json.loads(tool_call.function.arguments)
                result = watch_video_clip(
                    path=args["path"],
                    start_time=args.get("start_time"),
                    end_time=args.get("end_time")
                )
                messages.append({
                    "role": "tool",
                    "tool_call_id": tool_call.id,
                    "content": result
                })

Raw Evidence & Data

  • MoonViT 400M parameters vision encoder handles joint spatial-temporal embeddings.

  • Formats: MP4, MOV, WebM, AVI (max FHD 1080p).

  • 100MB body limit; URL-based images not supported (requires Base64 or File Upload API).

Source and dates

Kimi API Platform Documentation / Hugging Face Model Card · Source date: Not disclosed · Edited: 2026-09-20

Read the original source
Variable checklist

No required variables

Related prompts

Kimi K2.7 Code: Official Claude Code Integration & Multi-Tier Model MappingKimi K2.7 Code: Official GitHub Copilot Integration & Enterprise Policy SetupKimi K2.7 Code: Official Integration and Long-Horizon Coding Prompt WorkflowUnsiloed Benchmark: Full FastAPI Project Generation Prompt & Architectural Standard

Related reviews

Kimi K2.7 Code: Official Hugging Face Model Specifications and Full Benchmark DataUnsiloed Benchmark: Kimi K2.7 Code vs GLM 5.2 Controlled Benchmark on Real-World Code Generation and Large Repository AnalysisDevin Team: FrontierCode Extended Benchmark and Long-Horizon Engineering PerformanceOpenCode Community: Real-World Agentic Coding Cost & Tool Loop Efficiency Comparison

Read the full analysis

Overview · English

Kimi K2.7 Code: What It Is, What It Costs, and Who It Fits

A sourced Kimi K2.7 Code overview: the $4/M output anchor, 256K multimodal coding model, K2.6/K3 boundary, access routes and pilot risks.

Kimi K2.7 Code

Use Kimi K2.7 Code in Tabbit

Run this guide in the environment listed above. Downloading does not transfer the template or establish model availability for your account.