<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Kimi Research Blog | Moonshot AI</title>
  <subtitle>Browse aymeric&#39;s, an independent, searchable archive of readable snapshots from followed feeds, preserved in Git with aggr.</subtitle>
  <id>https://aggr.aymericbeaumet.com/sources/kimi.com/</id>
  <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/sources/kimi.com/"/>
  <link rel="self" type="application/atom+xml" href="https://aggr.aymericbeaumet.com/sources/kimi.com/atom.xml"/>
  <updated>2026-07-16T00:00:00+00:00</updated>
  <author>
    <name>aymeric&#39;s</name>
  </author>
  <generator version="2.0.0" uri="https://github.com/aymericbeaumet/aggr">aggr</generator>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:d0662b852151b5cb8b2a2ef8a20e23baa497d332</id>
    <title type="text">PerceptionBench</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-07-16-perceptionbench/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/perception-bench"/>
    <published>2026-07-16T00:00:00+00:00</published>
    <updated>2026-07-16T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-07-16</summary>
    <content type="html">&lt;h2&gt;Introducing PerceptionBench&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Evaluating Atomic Visual Perception in Multimodal Large Language Models&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Authors&lt;/strong&gt; Kimi Team&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;We are releasing &lt;strong&gt;PerceptionBench&lt;/strong&gt;, a benchmark that isolates visual perception and evaluates it as a set of atomic capabilities—&lt;strong&gt;discovered from how today&#39;s models fail, not defined in advance.&lt;/strong&gt; From frontier-model failures across 42 benchmarks, we derive 10 atomic perceptual capabilities and construct 3,000 verified questions, each isolating a single capability and answerable by looking, with no reasoning or external knowledge required.&lt;/p&gt;
&lt;p&gt;Across sixteen frontier MLLMs, no model reaches 60% accuracy, and perception-related hallucination is the weakest capability on average. Models with nearly identical overall scores can diverge sharply in what they actually perceive. PerceptionBench is built to expose exactly where perception breaks, and to drive progress toward multimodal AI that sees faithfully and consistently.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-07-24/1d9hj9od3v89kken0j8dg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;PerceptionBench versus existing evaluation: an existing benchmark item couples perception with knowledge and reasoning in a single question, while PerceptionBench evaluates ten atomic perceptual categories with one isolating question each&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h2&gt;The Dataset&lt;/h2&gt;
&lt;p&gt;Guided by the induced taxonomy, we select the most informative failures from the source benchmarks, decompose them into atomic sub-questions, and author additional questions on supplemented images. The retained and constructed samples together form an in-house pool of &lt;strong&gt;17,000+&lt;/strong&gt; verified questions. The released benchmark subsamples &lt;strong&gt;3,000&lt;/strong&gt; verified questions from the constructed portion—&lt;strong&gt;60% decomposed&lt;/strong&gt; from attributed model failures and &lt;strong&gt;40% newly authored&lt;/strong&gt;—with category-level balancing and difficulty stratification to isolate atomic perceptual capabilities from confounding factors. The released benchmark distinguishes itself through three core design principles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure-Driven Taxonomy:&lt;/strong&gt; Every category is discovered from real model failures, attributed to the earliest erroneous step across 42 existing benchmarks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ten Atomic Perceptual Categories:&lt;/strong&gt; Visual Relation, Counting, Attribute, Depth &amp;amp; 3D, Localization, Comparison, Fine-grained Recognition, Context Integration, OCR, and Hallucination.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Perception, Not Reasoning or Knowledge:&lt;/strong&gt; Samples are curated, decomposed, and difficulty-balanced so that difficulty stems from perception rather than reasoning or external knowledge.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-07-23/1d9h01rl3v89kkemvehg0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;Qualitative examples: four source-benchmark items whose original questions require multi-step solutions are decomposed into atomic perception-only sub-questions, shown with ground truth and the answers of Kimi K3, GPT-5.6-Sol, Claude-Fable-5, and Gemini-3.1-Pro&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Each source benchmark captures a narrow slice of perception errors, and these slices overlap only weakly (mean pairwise weighted Jaccard 0.20). No single benchmark—or small group of them—covers perception as a whole, which motivates a capability-centric benchmark that aggregates and rebalances these fragmented views.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://www.kimi.com/landing-ui/assets/blog-assets/perception-bench/openbench_jaccard.svg&quot; alt=&quot;Distribution of attributed failures across error types for each of the 42 aggregated open-source benchmarks; each benchmark&amp;#39;s failures concentrate on one or a few error types, while the ten perception-branch types recur across nearly all benchmarks&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h3&gt;Distribution of Tasks per Category&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Statistics&lt;/th&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;3,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Atomic perceptual categories&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task Categories&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Depth 3D Perception Error&lt;/td&gt;
&lt;td&gt;330 (11.00%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Counting Error&lt;/td&gt;
&lt;td&gt;330 (11.00%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fine-Grained Recognition Error&lt;/td&gt;
&lt;td&gt;290 (9.67%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Relation Error&lt;/td&gt;
&lt;td&gt;330 (11.00%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Attribute Error&lt;/td&gt;
&lt;td&gt;330 (11.00%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Localization Error&lt;/td&gt;
&lt;td&gt;330 (11.00%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Comparison Error&lt;/td&gt;
&lt;td&gt;279 (9.30%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context Integration Error&lt;/td&gt;
&lt;td&gt;255 (8.50%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hallucination&lt;/td&gt;
&lt;td&gt;271 (9.03%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OCR Error&lt;/td&gt;
&lt;td&gt;255 (8.50%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Using PerceptionBench to Compare Models&lt;/h2&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;PerceptionBench is a simple but challenging benchmark for evaluating the atomic visual perception of frontier models. It provides a capability-level standard for measuring and diagnosing the visual perception boundaries of multimodal models. We are open-sourcing the PerceptionBench dataset and evaluation code to help the community address the visual perception gap.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Download the Data:&lt;/strong&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/PerceptionBench&quot;&gt;https://github.com/MoonshotAI/PerceptionBench&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:53bad46670e0473f0c02c84e00c7a9b19aab56a7</id>
    <title type="text">Kimi K3</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-07-16-kimi-k3/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-k3"/>
    <published>2026-07-16T00:00:00+00:00</published>
    <updated>2026-07-16T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-07-16</summary>
    <content type="html">&lt;p&gt;Today, we are introducing Kimi K3 — our most capable model. Kimi K3 is a 2.8T-parameter model built on our Kimi Delta Attention and Attention Residuals, with native vision capabilities and a 1-million-token context window. It is the world&#39;s first open 3T-class model, designed for frontier intelligence across long-horizon coding, knowledge work, and reasoning.&lt;/p&gt;
&lt;p&gt;While its overall performance still trails the most powerful proprietary models, Claude Fable 5 and GPT 5.6 Sol, Kimi K3 demonstrated frontier-level performance across our evaluation suite, consistently outperforming other tested models.&lt;/p&gt;
&lt;p&gt;Kimi K3 is available today on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;Kimi.com&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/products/kimi-work&quot;&gt;Kimi Work&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;, and the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;Kimi API&lt;/a&gt;. At launch, Kimi K3 will use max thinking effort by default, with low- and high-effort modes to be introduced in subsequent updates. We are currently working closely with inference partners and open-source maintainers to align technical details and ensure a reliable rollout across the ecosystem. The full model weights will be released by July 27, 2026. Further details on the architecture, training, and evaluations will be released alongside the Kimi K3 technical report.&lt;/p&gt;
&lt;h2&gt;An Open 3T-Class Model&lt;/h2&gt;
&lt;p&gt;Kimi K3 is the first open model to reach 2.8 trillion parameters. It marks the latest step in Kimi&#39;s sustained push at the scaling frontier: for nine of the past twelve months, Kimi models have set the upper bound of open-model sizes.&lt;/p&gt;
&lt;p&gt;Kimi K3 is built on Kimi Delta Attention (KDA) and Attention Residuals (AttnRes), two architectural updates designed to improve how information flows across sequence length and model depth. We have also scaled up Mixture of Experts (MoE) sparsity, effectively activating 16 out of 896 experts when paired with a Stable LatentMoE framework. Together with refined training and data recipes, these structural changes yield an approximate 2.5× improvement in overall scaling efficiency compared to Kimi K2, allowing the model to convert compute into intelligence more effectively.&lt;/p&gt;
&lt;h2&gt;Coding&lt;/h2&gt;
&lt;p&gt;Kimi K3 has strong long-horizon coding performance. Operating with minimal human oversight, it can sustain long engineering sessions, navigate massive repositories, and orchestrate terminal tools.&lt;/p&gt;
&lt;p&gt;Kimi K3 also excels in tasks blending software engineering with visual reasoning — it leverages screenshots and visuals to optimize game dev, frontend, and CAD.&lt;/p&gt;
&lt;p&gt;The case studies below show how Kimi K3&#39;s coding capability translates into open-ended software creation and scientific research.&lt;/p&gt;
&lt;h3&gt;Kernel Optimization&lt;/h3&gt;
&lt;p&gt;We tested the models&#39; capability to optimize GPU kernels. Each model works independently in an identical sandbox, with up to 24 hours to profile, rewrite, and benchmark four tasks spanning AttnRes, KDA, and a 512-head-dimension MLA kernel across NVIDIA Hopper GPUs and GPGPU from an alternative vendor. Kimi K3 performed competitively with Fable 5 (with fallback) and substantially outperformed Opus 4.8, GPT 5.6 Sol, and GPT 5.5.&lt;/p&gt;
&lt;p&gt;Claude Fable 5 was evaluated by a third party, and its results may include fallback behavior. Across most models, some trajectories include small, acceptable precision shortcuts that remain within our numerical tolerance. GPGPU denotes general-purpose GPUs used for computation beyond graphics rendering.&lt;/p&gt;
&lt;p&gt;In the late stages of Kimi K3 development, an early version of Kimi K3 handled the majority of the team&#39;s kernel optimization works.&lt;/p&gt;
&lt;h3&gt;GPU Compiler Development&lt;/h3&gt;
&lt;p&gt;We further tested whether Kimi K3 could build a GPU programming system from scratch. Kimi K3 developed MiniTriton, a compact Triton-like compiler with its own tile-level IR layer over MLIR, optimization passes, and a PTX code-generation pipeline. Across supported roofline benchmarks, MiniTriton delivers performance on par with or better than Triton and torch.compile — beating Triton on certain workloads. Beyond microbenchmarks, MiniTriton sustains end-to-end nanoGPT training with stable convergence, the loss curve closely tracking the reference with only minor divergence — validating the full pipeline on a realistic workload. These results demonstrate that Kimi K3 can build a coherent end-to-end compiler — from DSL frontend and IR passes to PTX codegen and runtime — rather than isolated kernels; its from-scratch Tensor Core path already rivals Triton’s extensively optimized stack.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://www.kimi.com/landing-ui/assets/blog-assets/kimi-k3/roofline_cuda_core_light.svg&quot; alt=&quot;MiniTriton CUDA-core roofline on NVIDIA L20&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h3&gt;Game Dev and Digital Creation&lt;/h3&gt;
&lt;p&gt;Kimi K3 combines strong 3D reasoning, coding, and vision capabilities to turn concepts, images, and videos into fully playable interactive experiences. Kimi K3 achieves true &amp;quot;vision in the loop&amp;quot; by seamlessly iterating between code and live screenshots—instantly seeing and refining outputs.&lt;/p&gt;
&lt;h3&gt;Chip Design&lt;/h3&gt;
&lt;p&gt;As an early proof of concept, Kimi K3 designed a chip to serve a nano model built on its own architecture. In a single 48-hour autonomous run, K3 built, optimized, and verified the chip using open-source EDA tools on the Nangate 45nm library. Within 4 mm², the chip closes timing at 100 MHz and sustains over 8,700 tokens/s decode throughput in simulation, packing 1.46M standard cells, 0.277 MB of SRAM, and an INT4 MAC array with fused dequantization. A chip built by a model, for a model, reflects K3&#39;s long-horizon agentic capabilities.&lt;/p&gt;
&lt;h3&gt;Coding for Research&lt;/h3&gt;
&lt;p&gt;Kimi K3 bridges scientific literature and executable code, autonomously implementing, validating, and analyzing complex computational research workflows.&lt;/p&gt;
&lt;p&gt;In one case, Kimi K3 completed in about two hours what would typically require one to two weeks of work by an experienced researcher. To reproduce the I–Love–Q universal relations in computational astrophysics, it reviewed and cross-validated 20+ papers, implemented the full numerical pipeline, evaluated 300+ equations of state, identified inconsistencies in published formulas, generated 3,000+ lines of Python code, and produced an interactive HTML dashboard for exploring the results.&lt;/p&gt;
&lt;h2&gt;Knowledge Work&lt;/h2&gt;
&lt;p&gt;Kimi K3 advances end-to-end knowledge work. Beyond public benchmarks, Kimi K3 (max) demonstrates consistent gains across our internal evaluations, which are derived from recurring patterns and challenges observed in real-world user-agent workflows. These consistent advantages across distinct production-oriented workflows reflect a broad improvement in Kimi K3&#39;s agentic knowledge work capabilities.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-07-16/1d9cg76vf2ena6204uv80?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Internal Knowledge Work Bench&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h3&gt;Research with Interactive Visualization&lt;/h3&gt;
&lt;p&gt;Below are a few examples of what Kimi K3 in Kimi Work can produce across financial consulting and scientific research:&lt;/p&gt;
&lt;h3&gt;Case 1: Interactive 42 years of AI ASIC industry research website&lt;/h3&gt;
&lt;p&gt;An interactive research report you can drill into: 42 years of the ASIC industry, created through 120+ rounds of recursive self-improvement. Kimi K3 transforms evidence into bespoke charts, animated diagrams, and interactive visual narratives. It pulled data via 2.8k+ web searches/fetches and 1.1k+ terminal data pulls, across 11k+ pages spanning 87 quarterly reports and 99 original PDFs.&lt;/p&gt;
&lt;h3&gt;Case 2: Fusion Industry Research&lt;/h3&gt;
&lt;p&gt;A consulting-style industry report with interactive visualizations—including timelines, Funnel Chart, Range Bar Chart, Gantt Charts, and publication-quality slides.&lt;/p&gt;
&lt;h3&gt;Case 3: GWTC-5 Gravitational-wave Analysis&lt;/h3&gt;
&lt;p&gt;An analysis of 391 gravitational-wave events using 20+ concurrent subagents, producing 7 scientific visualizations, 2 tables, and a literature synthesis from 10+ papers.&lt;/p&gt;
&lt;p&gt;Kimi K3 is also particularly effective at producing infographic-style presentations, such as the fully editable heatmap and annual report shown below:&lt;/p&gt;
&lt;h3&gt;Widgets and Dashboard&lt;/h3&gt;
&lt;p&gt;In Kimi Work, we introduce two new features - Widgets and Dashboard - which make interactions with Kimi K3 more visual and persistent. Widgets let you generate interactive components directly within a chat, with connections to local data or external plugins for continuous updates. Dashboard brings the widgets you care about most into one persistent, personalized view organized around a topic, project, or goal.&lt;/p&gt;
&lt;h3&gt;Video Editing&lt;/h3&gt;
&lt;p&gt;Kimi K3 excels at motion design, animation, and video editing because its native multimodal architecture understands text, images, and video within the same model.&lt;/p&gt;
&lt;p&gt;In one example, K3 created a 3Blue1Brown-style motion-graphics explainer of its own architecture, translating technical ideas into animated diagrams and transitions.&lt;/p&gt;
&lt;p&gt;In another, Kimi K3 edited its own teaser video from 56 source clips, handling clip selection, motion-matched cuts, frame-accurate beat synchronization, audio processing, and multiple rounds of revision. A high-density short video like this would typically take an experienced editor one to two working days, or a beginner three to five.&lt;/p&gt;
&lt;h3&gt;Architecture and Infrastructure&lt;/h3&gt;
&lt;p&gt;Kimi K3 is built on Kimi Delta Attention (KDA) and Attention Residuals (AttnRes). KDA provides an efficient foundation for scaling attention, while AttnRes selectively retrieves representations across depth rather than accumulating them uniformly. Together, they form the architectural backbone of a model designed to scale well beyond the trillion-parameter regime.&lt;/p&gt;
&lt;p&gt;Kimi K3 uses Stable LatentMoE, effectively activating 16 of 896 experts. At this level of sparsity, routing and optimization become first-order challenges. Quantile Balancing derives expert allocation directly from router-score quantiles, eliminating heuristic updates and a sensitive balancing hyperparameter, while Per-Head Muon extends Muon by optimizing attention heads independently for more adaptive learning at scale. Sigmoid Tanh Unit (SiTU) and Gated MLA improve activation control and attention selectivity respectively. Together, these advances enable stable and efficient training at the 2.8-trillion-parameter scale.&lt;/p&gt;
&lt;p&gt;Kimi K3 applies quantization-aware training from the SFT stage onward, using MXFP4 weights with MXFP8 activations for broad hardware compatibility. To prevent expert imbalance from degrading throughput at large expert-parallel scales, we introduce a fully balanced expert-parallel training method with static shapes and no host synchronization on the critical path. Since inference efficiency likewise benefits from larger high-bandwidth communication domains, we recommend deploying Kimi K3 on supernode configurations with 64 or more accelerators. Finally, as KDA poses new challenges for conventional prefix caching, we have contributed a corresponding implementation to the vLLM community, to be released alongside the model. KDA with prefill cache allows us to serve Kimi K3 at a highly competitive token price despite its scale and long context.&lt;/p&gt;
&lt;p&gt;More technical details will be available in our coming report.&lt;/p&gt;
&lt;h2&gt;Availability&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Kimi K3 Agents: Download or update to the latest Kimi app from your mobile app store, available on iOS, Android, and HarmonyOS, or visit &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;kimi.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Work with Kimi K3: Download the latest &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/products/kimi-work&quot;&gt;Kimi Work desktop app&lt;/a&gt;, version 3.1.0 or later, available for Windows and Apple silicon Macs.&lt;/li&gt;
&lt;li&gt;Code with Kimi K3: Run &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt; in your terminal and select Kimi K3 using the &lt;code&gt;/model&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;Build with the Kimi API: Visit the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;Kimi API Platform&lt;/a&gt; and select &lt;code&gt;kimi-k3&lt;/code&gt;. Pricing is $0.30/MTok for cache-hit input, $3.00/MTok for cache-miss input, and $15.00/MTok for output. Powered by Mooncake&#39;s disaggregated inference architecture, the official Kimi API achieves a cache hit rate above 90% in coding workloads.&lt;/li&gt;
&lt;li&gt;Bring Kimi to your organization: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/membership/pricing&quot;&gt;Kimi Enterprise&lt;/a&gt; provides enterprise-grade data privacy and member management, with complete separation between personal and organization accounts. Visit the pricing page and select “Get Kimi Enterprise” to subscribe for your team.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Full Benchmark Table&lt;/h3&gt;
&lt;h2&gt;Footnotes&lt;/h2&gt;
&lt;p&gt;All Kimi K3 results reported below are obtained with the reasoning effort set to &#39;max&#39;, setting temperature = 1.0 and top-p = 1.0. Depending on the benchmark, each model is evaluated under one of three agentic harnesses — Kimi Code, Claude Code, or Codex — as specified in the notes below.&lt;/p&gt;
&lt;h3&gt;Coding benchmarks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;DeepSWE.&lt;/strong&gt; Kimi K3 is evaluated with the Kimi Code harness. The GLM-5.2 score is taken from the GLM-5.2 release blog (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://z.ai/blog/glm-5.2&quot;&gt;https://z.ai/blog/glm-5.2&lt;/a&gt;); all remaining scores are from the official DeepSWE leaderboard (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://deepswe.datacurve.ai/&quot;&gt;https://deepswe.datacurve.ai/&lt;/a&gt;), under which Kimi K3 attains 67.3 with the mini-SWE-agent harness. We report the DeepSWE v1.1 tasks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Terminal-Bench 2.1.&lt;/strong&gt; Kimi K3 is evaluated with the Kimi Code harness. For all other models, we report the best score across harnesses: GLM-5.2 with Claude Code (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://z.ai/blog/glm-5.2&quot;&gt;https://z.ai/blog/glm-5.2&lt;/a&gt;); Claude Opus 4.8 and Claude Fable 5 with Terminus 2 (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://artificialanalysis.ai/evaluations/terminalbench-v2-1&quot;&gt;https://artificialanalysis.ai/evaluations/terminalbench-v2-1&lt;/a&gt;); GPT 5.5 and GPT 5.6 Sol with Codex (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/previewing-gpt-5-6-sol/&quot;&gt;https://openai.com/index/previewing-gpt-5-6-sol/&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Program Bench.&lt;/strong&gt; Kimi K3 is evaluated with the Kimi Code harness. The GLM-5.2 score is from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://z.ai/blog/glm-5.2&quot;&gt;https://z.ai/blog/glm-5.2&lt;/a&gt;; all other scores are from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.vals.ai/benchmarks/programbench&quot;&gt;https://www.vals.ai/benchmarks/programbench&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SWE Marathon.&lt;/strong&gt; Kimi K3, Claude Opus 4.8, and Claude Fable 5 are evaluated with the Claude Code harness; GPT-5.6 Sol is evaluated with the Codex harness. The GLM-5.2 score is from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://z.ai/blog/glm-5.2&quot;&gt;https://z.ai/blog/glm-5.2&lt;/a&gt;. Our evaluation is based on an H20-calibrated branch of the official v1.1 tasks (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.swe-marathon.org/&quot;&gt;https://www.swe-marathon.org/&lt;/a&gt;): the Docker images, performance gates, and reference oracles for the GPU tasks have been recalibrated for H20, while the correctness and anti-cheat validators remain unchanged. Additionally, Claude Fable 5 hit fallbacks on 35% of the tasks in our evaluation, which may have negatively impacted its measured performance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FrontierSWE.&lt;/strong&gt; Kimi K3 is evaluated with the Kimi Code harness and GPT-5.6 Sol with the Codex harness; all other results are from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.frontierswe.com/&quot;&gt;https://www.frontierswe.com/&lt;/a&gt;. Dominance scores are recomputed from the raw scores using the official evaluation script and are current as of July 16, 2026.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PostTrain Bench.&lt;/strong&gt; Scores for GLM-5.2, GPT-5.5, and Claude Opus 4.8 are adopted from the official PostTrainBench (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://posttrainbench.com/&quot;&gt;https://posttrainbench.com/&lt;/a&gt;) results. Kimi K3, Claude Fable 5, and GPT-5.6 Sol are evaluated with the official Harbor implementation at maximum reasoning effort, averaged over three runs on H20 GPU (instead of H100 in the official setting) — Kimi K3 and Claude Fable 5 with the Claude Code harness, and GPT-5.6 Sol with the Codex harness.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MLS Bench Lite.&lt;/strong&gt; Kimi K3 is evaluated with the Kimi Code harness; GLM-5.2 and the Claude models with the Claude Code harness; GPT-5.5 and GPT-5.6 Sol with the Codex harness.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;KCB 2.0.&lt;/strong&gt; Kimi K3 is evaluated with both the Kimi Code and Claude Code harnesses; GLM-5.2, Claude Opus 4.8, and Claude Fable 5 with the Claude Code harness; GPT-5.5 and GPT-5.6 Sol with the Codex harness. All models are evaluated at maximum reasoning effort, except GPT-5.5, which uses the &amp;quot;xhigh&amp;quot; setting. We also note that on this in-house benchmark, 10% of the tasks entered GPT-5.6 Sol&#39;s cyber guard.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Productivity and agentic benchmarks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;For OfficeQA Pro, each test case provides the agent with the entire PDF corpus, with all PDFs rendered as images and no machine-readable text available.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OfficeQA Pro and SpreadsheetBench 2.&lt;/strong&gt; Kimi K3, GLM-5.2, Claude Opus 4.8, and Claude Fable 5 are evaluated with the Claude Code harness; GPT 5.5 and GPT 5.6 Sol are evaluated with the Codex harness.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MCP Atlas.&lt;/strong&gt; All models are evaluated on the 500-task public subset with a 100-turn limit, using Gemini 3.1 Pro as the judge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AutomationBench.&lt;/strong&gt; All models are evaluated on the 600-task public subset, following the official GitHub setup in all other respects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BrowseComp.&lt;/strong&gt; We adopt the context-compaction strategy used in the Claude model cards, triggered at 300K tokens. When evaluated with a 1M-token context window and no context management, Kimi K3 achieves a score of 90.4. The results of Claude Fable 5, Claude Opus 4.8, GPT 5.6 Sol, and GPT 5.5 are cited from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.anthropic.com/news/claude-fable-5-mythos-5&quot;&gt;https://www.anthropic.com/news/claude-fable-5-mythos-5&lt;/a&gt; and &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/gpt-5-6/&quot;&gt;https://openai.com/index/gpt-5-6/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GDPval-AA, AA-Briefcase, and APEX-Agents&lt;/strong&gt; scores are cited from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://artificialanalysis.ai/&quot;&gt;https://artificialanalysis.ai/&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Multimodal benchmarks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Except for ZeroBench, which follows the official setting and is run five times, all multimodal scores are averaged over three runs. MMMU-Pro is evaluated following the official protocol, preserving the original input order and prepending images to the text input.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PerceptionBench.&lt;/strong&gt; PerceptionBench (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/blog/perception-bench&quot;&gt;https://www.kimi.com/blog/perception-bench&lt;/a&gt;) is a benchmark that focuses on atomic visual perception capabilities.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Sensitivity to thinking history.&lt;/strong&gt; K3 was trained in the preserved thinking history mode. If the agent harness fails to pass back all the historical thinking content as required, or if an ongoing session with another model is switched over to K3, generation quality may become highly unstable. We recommend using a harness with verified compatibility, such as Kimi Code, and avoiding switching to K3 in the middle of a session.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Excessive proactiveness.&lt;/strong&gt; K3&#39;s training places particular emphasis on long-horizon, challenging tasks. As a result, when it encounters minor issues or ambiguous user intent during task execution, it may make unexpected decisions on the user&#39;s behalf. If your application requires the agent to operate within well-defined boundaries and refrain from excessive improvisation, please impose more explicit behavioral constraints on K3 in the system prompt or in &lt;code&gt;AGENTS.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Despite being a highly competitive model overall, K3 nonetheless exhibits a noticeable gap in user experience compared with Claude Fable 5 and GPT 5.6 Sol.&lt;/li&gt;
&lt;/ol&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:0bd697562cf584dc37c6e1cbfa2a2c4dc3de314f</id>
    <title type="text">Kimi K2.6</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-04-20-kimi-k2-6/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-k2-6"/>
    <published>2026-04-20T00:00:00+00:00</published>
    <updated>2026-04-20T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-04-20</summary>
    <content type="html">&lt;p&gt;We are open sourcing our latest model, &lt;strong&gt;Kimi K2.6&lt;/strong&gt;, featuring &lt;strong&gt;state-of-the-art coding, long-horizon execution, and agent swarm capabilities&lt;/strong&gt;. Kimi K2.6 is now available via &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;Kimi.com&lt;/a&gt;, the Kimi App, the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;API&lt;/a&gt;, and &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Long-Horizon Coding&lt;/h2&gt;
&lt;p&gt;Kimi K2.6 shows strong improvements in long-horizon coding tasks, with reliable generalization across programming languages (e.g., Rust, Go, and Python) and tasks (e.g., front-end, devops, and performance optimization). On &lt;strong&gt;Kimi Code Bench&lt;/strong&gt;, our internal coding benchmark covering diverse complicated end-to-end tasks, Kimi K2.6 demonstrates significant improvements over Kimi K2.5.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j305qav1fc641b5670?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Kimi Code Bench&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Kimi K2.6 demonstrates strong long-horizon coding in complex engineering tasks:&lt;/p&gt;
&lt;p&gt;Kimi K2.6 successfully downloaded and deployed the &lt;strong&gt;Qwen3.5-0.8B&lt;/strong&gt; model locally on a Mac. By implementing and optimizing model inference in &lt;strong&gt;Zig&lt;/strong&gt;—a highly niche programming language—it demonstrated exceptional out-of-distribution generalization. Across &lt;strong&gt;4,000+ tool calls, over 12 hours of continuous execution, and 14 iterations&lt;/strong&gt;, Kimi K2.6 dramatically improved throughput from ~15 to &lt;strong&gt;~193 tokens/sec&lt;/strong&gt;, ultimately achieving speeds ~20% faster than LM Studio.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j1727f2ena623likig?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;K2.6 Qwen3.5-0.8B Mac inference optimization case&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Kimi K2.6 autonomously overhauled &lt;strong&gt;exchange-core&lt;/strong&gt;, an 8-year-old open-source financial matching engine. Over a &lt;strong&gt;13-hour execution&lt;/strong&gt;, the model iterated through 12 optimization strategies, initiating over 1,000 tool calls to precisely modify more than 4,000 lines of code. Acting as an expert systems architect, Kimi K2.6 analyzed CPU and allocation flame graphs to pinpoint hidden bottlenecks and boldly reconfigured the core thread topology (from 4ME+2RE to 2ME+1RE). Despite the engine already operating near its performance limits, Kimi K2.6 extracted a &lt;strong&gt;185% medium throughput leap&lt;/strong&gt; (from 0.43 to 1.24 MT/s) and a &lt;strong&gt;133% performance throughput gain&lt;/strong&gt; (soaring from 1.23 to 2.86 MT/s).&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j16siav1fc641arbr0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;K2.6 exchange-core coding showcase&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;In beta tests, K2.6 performs well on long-horizon coding tasks in enterprise evaluations (randomly ordered):&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.anything.com/&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-21/1d7jmpvt3v89kkei7cvlg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;anything.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In a no-code environment, AI has to handle every edge case. There&#39;s no developer to step in when something doesn&#39;t work as expected. &lt;strong&gt;K2.6 is noticeably more effective than K2.5 at navigating nuanced API behaviors and recovering when things break, and it runs longer-horizon tasks before hitting a wall.&lt;/strong&gt; We&#39;ve seen a real improvement in getting users from idea to deployment compared to K2.5.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.augmentcode.com/&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-21/1d7jmq2d3v89kkei7cvng?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;augmentcode.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What impressed us most about K2.6 is its surgical precision in large codebases.&lt;/strong&gt; When an initial path is blocked, it is strong at pivoting intelligently: following existing architectural patterns, finding hidden related changes, and keeping fixes scoped to the real problem. That kind of focused adaptability helps Augment Code reduce wasted cycles and deliver faster, more cost-effective agentic coding for enterprise-scale engineering work.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.baseten.co/&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivhb7f2ena623lavfg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;baseten.co logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kimi K2.6&#39;s evolution is impressive.&lt;/strong&gt; It excels on coding tasks at a level comparable to leading closed source models, and offers strong tool calling quality due to its deep understanding of third party frameworks. Kimi K2.6&#39;s excellent reliability makes it a great choice for complex and long-horizon engineering tasks.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.blackbox.ai/&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivhgd3v89kkei57atg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;blackbox.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kimi K2.6 sets a new level for open-sourced models, especially in long-horizon, agent-style coding workflows.&lt;/strong&gt; It handles complex, multi-step tasks with stronger instruction following and consistently high code quality. We&#39;ve seen it sustain extended coding sessions with remarkable stability, far beyond typical models. It also surfaces deep, non-obvious bugs that would normally take significant developer time to uncover. Overall, K2.6 sets a new bar for reliable coding.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.codebuddy.com/&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j2dbnf2ena623lpflg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;codebuddy.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kimi K2.6 demonstrates significant improvements over K2.5 in internal evaluations conducted by CodeBuddy: code generation accuracy increased by 12%, long-context stability improved by 18%, and tool invocation success rate reached 96.60%.&lt;/strong&gt; Its stronger reasoning capabilities and more consistent output quality provide robust support for ensuring a reliable user experience in CodeBuddy WorkBuddy.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://factory.com&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivhn6dcmosb3v7vag0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;factory.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;K2.6 is a clear improvement on K2.5 on both our benchmarks (+15%) and in side-by-side comparisons.&lt;/strong&gt; It seems to have better instruction following, more thorough exploration and reasoning, and less likely to make coding errors or use hacks.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://fireworks.ai&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivhqudcmosb3v7vb20?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;fireworks.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We are thrilled to see another leap in open source models with Kimi K2.6 release, which marks a significant advancement for high-stakes, agentic workflows. &lt;strong&gt;The most impactful improvements lie in its long-horizon reliability and instruction following.&lt;/strong&gt; K2.6 excels at maintaining architectural integrity over extended coding sessions, making it a stable foundation for autonomous agent pipelines, like all the &amp;quot;claws&amp;quot;. It demonstrates a measurable leap over K2.5 in long-context tasks, achieving state-of-the-art performance in complex reasoning.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://hermes-agent.nousresearch.com&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j00ol3v89kkei58q40?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;hermes-agent.nousresearch.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Got an early look at K2.6 and ran it through Hermes Agent. &lt;strong&gt;Tool calling and agentic loops feel noticeably tighter, coding is a clear step up, and the creative range surprised us.&lt;/strong&gt; We&#39;re super excited about running a hackathon with Kimi on creativity. Kimi team continues to beat expectations!&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://kilo.ai&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivi2d3v89kkei57ce0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;kilo.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;K2.6 offers SOTA-level performance at a fraction of the cost.&lt;/strong&gt; It&#39;s tremendously good at long-context tasks across the codebase, as well as the day-to-day work needed to support an always-on agent like KiloClaw.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://ollama.com&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivi5l3v89kkei57d2g?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;ollama.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kimi K2.6 raises the bar for open-source models.&lt;/strong&gt; It excels in coding and especially for agentic tools like OpenClaw and Hermes. In early testing, it sustains long multi-step sessions with impressive stability. It will work all of Ollama&#39;s integrations out of the box, and we&#39;re excited to see what developers build with it.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://opencode.ai&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivi8qav1fc641ajj60?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;opencode.ai logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Within OpenCode, Kimi K2.6 proves to be exceptionally reliable.&lt;/strong&gt; Its approach to task decomposition and tool calling is both steady and consistent. With a sharper grasp of task requirements and more streamlined multi-step operations, it effectively minimizes repetitive overhead, resulting in a smoother, more trustworthy end-to-end experience.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://qoder.com&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ivibnf2ena623lb2mg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;qoder.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kimi K2.6 delivered a strong performance in Qoder&#39;s internal evaluations, showing significant progress over K2.5.&lt;/strong&gt; Specifically, there has been a notable increase in the frequency of tool calling and model invocations, reflecting a substantial boost in the model&#39;s proactivity and intelligence during task execution. This heightened initiative in tool calling enables the model to more actively grasp developer intent and automatically complete context, thereby minimizing user interruptions and wait times.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://vercel.com&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7ividpl51jas5fc28h0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;vercel.com logo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;K2.6 shows major gains over K2.5 on the capabilities our developers care about most: we&#39;re seeing more than 50% improvement on our Next.js benchmark, putting it among the top-performing models on the platform. Combined with its cost-performance ratio, it&#39;s a compelling option for agentic coding and front-end generation through AI Gateway. We&#39;re excited to offer it to our developer community.&lt;/p&gt;
&lt;p&gt;01 / 07&lt;/p&gt;
&lt;h2&gt;Coding-Driven Design&lt;/h2&gt;
&lt;p&gt;Based on the strong coding capabilities, Kimi K2.6 can turn simple prompts into complete front-end interfaces, generating structured layouts with deliberate design choices such as aesthetic hero sections, as well as interactive elements and rich animations, including scroll-triggered effects. With strong proficiency in leveraging image and video generation tools, Kimi K2.6 supports the generation of visually coherent assets and contributes to higher-quality, more salient hero sections.&lt;/p&gt;
&lt;p&gt;Moreover, Kimi K2.6 expands beyond static frontend development to simple full-stack workflows—spanning authentication to user interaction to database operations for lightweight use cases like transaction logging or session management.&lt;/p&gt;
&lt;p&gt;We established an internal &lt;strong&gt;Kimi Design Bench&lt;/strong&gt;, organized into four categories: Visual Input Tasks, Landing Page Construction, Full-Stack Application Development, and General Creative Programming. In comparison with Google AI Studio, Kimi K2.6 shows promising results and performs well across these categories.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j30aiav1fc641b5710?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Kimi Design Bench&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Below are examples generated by &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/build&quot;&gt;K2.6 Agent&lt;/a&gt; from a single prompt, with preconfigured harnesses and tools:&lt;/p&gt;
&lt;h2&gt;Agent Swarms, Elevated&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Scaling out, not just up.&lt;/strong&gt; An Agent Swarm dynamically decomposes tasks into heterogeneous subtasks executed concurrently by self-created domain-specialized agents.&lt;/p&gt;
&lt;p&gt;Based on the K2.5 Agent Swarm research preview, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent-swarm&quot;&gt;Kimi K2.6 Agent Swarm&lt;/a&gt; demonstrates &lt;strong&gt;a qualitative leap&lt;/strong&gt; in the agent swarm experience. It seamlessly coordinates heterogeneous agents to combine complementary skills: broad search layered with deep research, large-scale document analysis fused with long-form writing, and multi-format content generation executed in parallel. This compositional intelligence enables the swarm to deliver end-to-end outputs—spanning documents, websites, slides, and spreadsheets—within a single autonomous run.&lt;/p&gt;
&lt;p&gt;The architecture scales horizontally to &lt;strong&gt;300 sub-agents executing across 4,000 coordinated steps simultaneously&lt;/strong&gt;, a substantial expansion from K2.5&#39;s 100 sub-agents and 1,500 steps. This massive parallelization fundamentally reduces end-to-end latency while significantly enhancing output quality and expanding the operational boundaries of Agents swarms.&lt;/p&gt;
&lt;p&gt;It can also turn any high-quality files such as PDFs, spreadsheets, slides, and Word documents into &lt;strong&gt;Skills&lt;/strong&gt;. Kimi K2.6 captures and maintains the documents&#39; structural and stylistic DNA, enabling you to reproduce the same quality and format in future tasks.&lt;/p&gt;
&lt;p&gt;Here are some examples:&lt;/p&gt;
&lt;h2&gt;Proactive Agents&lt;/h2&gt;
&lt;p&gt;K2.6 demonstrates strong performance in autonomous, proactive agents such as &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openclaw.ai/&quot;&gt;OpenClaw&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://hermes-agent.nousresearch.com/&quot;&gt;Hermes&lt;/a&gt;&lt;/strong&gt;, which operate across multiple applications with continuous, 24/7 execution.&lt;/p&gt;
&lt;p&gt;Unlike simple chat-based interactions, these workflows require AI to proactively manage schedules, execute code, and orchestrate cross-platform operations as a persistent background agent.&lt;/p&gt;
&lt;p&gt;Our RL infra team used a K2.6-backed agent that operated autonomously for &lt;strong&gt;5 days&lt;/strong&gt;, managing monitoring, incident response, and system operations, demonstrating persistent context, multi-threaded task handling, and full-cycle execution from alert to resolution. Here is K2.6&#39;s worklog (anonymized to remove sensitive information):&lt;/p&gt;
&lt;p&gt;Kimi K2.6 delivers measurable improvements in real-world reliability: more precise API interpretation, stabler long-running performance, and enhanced safety awareness during extended research tasks.&lt;/p&gt;
&lt;p&gt;Performance gains are quantified by our internal &lt;strong&gt;Claw Bench&lt;/strong&gt;, the evaluation suite spanning five domains: Coding Tasks, IM Ecosystem Integration, Information Research &amp;amp; Analysis, Scheduled Task Management, and Memory Utilization. Across all metrics, Kimi K2.6 significantly outperforms Kimi K2.5 in task completion rates and tool invocation accuracy—particularly in workflows requiring sustained autonomous operation without human oversight.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-04-20/1d7j2vv53v89kkei5on5g?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Kimi Claw Bench&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h2&gt;Bring Your Own Agents&lt;/h2&gt;
&lt;p&gt;Building upon Kimi K2.6&#39;s robust orchestration capabilities, Kimi K2.6 extends your proactive agents to &lt;strong&gt;Claw Groups&lt;/strong&gt; as a research preview—a new instantiation of the Agent Swarm architecture.&lt;/p&gt;
&lt;p&gt;Claw Groups embrace an open, heterogeneous ecosystem: Multiple agents and humans operate as true collaborators. Users can onboard agents from any device, running any model, each carrying their own specialized toolkits, skills and persistent memory contexts. Whether deployed on local laptops, mobile devices, or cloud instances, these diverse agents integrate seamlessly into a shared operational space.&lt;/p&gt;
&lt;p&gt;At the center of this swarm, Kimi K2.6 serves as an adaptive coordinator. It dynamically matches tasks to agents based on their specific skill profiles and available tools, optimizing for capability fit. When an agent encounters failure or stalls, the coordinator detects the interruption, automatically reassigns the task or regenerates subtasks, and actively manages the full lifecycle of deliverables—from initiation through validation to completion.&lt;/p&gt;
&lt;p&gt;We also want to thank the K2.6-powered agents in Claw Groups—we&#39;ve been dogfooding our own agent marketing team by refining human–agent workflows in practice. Using Claw Groups, we run end-to-end content production and launch campaigns, with specialized agents like Demo Makers, Benchmark Makers, Social Media Agents, and Video Makers working together. K2.6 coordinates the process, enabling agents to share intermediate results and turn ideas into consistent, fully packaged deliverables.&lt;/p&gt;
&lt;p&gt;We are moving beyond simply asking AI a question or assigning AI a task, and entering a phase where human and AI collaborate as genuine partners—combining strengths to solve problems collectively. Claw Groups marks our latest efforts toward a future where the boundaries between &amp;quot;my agent,&amp;quot; &amp;quot;your agent,&amp;quot; and &amp;quot;our team&amp;quot; dissolve seamlessly into a collaborative system.&lt;/p&gt;
&lt;h2&gt;Benchmark Table&lt;/h2&gt;
&lt;p&gt;To reproduce official Kimi-K2.6 benchmark results, we recommend using the official API. For third-party providers, refer to Kimi Vendor Verifier (KVV) to choose high-accuracy services. Details: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/blog/kimi-vendor-verifier&quot;&gt;https://www.kimi.com/blog/kimi-vendor-verifier&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Footnotes&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. General Testing Details&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We report results for Kimi K2.6 and Kimi K2.5 with thinking mode enabled, Claude Opus 4.6 with max effort, GPT-5.4 with xhigh reasoning effort, and Gemini 3.1 Pro with a high thinking level.&lt;/li&gt;
&lt;li&gt;Unless otherwise specified, all Kimi K2.6 experiments were conducted with temperature = 1.0, top-p = 1.0, and a context length of 262,144 tokens.&lt;/li&gt;
&lt;li&gt;Benchmarks without publicly available scores were re-evaluated under the same conditions used for Kimi K2.6 and are marked with an asterisk (*). Except where noted with an asterisk, all other results are cited from official reports.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;2. Reasoning Benchmarks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IMO-AnswerBench scores for GPT-5.4 and Claude 4.6 were obtained from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://z.ai/blog/glm-5.1&quot;&gt;https://z.ai/blog/glm-5.1&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Humanity&#39;s Last Exam (HLE) and other reasoning tasks were evaluated with a maximum generation length of 98,304 tokens. By default, we report results on the HLE full set. For the text-only subset, Kimi K2.6 achieves 36.4% accuracy without tools and 55.5% with tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;3. Tool-Augmented / Agentic Tasks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kimi K2.6 was equipped with search, code-interpreter, and web-browsing tools for HLE with tools, BrowseComp, DeepSearchQA, and WideSearch.&lt;/li&gt;
&lt;li&gt;For HLE-Full with tools, the maximum generation length is 262,144 tokens with a per-step limit of 49,152 tokens. We employ a simple context management strategy: once the context window exceeds the threshold, only the most recent round of tool-related messages is retained.&lt;/li&gt;
&lt;li&gt;For BrowseComp, we report scores obtained with context management using the same discard-all strategy as Kimi K2.5 and DeepSeek-V3.2.&lt;/li&gt;
&lt;li&gt;For DeepSearchQA, no context management was applied to Kimi K2.6 tests, and tasks exceeding the supported context length were directly counted as failed. Scores for Claude Opus 4.6, GPT-5.4, and Gemini 3.1 Pro on DeepSearchQA are cited from the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://cdn.sanity.io/files/4zrzovbb/website/037f06850df7fbe871e206dad004c3db5fd50340.pdf&quot;&gt;Claude Opus 4.7 System Card&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;For WideSearch, we report results under the &amp;quot;hide tool result&amp;quot; context management setting. Once the context window exceeds the threshold, only the most recent round of tool-related messages is retained.&lt;/li&gt;
&lt;li&gt;The test system prompts are identical to those used in the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/pdf/2602.02276&quot;&gt;Kimi K2.5 technical report&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Claw Eval was conducted using version 1.1 with max-tokens-per-step = 16384.&lt;/li&gt;
&lt;li&gt;For APEX-Agents, we evaluate 452 tasks from the public 480-task release, as done by &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://artificialanalysis.ai/evaluations/apex-agents-aa&quot;&gt;Artificial Analysis&lt;/a&gt; (excluding Investment Banking Worlds 244 and 246, which have external runtime dependencies).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;4. Coding Tasks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Terminal-Bench 2.0 scores were obtained with the default agent framework (Terminus-2) and the provided JSON parser, operating in preserve thinking mode.&lt;/li&gt;
&lt;li&gt;For the SWE-Bench series of evaluations (including Verified, Multilingual, and Pro), we used an in-house evaluation framework adapted from SWE-agent. This framework includes a minimal set of tools—bash tool, createfile tool, insert tool, view tool, strreplace tool, and submit tool.&lt;/li&gt;
&lt;li&gt;All reported scores for coding tasks are averaged over 10 independent runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;5. Vision Benchmarks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Max-tokens = 98,304, averaged over three runs (avg@3).&lt;/li&gt;
&lt;li&gt;Settings with Python tool use max-tokens-per-step = 65,536 and max-steps = 50 for multi-step reasoning.&lt;/li&gt;
&lt;li&gt;MMMU-Pro follows the official protocol, preserving input order and prepending images.&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:150f31e1016ee52a1bdf4e6285dfdbddb5825a01</id>
    <title type="text">Agent Swarm</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-02-09-agent-swarm/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/agent-swarm"/>
    <published>2026-02-09T00:00:00+00:00</published>
    <updated>2026-02-09T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-02-09</summary>
    <content type="html">&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-13/1d67gvgudcmosb3rlf92g?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Introducing Agent Swarm&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;In 2025, if you walked into any AI conference, you may hear the same gospel: faster inference, longer context windows, cheaper inference costs.&lt;/p&gt;
&lt;p&gt;It&#39;s as if we&#39;ve spent years perfecting the hammer, making it lighter, stronger, more precisely balanced, while never questioning the fact that the carpenter still has only two hands and twenty-four hours in a day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Now, Kimi introduces Agent Swarm.&lt;/strong&gt; It is not a better hammer. It is a reconstruction of the entire workshop.&lt;/p&gt;
&lt;p&gt;This is not the story of &amp;quot;many AI agents working together&amp;quot;. What we&#39;re building is an organizational structure with bosses, employees, and divisions of labor, except this organization isn&#39;t designed by humans. &lt;strong&gt;It designs itself.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When you tell Agent Swarm to research a topic, you aren&#39;t commanding an assistant. You are hiring a CEO, who helps find researchers, analysts, fact-checkers, all hired on the spot on its own. &lt;strong&gt;And you don&#39;t need to micromanage.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But to get there, we had to confront a question that we used to avoid:&lt;/p&gt;
&lt;h2&gt;The Limits of Single-Agent Reasoning&lt;/h2&gt;
&lt;p&gt;How far can we really push a model at test time?&lt;/p&gt;
&lt;p&gt;This question isn&#39;t really about intelligence. The real bottleneck in AI reasoning today is the single-agent, sequential execution model itself.&lt;/p&gt;
&lt;p&gt;Whether you&#39;re trying to extend the length of tasks a model can handle (what researchers call long-horizon tasks), or dynamically scaling compute and structure during inference (test-time scaling), the single-agent sequential execution model hits a wall.&lt;/p&gt;
&lt;p&gt;For example, ask a single-agent deep research tool to survey a hundred companies or synthesize dozens of papers. As the task goes on, the context window fills. The system falls back to simple history folding or summarization to make room for new tokens. This compression is lossy, and later reasoning degrades.&lt;/p&gt;
&lt;p&gt;It&#39;s not a bug, nor a temporary limitation. It&#39;s a structural ceiling imposed by context windows, time, and the constraints of relying on a single agent to manage long-horizon reasoning.&lt;/p&gt;
&lt;h2&gt;Scale Out, Not Just Up&lt;/h2&gt;
&lt;p&gt;For many years, the dominant narrative in AI has been scaling: bigger models, more parameters, better benchmark scores. This narrative has delivered remarkable results. But vertical scaling has a ceiling—physical, economic, and perhaps intellectual.&lt;/p&gt;
&lt;p&gt;Horizontal scaling is different. One brain versus many. A single model is one expert. A self-organizing network is a company, a laboratory, an intelligence agency.&lt;/p&gt;
&lt;p&gt;In June 2025, shortly after we launched Kimi Researcher, a member of our team — let&#39;s call her an &amp;quot;enthusiastic amateur stock trader&amp;quot;—had an idea that seemed simple enough: Could Kimi automatically gather daily information about stocks?&lt;/p&gt;
&lt;p&gt;She let Kimi check news for macro trends. Query historical limit-up counts. Drill deeper if conditions match. Synthesize. She wrote a Python workflow, a cascade of if-else statements.&lt;/p&gt;
&lt;p&gt;At line one hundred, she stopped. &lt;em&gt;&amp;quot;I&#39;m hand-coding a multi-agent system.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If models can use tools and handle long-horizon tasks, why can&#39;t they architect themselves? Decide when to parallelize, whom to hire, how to delegate?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The future isn&#39;t better single agents. It&#39;s agents that build organizations.&lt;/strong&gt; Agent Swarm was born from this hypothesis.&lt;/p&gt;
&lt;p&gt;The numbers tell part of the story. With Agent Swarm, Kimi K2.5 can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deploy up to &lt;strong&gt;100 sub-agents&lt;/strong&gt; working in parallel&lt;/li&gt;
&lt;li&gt;Execute over &lt;strong&gt;1,500 tool calls&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Deliver better results &lt;strong&gt;4.5x faster&lt;/strong&gt; than sequential execution&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Agent Swarm Best Practices&lt;/h2&gt;
&lt;p&gt;Obviously, Agent Swarm excels where work parallelizes: broad research, batch downloads, multi-file processing, multi-angle analysis, long-form writing.&lt;/p&gt;
&lt;p&gt;But the deeper benefit is structural, it creates &lt;strong&gt;the conditions for productive disagreement&lt;/strong&gt; — for independent agents to arrive at different conclusions, then force a reconciliation. &lt;strong&gt;It avoids groupthink structurally.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So in the following cases, we suggest you experience the magic of agent swarm.&lt;/p&gt;
&lt;h3&gt;Discovery at Scale&lt;/h3&gt;
&lt;p&gt;Start with the simplest case: finding &lt;strong&gt;a mountain of things&lt;/strong&gt; that are hard to find.&lt;/p&gt;
&lt;p&gt;Say you need the top 3 creators in 100 niche YouTube domains. K2.5 Agent Swarm first researches and defines each domain, then autonomously &lt;strong&gt;creates 100 sub-agents to conduct parallel searches.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Or you want to collect all 200+ Paul Graham essays, scattered across personal sites, old blogs, transcribed talks. K2.5 Agent Swarm can assign specialized sub-agents to search for, download, categorize, summarize, and compile Paul Graham&#39;s essays. They collectively organize over &lt;strong&gt;200 original essays&lt;/strong&gt; into &lt;strong&gt;6 topic-based folders&lt;/strong&gt; and produces a comprehensive summary report.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-09/1d64nsivf2ena627qcitg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;100 Sub-agents Hunting for Creators&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;100 Sub-agents Hunting for Creators: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.ai/share/19c40eea-b272-8ef2-8000-0000af5e0baa&quot;&gt;https://www.kimi.ai/share/19c40eea-b272-8ef2-8000-0000af5e0baa&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Output at Scale&lt;/h3&gt;
&lt;p&gt;Beyond gathering scattered information, you can task Agent Swarm with &lt;strong&gt;consuming massive document sets&lt;/strong&gt; and coordinating expert personas to &lt;strong&gt;produce book-length, professional-grade reports.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For example, let it generate a 100-page literature review from forty social psychology PDFs. K2.5 Agent Swarm decomposes the task across the document set, deploying multiple writing-focused sub-agents. Each claims responsibility for specific sections, and their outputs are synthesized into a &lt;strong&gt;100-page, two-column&lt;/strong&gt; academic document with fully formatted citations and references.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-09/1d64nuepl51jas5bh88fg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Generate 100-Page Literature Review from 40 PDFs&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Generate 100-Page Literature Review from 40 PDFs: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.ai/share/19c4106b-89b2-8361-8000-0000d07b8235&quot;&gt;https://www.kimi.ai/share/19c4106b-89b2-8361-8000-0000d07b8235&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Perspective at Scale&lt;/h3&gt;
&lt;p&gt;The most interesting use case is when you need the disagreement itself—when you want to see a problem through multiple perspectives at once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Facing a complex product launch?&lt;/strong&gt; Deploy a team of experts: the skeptical VC questions unit economics, the veteran PM worries about technical debt, the ethicist probes dark patterns, customer success lead champions edge cases.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-09/1d64nu0d3v89kkema91ag?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Get your product plan reviewed by a team of experts&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Get your product plan reviewed by a team of experts: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.ai/share/19c40bc9-31a2-8533-8000-0000bad59b7a&quot;&gt;https://www.kimi.ai/share/19c40bc9-31a2-8533-8000-0000bad59b7a&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Or explore different story directions.&lt;/strong&gt; You can have 20 writers from different literary styles to continue Liu Cixin&#39;s &lt;em&gt;The Three-Body Problem&lt;/em&gt;: from Virginia Woolf–style inner monologues to Borges-like idea mazes, Kafkaesque absurd worlds, and Gabriel García Márquez–style stories shaped by repeating fate.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-09/1d64nvf7f2ena627qcve0?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;Let 20 writers create alternative endings for The Three-Body Problem&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Let 20 writers create alternative endings for &lt;em&gt;The Three-Body Problem&lt;/em&gt;: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.ai/share/19c409c8-8692-821a-8000-0000070ad369&quot;&gt;https://www.kimi.ai/share/19c409c8-8692-821a-8000-0000070ad369&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Now Available to Top Tier Subscribers&lt;/h2&gt;
&lt;p&gt;You once had Kimi Agent as a single, diligent researcher. You now have Kimi Agent Swarm as a team of experts: specialized, parallel, capable of holding contradictory viewpoints simultaneously.&lt;/p&gt;
&lt;p&gt;This is an early research preview. We will continue to harden the architecture, introducing direct sub-agent communication, dynamic control of parallel width—but the foundation is ready for your most demanding work.&lt;/p&gt;
&lt;p&gt;In the AI age, literacy may be measured by how many tokens we use.&lt;/p&gt;
&lt;p&gt;So type your prompt, and let Kimi self-direct 100 sub-agents for you: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent-swarm&quot;&gt;https://www.kimi.com/agent-swarm&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:33b745363aba11a6ce0df8d9136343b4db87eb2b</id>
    <title type="text">WorldVQA</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-02-03-worldvqa/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/worldvqa"/>
    <published>2026-02-03T00:00:00+00:00</published>
    <updated>2026-02-03T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-02-03</summary>
    <content type="html">&lt;h2&gt;Introducing WorldVQA&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;A benchmark for evaluating atomic visual world knowledge in Multimodal LLMs.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Authors&lt;/strong&gt; Kimi Team&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-13/1d67h1af6rtp4tqfle8mg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1%2Fformat%2Cwebp%2Fresize%2Cw_1600&quot; alt=&quot;main figure&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;We are releasing &lt;strong&gt;WorldVQA&lt;/strong&gt;, a new benchmark designed to measure the factual correctness of Multimodal Large Language Models (MLLMs). While recent models have demonstrated impressive capabilities in visual reasoning and description, measuring their reliability regarding visual world knowledge remains a challenge.&lt;/p&gt;
&lt;p&gt;WorldVQA focuses on a critical question: &lt;strong&gt;Does the model actually recognize the specific entity it sees, or is it merely hallucinating based on visual patterns?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Our results show that WorldVQA creates a significant challenge for frontier models. Even state-of-the-art models struggle to achieve high accuracy on long-tail visual knowledge, often falling below 50% accuracy. This benchmark aims to drive progress toward more factually reliable and knowledgeable multimodal AI.&lt;/p&gt;
&lt;h2&gt;The Dataset&lt;/h2&gt;
&lt;p&gt;The dataset consists of &lt;strong&gt;3,500&lt;/strong&gt; high-quality image-question pairs. The distribution aims to test a model&#39;s encyclopedic breadth across the world. The dataset distinguishes itself through three core design principles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Factuality &amp;amp; Unambiguity:&lt;/strong&gt; Every question has a single, verifiable ground-truth answer. We exclude subjective questions or ambiguous visual scenarios.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rich Taxonomy:&lt;/strong&gt; The dataset spans 9 categories to ensure broad coverage of world knowledge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Head vs. Tail Distribution:&lt;/strong&gt; We explicitly separate data into &lt;strong&gt;Head&lt;/strong&gt; (common knowledge) and &lt;strong&gt;Tail&lt;/strong&gt; (rare/long-tail knowledge). This allows us to measure how model performance degrades as knowledge becomes more obscure.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note on Quality&lt;/strong&gt;: To ensure the benchmark is a reliable gold standard, all images and question-answer pairs underwent rigorous multi-stage human verification to filter out noise and ambiguity.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;h3&gt;Distribution of Tasks per Category&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Statistics&lt;/th&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;3500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chinese (CN)&lt;/td&gt;
&lt;td&gt;1260 (36%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;English (EN)&lt;/td&gt;
&lt;td&gt;2240 (64%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Category Categories&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total categories&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nature &amp;amp; Environment (Nature)&lt;/td&gt;
&lt;td&gt;9.31%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Locations &amp;amp; Architecture (Geography)&lt;/td&gt;
&lt;td&gt;14.63%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Culture, Arts &amp;amp; Crafts (Culture)&lt;/td&gt;
&lt;td&gt;14.46%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Objects &amp;amp; Products (Objects)&lt;/td&gt;
&lt;td&gt;12.49%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vehicles, Craft &amp;amp; Transportation (Transportation)&lt;/td&gt;
&lt;td&gt;8.74%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Entertainment, Media &amp;amp; Gaming (Entertainment)&lt;/td&gt;
&lt;td&gt;14.60%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Brands, Logos &amp;amp; Graphic Design (Brands)&lt;/td&gt;
&lt;td&gt;7.43%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sports, Gear &amp;amp; Venues (Sports)&lt;/td&gt;
&lt;td&gt;4.06%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Notable People &amp;amp; Public Figures (People)&lt;/td&gt;
&lt;td&gt;14.29%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Difficulty&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;31.16%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;40.77%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;28.07%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Using WorldVQA to compare models&lt;/h2&gt;
&lt;hr /&gt;
&lt;h2&gt;Measuring Calibration: Confidence vs. Accuracy&lt;/h2&gt;
&lt;p&gt;In our experiments comparing model confidence with actual accuracy, we utilized two key metrics to measure the alignment between a model&#39;s subjective belief and its objective performance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ECE (Expected Calibration Error):&lt;/strong&gt; Measures the average gap between the model&#39;s subjective confidence and its objective accuracy. The ideal value is &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Slope (Weighted Average Slope):&lt;/strong&gt; Measures the correlation and sensitivity between the model&#39;s accuracy and its own confidence. The ideal value is &lt;strong&gt;1.0&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-03/1d60v7i2av1fc64559d50?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;Reliability diagram showing model calibration - Actual Accuracy vs Stated Confidence&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/2/2026-02-03/1d60v81aav1fc64559ekg?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;Confidence score distribution across models on WorldVQA benchmark&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Calibration and Confidence Distribution Analysis. Left:&lt;/strong&gt; Reliability diagrams plotting Actual Accuracy against Stated Confidence. To ensure statistical significance, only bins containing more than 20 samples are visualized. The size of each data point is proportional to the number of samples in that bin. The black dashed diagonal (y=x) represents perfect calibration, while colored dashed lines indicate the weighted average slope for each model. &lt;strong&gt;Right:&lt;/strong&gt; The distribution of stated confidence scores across the full dataset (without sample thresholding). The plots reveal a severe overconfidence trend, with most models concentrating their predictions in the 90-100% confidence range.&lt;/p&gt;
&lt;p&gt;Our experiments reveal that all evaluated models are currently far from the ideal state, exhibiting a universal tendency toward overconfidence.&lt;/p&gt;
&lt;p&gt;While &lt;strong&gt;Kimi-K2.5&lt;/strong&gt; achieves best performance on both metrics—recording an ECE of &lt;strong&gt;37.9%&lt;/strong&gt; and a Slope of &lt;strong&gt;0.550&lt;/strong&gt;—there remains a significant gap to bridge in the pursuit of &amp;quot;honesty&amp;quot; and &amp;quot;alignment.&amp;quot; Enhancing the self-awareness boundaries of multimodal models represents a critical direction for future exploration.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;WorldVQA is a simple but challenging benchmark for evaluating the atomic visual knowledge of frontier models. Improving performance on WorldVQA is a necessary step for the next generation of AI agents. We are open-sourcing the WorldVQA dataset and evaluation scripts to help the community address the visual knowledge gap.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Read the Paper:&lt;/strong&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2602.02537&quot;&gt;https://arxiv.org/abs/2602.02537&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View the Code:&lt;/strong&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/WorldVQA&quot;&gt;https://github.com/MoonshotAI/WorldVQA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Download the Data:&lt;/strong&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/datasets/moonshotai/WorldVQA&quot;&gt;https://huggingface.co/datasets/moonshotai/WorldVQA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:ccae97a43a3f79474299b0280d4457c175776fde</id>
    <title type="text">Kimi K2.5</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-01-27-kimi-k2-5/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-k2-5"/>
    <published>2026-01-27T00:00:00+00:00</published>
    <updated>2026-01-27T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-01-27</summary>
    <content type="html">&lt;p&gt;Today, we are introducing Kimi K2.5, the most powerful open-source model to date.&lt;/p&gt;
&lt;p&gt;Kimi K2.5 builds on Kimi K2 with continued pretraining over approximately 15T mixed visual and text tokens. Built as a native multimodal model, K2.5 delivers state-of-the-art &lt;strong&gt;coding and vision&lt;/strong&gt; capabilities and a self-directed &lt;strong&gt;agent swarm&lt;/strong&gt; paradigm.&lt;/p&gt;
&lt;p&gt;For complex tasks, Kimi K2.5 can self-direct an &lt;strong&gt;agent swarm&lt;/strong&gt; with up to 100 sub-agents, executing parallel workflows across up to &lt;strong&gt;1,500&lt;/strong&gt; &lt;strong&gt;tool calls&lt;/strong&gt;. Compared with a single-agent setup, this reduces execution time by up to &lt;strong&gt;4.5x&lt;/strong&gt;. The agent swarm is automatically created and orchestrated by Kimi K2.5 without any predefined subagents or workflow.&lt;/p&gt;
&lt;p&gt;Kimi K2.5 is available via &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;Kimi.com&lt;/a&gt;, the Kimi App, the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;API&lt;/a&gt;, and &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;&lt;/strong&gt;. Kimi.com &amp;amp; Kimi App now supports 4 modes: K2.5 Instant, K2.5 Thinking, K2.5 Agent, and K2.5 Agent Swarm (Beta). Agent Swarm is currently in beta on Kimi.com, with free credits available for high-tier paid users.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/token_cost.png&quot; alt=&quot;&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Across three agentic benchmarks—HLE, BrowseComp, and SWE-Verified—Kimi K2.5 delivers strong performance at a fraction of the cost.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;1. Coding with Vision&lt;/h2&gt;
&lt;p&gt;Kimi K2.5 is the strongest open-source model to date for coding, with particularly strong capabilities in front-end development.&lt;/p&gt;
&lt;p&gt;K2.5 can turn simple conversations into complete front-end interfaces, implementing &lt;strong&gt;interactive layouts&lt;/strong&gt; and &lt;strong&gt;rich animations such as scroll-triggered effects&lt;/strong&gt;. Below are examples generated by K2.5 from a single prompt with image-gen tool:&lt;/p&gt;
&lt;p&gt;Beyond text prompts, K2.5 excels at &lt;strong&gt;coding with vision&lt;/strong&gt;. By reasoning over images and video, K2.5 improves image/video-to-code generation and visual debugging, lowering the barrier for users to express intent visually.&lt;/p&gt;
&lt;p&gt;Here is an example of K2.5 reconstructing a website from video:&lt;/p&gt;
&lt;p&gt;This capability stems from massive-scale vision-text joint pre-training. At scale, the trade-off between vision and text capabilities disappears — they improve in unison.&lt;/p&gt;
&lt;p&gt;Below is an example of K2.5 reasoning over a puzzle and marking the shortest path using code:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;K2.5 excels in real-world software engineering tasks.&lt;/strong&gt; We evaluate it using &lt;strong&gt;Kimi Code Bench&lt;/strong&gt;, our &lt;strong&gt;internal coding benchmark&lt;/strong&gt; covering diverse end-to-end tasks — from building to debugging, refactoring, testing, and scripting — across multiple programming languages. On this benchmark, &lt;strong&gt;K2.5 shows consistent and meaningful improvements over&lt;/strong&gt; &lt;strong&gt;K2&lt;/strong&gt; &lt;strong&gt;across task types&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/img_v3_02ub_47858019-34ce-4e34-ae76-f7165f95b91g.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;To try out K2.5&#39;s agentic coding capabilities, &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent&quot;&gt;K2.5 Agent&lt;/a&gt;&lt;/strong&gt; offers a set of preconfigured tools for immediate, hands-on experiences. For software engineering use cases, we recommend pairing Kimi K2.5 with our new coding product, &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;&lt;/strong&gt; works in your terminal and can be integrated with various IDEs including VSCode, Cursor, Zed, etc. Kimi Code is open-sourced and supports images and videos as inputs. It also automatically discovers and migrates existing skills and MCPs into your working environment in Kimi Code.&lt;/p&gt;
&lt;p&gt;Here&#39;s an example using &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/code/en&quot;&gt;Kimi Code&lt;/a&gt;&lt;/strong&gt; to translate the aesthetic of &lt;em&gt;Matisse&#39;s La Danse&lt;/em&gt; into the Kimi App. This demo highlights a breakthrough in &lt;strong&gt;autonomous visual debugging&lt;/strong&gt;. Using visual inputs and documentation lookup, K2.5 visually inspects its own output and iterates on it autonomously. It creates an art-inspired webpage created end to end:&lt;/p&gt;
&lt;h2&gt;2. Agent Swarm&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Scaling Out, Not Just Up.&lt;/strong&gt; We release &lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent-swarm&quot;&gt;K2.5 Agent Swarm&lt;/a&gt;&lt;/strong&gt; as a research preview, marking a shift from single-agent scaling to self-directed, coordinated swarm-like execution.&lt;/p&gt;
&lt;p&gt;Trained with Parallel-Agent Reinforcement Learning (PARL), K2.5 learns to self-direct an &lt;strong&gt;agent swarm&lt;/strong&gt; of up to &lt;strong&gt;100 sub-agents&lt;/strong&gt;, executing parallel workflows across &lt;strong&gt;up to 1,500 coordinated steps,&lt;/strong&gt; without predefined roles or hand-crafted workflows.&lt;/p&gt;
&lt;p&gt;PARL uses a &lt;em&gt;&lt;strong&gt;trainable orchestrator agent&lt;/strong&gt;&lt;/em&gt; to decompose tasks into parallelizable subtasks, each executed by dynamically instantiated, &lt;em&gt;&lt;strong&gt;frozen subagents&lt;/strong&gt;&lt;/em&gt;. Running these subtasks concurrently significantly reduces end-to-end latency compared to sequential agent execution.&lt;/p&gt;
&lt;p&gt;Training a reliable parallel orchestrator is challenging due to delayed, sparse, and non-stationary feedback from independently running subagents. A common failure mode is &lt;strong&gt;serial collapse&lt;/strong&gt;, where the orchestrator defaults to single-agent execution despite having parallel capacity. To address this, PARL employs &lt;em&gt;staged reward shaping&lt;/em&gt; that encourages parallelism early in training and gradually shifts focus toward task success.&lt;/p&gt;
&lt;p&gt;We define the reward as&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;math math-display&quot;&gt;r_{\mathrm{PARL}}(x, y) = \lambda_1 \cdot \mkern-26mu \underbrace{r_{\text{parallel}}}_{\text{instantiation reward}} \mkern-9mu + \mkern18mu\lambda_2 \cdot \mkern-32mu\underbrace{r_{\text{finish}}}_{\text{sub-agent finish rate}} +
\underbrace{r_{\text{perf}}(x, y)}_{\text{task-level outcome}}
, .&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The performance reward &lt;span class=&quot;math&quot;&gt;r_(perf)&lt;/span&gt; evaluates the overall success and quality of the solution &lt;span class=&quot;math&quot;&gt;y&lt;/span&gt; for a given task &lt;span class=&quot;math&quot;&gt;x&lt;/span&gt;. This is augmented by two auxiliary rewards, each addressing a distinct challenge in learning parallel orchestration. The reward &lt;span class=&quot;math&quot;&gt;rₚₐᵣₐₗₗₑₗ&lt;/span&gt; is introduced to mitigate &lt;em&gt;serial collapse&lt;/em&gt;—a local optimum where the orchestrator defaults to single-agent execution. By incentivizing subagent instantiation, this term encourages the exploration of concurrent scheduling spaces. The &lt;span class=&quot;math&quot;&gt;r_(finish)&lt;/span&gt; reward focuses on the successful completion of assigned subtasks. It is used to prevent &lt;em&gt;spurious parallelism&lt;/em&gt;, a reward-hacking behavior in which the orchestrator increases parallel metrics dramatically by spawning many subagents without meaningful task decomposition. By rewarding completed subtasks, &lt;span class=&quot;math&quot;&gt;r_(finish)&lt;/span&gt; enforces feasibility and guides the policy toward valid and effective decompositions. The hyperparameters &lt;span class=&quot;math&quot;&gt;λ₁&lt;/span&gt; and &lt;span class=&quot;math&quot;&gt;λ₂&lt;/span&gt; are annealed to zero over the course of training.&lt;/p&gt;
&lt;p&gt;To further force parallel strategies to emerge, we introduce a computational bottleneck that makes sequential execution impractical. Instead of counting total steps, we evaluate performance using &lt;strong&gt;Critical Steps&lt;/strong&gt;, a latency-oriented metric inspired by the critical path in parallel computation:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math&quot;&gt;CriticalSteps = ∑ₜ₌₁ᵀ ( Sₘₐᵢₙ⁽ᵗ⁾ + maxᵢ S_(sub,i)⁽ᵗ⁾ )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math&quot;&gt;Sₘₐᵢₙ⁽ᵗ⁾&lt;/span&gt;captures orchestration overhead, while &lt;span class=&quot;math&quot;&gt;maxᵢ S_(sub,i)⁽ᵗ⁾&lt;/span&gt; reflects the slowest subagent at each stage. Under this metric, spawning more subtasks only helps if it shortens the critical path.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/orchestrator-1.png&quot; alt=&quot;Architecture diagram of Kimi K2.5 Agent Swarm showing an Orchestrator dynamically creating and assigning tasks to specialized sub-agents for parallel execution&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An agent swarm has an orchestrator that dynamically creates specialized subagents (e.g., AI Researcher, Physics Researcher, Fact Checker) and decomposes complex tasks into parallelizable subtasks for efficient distributed execution.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/20260126-225846.png&quot; alt=&quot;Training metrics for Kimi K2.5 showing Training Accuracy and Average Parallelism both increasing steadily with RL flops during the reinforcement learning process&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In our parallel-agent reinforcement learning environment, the reward increases smoothly as training progresses. At the same time, the level of parallelism during training also gradually increases.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent-swarm&quot;&gt;K2.5 Agent Swarm&lt;/a&gt;&lt;/strong&gt; &lt;strong&gt;improves performance on complex tasks through parallel, specialized execution.&lt;/strong&gt; In our internal evaluations, it leads to an &lt;strong&gt;80%&lt;/strong&gt; &lt;strong&gt;reduction in end-to-end runtime&lt;/strong&gt; while enabling more complex, long-horizon workloads, as shown below.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/20260127-131347.jpeg&quot; alt=&quot;Benchmark comparison: Kimi K2.5 Agent Swarm outperforming Claude Opus 4.5 on BrowseComp, Wide Search, and In-house Bench&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blogs/k2-5/complpexity_of_tasks.png&quot; alt=&quot;Execution Time to Solve Tasks of Different Complexity&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Agent Swarm reduces the minimum critical steps required to achieve target performance by 3×–4.5× compared to single-agent execution in wide search scenario, with savings scaling as targets rise—translating to up to 4.5× wall-clock time reduction via parallelization.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here are representative &lt;strong&gt;trajectories&lt;/strong&gt; demonstrating &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent-swarm&quot;&gt;K2.5 Agent Swarm&lt;/a&gt; in action:&lt;/p&gt;
&lt;h2&gt;3. Office Productivity&lt;/h2&gt;
&lt;p&gt;Kimi K2.5 brings agentic intelligence into &lt;strong&gt;real-world knowledge work.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/agent&quot;&gt;K2.5 Agent&lt;/a&gt;&lt;/strong&gt; can &lt;strong&gt;handle high-density, large-scale office work end to end.&lt;/strong&gt; It reasons over large, high-density inputs, coordinates multi-step tool use, and delivers expert-level outputs: documents, spreadsheets, PDFs, and slide decks—directly through conversation.&lt;/p&gt;
&lt;p&gt;With a focus on real-world professional tasks, we design &lt;strong&gt;two internal expert productivity benchmarks&lt;/strong&gt;. The &lt;strong&gt;AI Office Benchmark&lt;/strong&gt; evaluates end-to-end Office output quality, while the &lt;strong&gt;General&lt;/strong&gt; &lt;strong&gt;Agent Benchmark&lt;/strong&gt; measures multi-step, production-grade workflows against human expert performance. Across both benchmarks, &lt;strong&gt;K2.5 shows&lt;/strong&gt; &lt;strong&gt;59.3% and 24.3% improvements over K2 Thinking&lt;/strong&gt;, reflecting stronger end-to-end performance on real-world tasks.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://statics.kimi.ai/blog/k2-5/20260127-152311.png&quot; alt=&quot;Benchmark results: Kimi K2.5 showing significant improvements over K2 Thinking, with 71.2% better performance in AI Office Bench and 39.0% in General-Agent Bench&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Internal Expert Productivity Bench (AI Office)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;K2.5 agent supports advanced tasks such as &lt;strong&gt;adding annotations in Word, constructing financial models with Pivot Tables, and writing LaTeX equations in PDFs&lt;/strong&gt;, while scaling to long-form outputs like &lt;strong&gt;10,000-word papers or 100-page documents&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Tasks that once took hours or days now complete in minutes. Here are some examples:&lt;/p&gt;
&lt;h2&gt;4. Conclusion&lt;/h2&gt;
&lt;p&gt;Grounded in advances in coding with vision, agent swarms, and office productivity, Kimi K2.5 represents a meaningful step toward AGI for the open-source community, demonstrating strong capability on real-world tasks under real-world constraints. Looking ahead, we will push further into the frontier of agentic intelligence, redefining the boundaries of AI in knowledge work.&lt;/p&gt;
&lt;h2&gt;Appendix&lt;/h2&gt;
&lt;h3&gt;Benchmark table&lt;/h3&gt;
&lt;p&gt;To reproduce official &lt;strong&gt;Kimi-K2.5&lt;/strong&gt; benchmark results, we recommend using the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;official API&lt;/a&gt;. For third-party providers, refer to &lt;strong&gt;Kimi Vendor Verifier (KVV)&lt;/strong&gt; to choose high-accuracy services. Details: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/blog/kimi-vendor-verifier&quot;&gt;https://www.kimi.com/blog/kimi-vendor-verifier&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Footnotes&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. General Testing Details&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We report results for Kimi K2.5 and DeepSeek-V3.2 with thinking mode enabled, Claude Opus 4.5 with extended thinking mode, GPT-5.2 with xhigh reasoning effort, and Gemini 3 Pro with a high thinking level. For vision benchmarks, we additionally report results for Qwen3-VL-235B-A22B-Thinking.&lt;/li&gt;
&lt;li&gt;Unless otherwise specified, all Kimi K2.5 experiments were conducted with temperature = 1.0, top-p = 0.95, and a context length of 256k tokens.&lt;/li&gt;
&lt;li&gt;Benchmarks without publicly available scores were re-evaluated under the same conditions used for Kimi K2.5 and are marked with an asterisk (*).&lt;/li&gt;
&lt;li&gt;We could not evaluate GPT-5.2 xhigh on all benchmarks due to service stability issues. For benchmarks that were not tested, we mark them as &amp;quot;-&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; &lt;strong&gt;Text and Reasoning&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HLE, AIME 2025, HMMT 2025 (Feb), GPQA-Diamond and IMO-AnswerBench were evaluated with a maximum completion budget of 96k tokens.&lt;/li&gt;
&lt;li&gt;Results for AIME and HMMT are averaged over 32 runs (avg@32); GPQA-Diamond over 8 runs (avg@8).&lt;/li&gt;
&lt;li&gt;For HLE, we report scores on the full set (text &amp;amp; image). Kimi K2.5 scores 31.5 (text) and 21.3 (image) without tools, and 51.8 (text) and 39.8 (image) with tools. The DeepSeek-V3.2 score corresponds to its text-only subset (marked with †) . Hugging Face access was blocked to prevent potential data leakage. HLE with tools uses simple context management: once the context exceeds a threshold, only the latest round of tool messages is retained.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; &lt;strong&gt;Tool-Augmented / Agentic Search&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kimi K2.5 was equipped with search, code-interpreter, and web-browsing tools for HLE with tools and all agentic search benchmarks.&lt;/li&gt;
&lt;li&gt;Except for BrowseComp (where K2.5 and DeepSeek-V3.2 used the discard-all strategy), no context management was applied, and tasks exceeding the supported context length were directly counted as failed.&lt;/li&gt;
&lt;li&gt;The test system prompts emphasize deep and proactive tool use, instructing models to reason carefully, leverage tools, and verify uncertain information. Full prompts will be provided in the technical report.&lt;/li&gt;
&lt;li&gt;Results for Seal-0 and WideSearch are averaged over four runs (avg@4).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; &lt;strong&gt;Vision Benchmarks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Max-tokens = 64k, averaged over three runs (avg@3).&lt;/li&gt;
&lt;li&gt;ZeroBench (w/ tools) uses max-tokens-per-step = 24k and max-steps = 30 for multi-step reasoning.&lt;/li&gt;
&lt;li&gt;MMMU-Pro follows the official protocol, preserving input order and prepending images.&lt;/li&gt;
&lt;li&gt;GPT-5.2-xhigh had ~10% failure rate (no output despite 3 retries), treated as incorrect; reported scores likely underestimate true performance.&lt;/li&gt;
&lt;li&gt;WorldVQA, a benchmark designed to evaluate atomic vision-centric world knowledge. Access WorldVQA at &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/WorldVQA&quot;&gt;https://github.com/MoonshotAI/WorldVQA&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;OmniDocBench Score is computed as (1 − normalized Levenshtein distance) × 100, where a higher score denotes superior accuracy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; &lt;strong&gt;Coding Tasks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Terminal-Bench 2.0 scores were obtained with the default agent framework (Terminus-2) and the provided JSON parser. In our implementation, we evaluated Terminal-Bench 2.0 under non-thinking mode. This choice was made because our current context management strategy for the thinking mode is incompatible with Terminus-2.&lt;/li&gt;
&lt;li&gt;For the SWE-Bench series of evaluations (including verified, multilingual, and pro), we used an internally developed evaluation framework. This framework includes a minimal set of tools—bash tool, createfile tool, insert tool, view tool, strreplace tool, and submit tool—along with tailored system prompts designed for the tasks. The highest scores were achieved under non-thinking mode.&lt;/li&gt;
&lt;li&gt;The score of Claude Opus 4.5 on CyberGym is reported under the non-thinking setting.&lt;/li&gt;
&lt;li&gt;All reported scores of coding tasks are averaged over 5 independent runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; &lt;strong&gt;Long-Context Benchmarks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AA-LCR: scores averaged over three runs (avg@3).&lt;/li&gt;
&lt;li&gt;LongBench-V2: identical prompts and input contexts standardized to ~128k tokens.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; &lt;strong&gt;Agent Swarm&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BrowseComp (Swarm Mode): main agent max 15 steps; sub-agents max 100 steps.&lt;/li&gt;
&lt;li&gt;WideSearch (Swarm Mode): main and sub-agents max 100 steps.&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:a0b887918623229c68344855f79de5cc2b89bbcd</id>
    <title type="text">Kimi Vendor Verifier</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2026-01-22-kimi-vendor-verifier/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-vendor-verifier"/>
    <published>2026-01-22T00:00:00+00:00</published>
    <updated>2026-01-22T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2026-01-22</summary>
    <content type="html">&lt;h2&gt;Rebuilding the &amp;quot;Chain of Trust&amp;quot;: Kimi Vendor Verifier &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Vendor-Verifier&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/GitHub-181717?style=flat&amp;amp;logo=github&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;GitHub&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Alongside the release of the Kimi K2.6 model, we are open-sourcing the Kimi Vendor Verifier (KVV) project, designed to help users of open-source models verify the accuracy of their inference implementations.&lt;/p&gt;
&lt;p&gt;Not as an afterthought, but because we learned the hard way that open-sourcing a model is only half the battle. The other half is ensuring it runs correctly everywhere else.&lt;/p&gt;
&lt;h2&gt;Official Evaluation Results&lt;/h2&gt;
&lt;p&gt;Think&lt;/p&gt;
&lt;p&gt;Non-Think&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Temperature&lt;/th&gt;
&lt;th&gt;TopP&lt;/th&gt;
&lt;th&gt;MaxTokens&lt;/th&gt;
&lt;th&gt;Kimi API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OCRBench&lt;/td&gt;
&lt;td&gt;acc&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;16384&lt;/td&gt;
&lt;td&gt;91.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIME2025&lt;/td&gt;
&lt;td&gt;avg@32&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;98304&lt;/td&gt;
&lt;td&gt;98.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MMMU Pro Vision&lt;/td&gt;
&lt;td&gt;acc&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;65536&lt;/td&gt;
&lt;td&gt;78.8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;You can &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://statics.kimi.ai/k2vv/kimi-k2.6_t0.6_m8192_nothink.zip&quot;&gt;click here&lt;/a&gt; to access the Kimi API K2VV evaluation results for calculating the F1 score.&lt;/p&gt;
&lt;h2&gt;Why We Built KVV&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;From Isolated Incidents to Systemic Issues&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since the release of K2 Thinking, we have received frequent feedback from the community regarding anomalies in benchmark scores. Our investigation confirmed that a significant portion of these cases stemmed from the misuse of Decoding parameters. To mitigate this immediately, we built our first line of defense at the API level: enforcing Temperature=1.0 and TopP=0.95 in Thinking mode, with mandatory validation that thinking content is correctly passed back.&lt;/p&gt;
&lt;p&gt;However, more subtle anomalies soon triggered our alarm. In a specific evaluation on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.reddit.com/r/LocalLLaMA/comments/1osglws/kimi_k2_thinking_scores_lower_than_gemini_25/?rdt=41412&quot;&gt;LiveBenchmark&lt;/a&gt;, we observed a stark contrast between third-party API and official API. After extensive testing of various infrastructure providers, we found this difference is widespread.&lt;/p&gt;
&lt;p&gt;This exposed a deeper problem in the open-source model ecosystem: The more open the weights are, and the more diverse the deployment channels become, the less controllable the quality becomes.&lt;/p&gt;
&lt;p&gt;If users cannot distinguish between &amp;quot;model capability defects&amp;quot; and &amp;quot;engineering implementation deviations,&amp;quot; trust in the open-source ecosystem will inevitably collapse.&lt;/p&gt;
&lt;h2&gt;Our Solution&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Six Critical Benchmarks&lt;/strong&gt; (selected to expose specific infra failures):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Vendor-Verifier?tab=readme-ov-file#3-pre-flight-check&quot;&gt;Pre-Verification&lt;/a&gt;: Validates that API parameter constraints (temperature, top_p, etc.) are correctly enforced. All tests must pass before proceeding to benchmark evaluation.&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Vendor-Verifier?tab=readme-ov-file#ocrbench-quick-validation&quot;&gt;OCRBench&lt;/a&gt;: 5 minutes smoke test for multimodal pipelines.&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Vendor-Verifier?tab=readme-ov-file#mmmu-pro-vision&quot;&gt;MMMU Pro&lt;/a&gt;: Verify Vision input preprocessing by testing diverse visual inputs.&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Vendor-Verifier?tab=readme-ov-file#aime-2025&quot;&gt;AIME2025&lt;/a&gt;: Long-output stress test. Catches KV cache bugs and quantization degradation that short benchmarks hide.&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/K2-Vendor-Verifier&quot;&gt;K2VV ToolCall&lt;/a&gt;: Measures trigger consistency (F1) and JSON Schema accuracy. Tool errors compound in agents; we catch them early.&lt;/li&gt;
&lt;li&gt;SWE-Bench: Full agentic coding test. (Not open sourced due to dependency of sandbox)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Upstream Fix&lt;/strong&gt;: We embed with vLLM/SGLang/KTransformers communities to fix root causes, not just detect symptoms.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pre-Release Validation&lt;/strong&gt;: Rather than waiting for post-deployment complaints, we provide early access to test models. This lets infrastructure providers validate their stacks before users encounter issues.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Continuous Benchmarking&lt;/strong&gt;: We will maintain a public leaderboard of vendor results. This transparency encourages vendors to prioritize accuracy.&lt;/p&gt;
&lt;h2&gt;Testing Cost Estimation&lt;/h2&gt;
&lt;p&gt;We completed full evaluation workflow validation on Two NVIDIA H20 8-GPU servers, with sequential execution taking approximately 15 hours. To improve evaluation efficiency, scripts have been optimized for long-running inference scenarios, including streaming inference, automatic retry, and checkpoint resumption mechanisms.&lt;/p&gt;
&lt;h2&gt;An Open Invitation&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Weights are open. The knowledge to run them correctly must be too.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We are expanding vendor coverage and seeking lighter agentic tests. &lt;strong&gt;Contact Us: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;mailto:contact-kvv@kimi.com&quot;&gt;contact-kvv@kimi.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:29c9aff4d26fce1768dd98d4f90b27b3a97af7f3</id>
    <title type="text">Kimi K2 Thinking</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-11-06-kimi-k2-thinking/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-k2-thinking"/>
    <published>2025-11-06T00:00:00+00:00</published>
    <updated>2025-11-06T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-11-06</summary>
    <content type="html">&lt;p&gt;Today, we are introducing &lt;strong&gt;Kimi&lt;/strong&gt; &lt;strong&gt;K2&lt;/strong&gt; &lt;strong&gt;Thinking&lt;/strong&gt;, our best open-source thinking model.&lt;/p&gt;
&lt;p&gt;Built as a &lt;strong&gt;thinking agent&lt;/strong&gt;, it reasons step by step &lt;em&gt;while&lt;/em&gt; using tools, achieving state-of-the-art performance on Humanity&#39;s Last Exam (HLE), BrowseComp, and other benchmarks, with major gains in reasoning, agentic search, coding, writing, and general capabilities.&lt;/p&gt;
&lt;p&gt;Kimi K2 Thinking can execute up to &lt;strong&gt;200 – 300 sequential tool calls&lt;/strong&gt; without human interference, reasoning coherently across hundreds of steps to solve complex problems.&lt;/p&gt;
&lt;p&gt;It marks our latest efforts in &lt;strong&gt;test-time scaling&lt;/strong&gt;, by scaling both thinking tokens and tool calling steps.&lt;/p&gt;
&lt;p&gt;K2 Thinking is now live on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;kimi.com&lt;/a&gt; under the chat mode &lt;sup class=&quot;citation-ref&quot;&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/blog/kimi-k2-thinking#footnote-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;, with its full agentic mode available soon. It is also accessible through the Kimi K2 Thinking &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;API&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Evaluations&lt;/h3&gt;
&lt;p&gt;Kimi K2 Thinking sets new records across benchmarks that assess reasoning, coding, and agent capabilities. K2 Thinking achieves 44.9% on HLE with tools, 60.2% on BrowseComp, and 71.3% on SWE-Bench Verified, demonstrating strong generalization as a state-of-the-art thinking agent model.&lt;/p&gt;
&lt;h3&gt;Agentic Reasoning&lt;/h3&gt;
&lt;p&gt;K2 Thinking demonstrates outstanding reasoning and problem-solving abilities. On Humanity’s Last Exam (HLE)—a rigorously crafted, closed‑ended benchmark—spanning thousands of expert‑level questions across more than 100 subjects, K2 Thinking achieved &lt;strong&gt;a&lt;/strong&gt; &lt;strong&gt;state-of-the-art&lt;/strong&gt; &lt;strong&gt;score of&lt;/strong&gt; &lt;strong&gt;44.9%&lt;/strong&gt;, with search, python, and web-browsing tools, establishing new records in multi‑domain expert‑level reasoning performance.&lt;/p&gt;
&lt;p&gt;By reasoning while actively using a diverse set of tools, K2 Thinking is capable of &lt;strong&gt;planning, reasoning, executing, and adapting across hundreds of steps&lt;/strong&gt; to tackle some of the most challenging academic and analytical problems. In one instance, it successfully solved a &lt;strong&gt;PhD-level mathematics problem&lt;/strong&gt; through &lt;strong&gt;23 interleaved reasoning and tool calls&lt;/strong&gt;, exemplifying its capacity for deep, structured reasoning and long-horizon problem solving:&lt;/p&gt;
&lt;h3&gt;Agentic Coding&lt;/h3&gt;
&lt;p&gt;K2 Thinking exhibits substantial gains in coding and software development tasks. It achieves scores of 61.1% on SWE-Multilingual, 71.3% on SWE-Bench Verified, and 47.1% on Terminal-Bench, showcasing strong generalization across programming languages and agent scaffolds.&lt;/p&gt;
&lt;p&gt;The model delivers notable improvements on HTML, React, and component-intensive front-end tasks—translating ideas into fully functional, responsive products. In agentic coding settings, it reasons while invoking tools, integrating fluidly into software agents to execute complex, multi-step development workflows with precision and adaptability.&lt;/p&gt;
&lt;p&gt;Here are some examples that Kimi K2 Thinking has built from a single prompt:&lt;/p&gt;
&lt;h3&gt;Agentic Search and Browsing&lt;/h3&gt;
&lt;p&gt;K2 Thinking demonstrates strong performance in agentic search and browsing scenarios. On BrowseComp—a challenging benchmark designed to evaluate models&#39; ability to &lt;strong&gt;continuously browse, search, and reason over hard-to-find real-world web information&lt;/strong&gt;—K2 Thinking achieved a score of &lt;strong&gt;60.2%&lt;/strong&gt;, significantly outperforming the human baseline of 29.2%. This result highlights K2 Thinking&#39;s superior capability for goal-directed, web-based reasoning and its robustness in dynamic, information-rich environments.&lt;/p&gt;
&lt;p&gt;K2 Thinking can execute &lt;strong&gt;200–300 sequential tool calls&lt;/strong&gt;, driven by &lt;strong&gt;long-horizon planning&lt;/strong&gt; and &lt;strong&gt;adaptive reasoning&lt;/strong&gt;. It performs dynamic cycles of &lt;em&gt;think → search → browser use → think → code&lt;/em&gt;, continually generating and refining hypotheses, verifying evidence, reasoning, and constructing coherent answers. This interleaved reasoning allows it to decompose ambiguous, open-ended problems into clear, actionable subtasks.&lt;/p&gt;
&lt;p&gt;Here&#39;s one example of what &lt;strong&gt;Kimi K2 Thinking&lt;/strong&gt; has researched from just a single prompt:&lt;/p&gt;
&lt;h3&gt;General Capabilities&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Creative Writing&lt;/strong&gt;: K2 Thinking delivers improvements in completeness and richness. It shows stronger command of style and instruction, handling diverse tones and formats with natural fluency. Its writing becomes more vivid and imaginative—poetic imagery carries deeper associations, while stories and scripts feel more human, emotional, and purposeful. The ideas it expresses often reach greater thematic depth and resonance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Practical Writing&lt;/strong&gt;: K2 Thinking demonstrates marked gains in reasoning depth, perspective breadth, and instruction adherence. It follows prompts with higher precision, addressing each requirement clearly and systematically—often expanding on every mentioned point to ensure thorough coverage. In academic, research, and long-form analytical writing, it excels at producing rigorous, logically coherent, and substantively rich content, making it particularly effective in scholarly and professional contexts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Personal &amp;amp; Emotional&lt;/strong&gt;: When addressing personal or emotional questions, K2 Thinking responds with more empathy and balance. Its reflections are thoughtful and specific, offering nuanced perspectives and actionable next steps. It helps users navigate complex decisions with clarity and care—grounded, practical, and genuinely human in tone.&lt;/p&gt;
&lt;h3&gt;Inference Efficiency&lt;/h3&gt;
&lt;p&gt;Low-bit quantization is an effective way to reduce inference latency and GPU memory usage on large-scale inference servers. However, thinking models use excessive decoding lengths, and thus quantization often results in substantial performance drops.&lt;/p&gt;
&lt;p&gt;To overcome this challenge, we adopt Quantization-Aware Training (QAT) during the post-training phase, applying INT4 weight-only quantization to the MoE components. It allows K2 Thinking to support native INT4 inference with a roughly 2x generation speed improvement while achieving state-of-the-art performance. All benchmark results are reported under INT4 precision.&lt;/p&gt;
&lt;h3&gt;Full Evaluations &lt;sup class=&quot;citation-ref&quot;&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en/blog/kimi-k2-thinking#footnote-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;/h3&gt;
&lt;p&gt;The table below shows that Kimi K2 Thinking matches or surpasses the latest open-source and frontier models across a wide range of tasks, excelling on benchmarks for reasoning, agentic search, and coding.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Footnotes&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;To ensure a fast, lightweight experience, we selectively employ a subset of tools and reduce the number of tool call turns under the chat mode on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;kimi.com&lt;/a&gt;. As a result, chatting on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;kimi.com&lt;/a&gt; may not reproduce our benchmark scores. Our agentic mode will be updated soon to reflect the full capabilities of K2 Thinking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Testing Details:&lt;/strong&gt; a. All benchmarks were evaluated at temperature = 1.0 and 256 k context length for K2 Thinking, except for SciCode, for which we followed the official temperature setting of 0.0. b. HLE (no tools), AIME25, HMMT25, and GPQA were capped at a 96k thinking-token budget, while IMO-Answer Bench, LiveCodeBench and OJ-Bench were capped at a 128k thinking-token budget. Longform Writing was capped at a 32k completion-token budget. c. For AIME and HMMT (no tools), we report the average of 32 runs (avg@32). For AIME and HMMT (with Python), we report the average of 16 runs (avg@16). For IMO-AnswerBench, we report the average of 8 runs (avg@8).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Baselines:&lt;/strong&gt; a. GPT-5, Claude-4.5-sonnet, Grok-4 results and DeepSeek-V3.2 results are quoted from the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/introducing-gpt-5/&quot;&gt;GPT-5 post&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/introducing-gpt-5-for-developers/&quot;&gt;GPT-5 for Developers post&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/gpt-5-system-card/&quot;&gt;GPT-5 system card&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.anthropic.com/news/claude-sonnet-4-5&quot;&gt;claude-sonnet-4-5&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://x.ai/news/grok-4&quot;&gt;grok-4&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://api-docs.deepseek.com/news/news250929/&quot;&gt;deepseek-v3.2&lt;/a&gt;, the public &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.tbench.ai/&quot;&gt;Terminal-Bench leaderboard&lt;/a&gt; (Terminus-2), the public &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.vals.ai/benchmarks/legal_bench&quot;&gt;Vals AI leaderboard&lt;/a&gt; and the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://artificialanalysis.ai/&quot;&gt;artificialanalysis&lt;/a&gt;. Benchmarks for which no available public scores were re-tested under the same conditions used for k2 thinking and are marked with an asterisk(*). For the GPT-5 test, we set the reasoning effort to high. b. The GPT-5 and Grok-4 on the HLE full set with tools are 35.2 and 38.6 from their official posts. In our internal evaluation on the HLE text-only subset, GPT-5 scores &lt;strong&gt;41.7&lt;/strong&gt; and Grok-4 scores &lt;strong&gt;38.6&lt;/strong&gt; (Grok-4’s launch cited &lt;strong&gt;41.0&lt;/strong&gt; on the text-only subset). For GPT-5&#39;s HLE text-only w/o tool, we use score from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://labs.scale.com/leaderboard/humanitys_last_exam_text_only&quot;&gt;Scale.ai&lt;/a&gt;, and the official GPT-5 score on the HLE full set (no tools) is 24.8. c. For &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://aclanthology.org/2025.emnlp-main.1794.pdf&quot;&gt;IMO-AnswerBench&lt;/a&gt;: GPT-5 scored 65.6 in the benchmark paper. We re-evaluated GPT-5 with official API and obtained a score of 76.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For HLE (w/ tools) and the agentic-search benchmarks:&lt;/strong&gt; a. K2 Thinking was equipped with search, code-interpreter, and web-browsing tools. b. BrowseComp-ZH, Seal-0, FinSearchComp-T3 were run 4 times independently and the average is reported (avg@4). c. The evaluation used o3-mini as judge, configured identically to the official HLE setting; judge prompts were taken verbatim from the official repository. d. On HLE, the maximum step limit was 120, with a 48 k-token reasoning budget per step; on agentic-search tasks, the limit was 300 steps with a 24 k-token reasoning budget per step. e. When tool execution results cause the accumulated input to exceed the model&#39;s context limit (256k), we employ a simple context management strategy that hides all previous tool outputs. f. The web access to Hugging Face may lead to data leakage in certain benchmark tests, such as HLE. K2 Thinking can achieve a score of 51.3 on HLE without blocking Hugging Face. To ensure a fair and rigorous comparison, we blocked access to Hugging Face during testing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For Coding Tasks:&lt;/strong&gt; a. Terminal-Bench scores were obtained with the default agent framework (Terminus-2) and the provided JSON parser. b. For other coding tasks, the result was produced with our in-house evaluation harness. The harness is derived from SWE-agent, but we clamp the context windows of the Bash and Edit tools and rewrite the system prompt to match the task semantics. c. All reported scores of coding tasks are averaged over 5 independent runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heavy Mode&lt;/strong&gt;: K2 Thinking Heavy Mode employs an efficient parallel strategy: it first rolls out eight trajectories simultaneously, then reflectively aggregates all outputs to generate the final result. Heavy mode for GPT-5 denotes the official GPT-5 Pro score.&lt;/li&gt;
&lt;/ol&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:6f86fe9c1cacde2c74464ac78b2ed523b48fe9ba</id>
    <title type="text">Kimi-K2-Instruct-0905</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-09-05-kimi-k2-instruct-0905/"/>
    <link rel="via" type="text/html" href="https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905"/>
    <published>2025-09-05T00:00:00+00:00</published>
    <updated>2025-09-05T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-09-05</summary>
    <content type="html">&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/resolve/main/figures/kimi-logo.png&quot; alt=&quot;Kimi K2: Open Agentic Intellignece&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/%F0%9F%A4%96%20Chat-Kimi%20K2-ff6b6b?color=1783ff&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;Chat&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/moonshotai/Kimi-K2&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/%F0%9F%A4%96%20Github-Kimi%20K2-ff6b6b?color=1783ff&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;github&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.moonshot.ai&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Homepage-Moonshot%20AI-white?logo=Kimi&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;Homepage&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Moonshot%20AI-ffc107?color=ffc107&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;Hugging Face&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://twitter.com/kimi_moonshot&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Twitter-Kimi.ai-white?logo=x&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;Twitter Follow&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://discord.gg/TYU2fdJykW&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Discord-Kimi.ai-white?logo=discord&amp;amp;logoColor=white&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;Discord&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/blob/main/LICENSE&quot;&gt;&lt;picture class=&quot;article-picture article-badge&quot; style=&quot;--image-width:160px;--image-ratio:160 / 24&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/License-Modified_MIT-f5de53?&amp;amp;color=f5de53&quot; width=&quot;160&quot; height=&quot;24&quot; alt=&quot;License&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;📰  &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://moonshotai.github.io/Kimi-K2/&quot;&gt;Tech Blog&lt;/a&gt;&lt;/strong&gt;     |     &lt;strong&gt;📄  &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-K2/blob/main/tech_report.pdf&quot;&gt;Paper&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;1. Model Introduction&lt;/h2&gt;
&lt;p&gt;Kimi K2-Instruct-0905 is the latest, most capable version of Kimi K2. It is a state-of-the-art mixture-of-experts (MoE) language model, featuring 32 billion activated parameters and a total of 1 trillion parameters.&lt;/p&gt;
&lt;h3&gt;Key Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Enhanced agentic coding intelligence: Kimi K2-Instruct-0905 demonstrates significant improvements in performance on public benchmarks and real-world coding agent tasks.&lt;/li&gt;
&lt;li&gt;Improved frontend coding experience: Kimi K2-Instruct-0905 offers advancements in both the aesthetics and practicality of frontend programming.&lt;/li&gt;
&lt;li&gt;Extended context length: Kimi K2-Instruct-0905’s context window has been increased from 128k to 256k tokens, providing better support for long-horizon tasks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2. Model Summary&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mixture-of-Experts (MoE)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total Parameters&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1T&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Activated Parameters&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;32B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Layers&lt;/strong&gt; (Dense layer included)&lt;/td&gt;
&lt;td&gt;61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Dense Layers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Attention Hidden Dimension&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;7168&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MoE Hidden Dimension&lt;/strong&gt; (per Expert)&lt;/td&gt;
&lt;td&gt;2048&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Attention Heads&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Experts&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;384&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Selected Experts per Token&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Shared Experts&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Vocabulary Size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;160K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Context Length&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;256K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Attention Mechanism&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MLA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Activation Function&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SwiGLU&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;3. Evaluation Results&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;K2-Instruct-0905&lt;/th&gt;
&lt;th&gt;K2-Instruct-0711&lt;/th&gt;
&lt;th&gt;Qwen3-Coder-480B-A35B-Instruct&lt;/th&gt;
&lt;th&gt;GLM-4.5&lt;/th&gt;
&lt;th&gt;DeepSeek-V3.1&lt;/th&gt;
&lt;th&gt;Claude-Sonnet-4&lt;/th&gt;
&lt;th&gt;Claude-Opus-4&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SWE-Bench verified&lt;/td&gt;
&lt;td&gt;ACC&lt;/td&gt;
&lt;td&gt;69.2 ± 0.63&lt;/td&gt;
&lt;td&gt;65.8&lt;/td&gt;
&lt;td&gt;69.6*&lt;/td&gt;
&lt;td&gt;64.2*&lt;/td&gt;
&lt;td&gt;66.0*&lt;/td&gt;
&lt;td&gt;72.7*&lt;/td&gt;
&lt;td&gt;72.5*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-Bench Multilingual&lt;/td&gt;
&lt;td&gt;ACC&lt;/td&gt;
&lt;td&gt;55.9 ± 0.72&lt;/td&gt;
&lt;td&gt;47.3&lt;/td&gt;
&lt;td&gt;54.7*&lt;/td&gt;
&lt;td&gt;52.7&lt;/td&gt;
&lt;td&gt;54.5*&lt;/td&gt;
&lt;td&gt;53.3*&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-SWE-Bench&lt;/td&gt;
&lt;td&gt;ACC&lt;/td&gt;
&lt;td&gt;33.5 ± 0.28&lt;/td&gt;
&lt;td&gt;31.3&lt;/td&gt;
&lt;td&gt;32.7&lt;/td&gt;
&lt;td&gt;31.7&lt;/td&gt;
&lt;td&gt;29.0&lt;/td&gt;
&lt;td&gt;35.7&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench&lt;/td&gt;
&lt;td&gt;ACC&lt;/td&gt;
&lt;td&gt;44.5 ± 2.03&lt;/td&gt;
&lt;td&gt;37.5&lt;/td&gt;
&lt;td&gt;37.5*&lt;/td&gt;
&lt;td&gt;39.9*&lt;/td&gt;
&lt;td&gt;31.3*&lt;/td&gt;
&lt;td&gt;36.4*&lt;/td&gt;
&lt;td&gt;43.2*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-Dev&lt;/td&gt;
&lt;td&gt;ACC&lt;/td&gt;
&lt;td&gt;66.6 ± 0.72&lt;/td&gt;
&lt;td&gt;61.9&lt;/td&gt;
&lt;td&gt;64.7&lt;/td&gt;
&lt;td&gt;63.2&lt;/td&gt;
&lt;td&gt;53.3&lt;/td&gt;
&lt;td&gt;67.1&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All K2-Instruct-0905 numbers are reported as mean ± std over five independent, full-test-set runs. Before each run we prune the repository so that every Git object unreachable from the target commit disappears; this guarantees the agent sees only the code that would legitimately be available at that point in history.&lt;/p&gt;
&lt;p&gt;Except for Terminal-Bench (Terminus-2), every result was produced with our in-house evaluation harness. The harness is derived from SWE-agent, but we clamp the context windows of the Bash and Edit tools and rewrite the system prompt to match the task semantics. All baseline figures denoted with an asterisk (*) are excerpted directly from their official report or public leaderboard; the remaining metrics were evaluated by us under conditions identical to those used for K2-Instruct-0905.&lt;/p&gt;
&lt;p&gt;For SWE-Dev we go one step further: we overwrite the original repository files and delete any test file that exercises the functions the agent is expected to generate, eliminating any indirect hints about the desired implementation.&lt;/p&gt;
&lt;h2&gt;4. Deployment&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;You can access Kimi K2&#39;s API on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.moonshot.ai&quot;&gt;https://platform.moonshot.ai&lt;/a&gt; , we provide OpenAI/Anthropic-compatible API for you.&lt;/p&gt;
&lt;p&gt;The Anthropic-compatible API maps temperature by &lt;code&gt;real_temperature = request_temperature * 0.6&lt;/code&gt; for better compatible with existing applications.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Our model checkpoints are stored in the block-fp8 format, you can find it on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct&quot;&gt;Huggingface&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Currently, Kimi-K2 is recommended to run on the following inference engines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;vLLM&lt;/li&gt;
&lt;li&gt;SGLang&lt;/li&gt;
&lt;li&gt;KTransformers&lt;/li&gt;
&lt;li&gt;TensorRT-LLM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Deployment examples for vLLM and SGLang can be found in the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/blob/main/docs/deploy_guidance.md&quot;&gt;Model Deployment Guide&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;5. Model Usage&lt;/h2&gt;
&lt;h3&gt;Chat Completion&lt;/h3&gt;
&lt;p&gt;Once the local inference service is up, you can interact with it through the chat endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-storage syntax-type syntax-function syntax-python&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;syntax-entity syntax-name syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;simple_chat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;client&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-annotation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-parameter syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;OpenAI&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-parameters syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-annotation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-parameter syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-type syntax-python&quot;&gt;str&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-function syntax-begin syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;system&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;You are Kimi, an AI assistant created by Moonshot AI.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Please give a brief self-introduction.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;chat&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completions&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
        &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;messages&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;temperature&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;0&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;6&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;256&lt;/span&gt;
    &lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choices&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;content&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;The recommended temperature for Kimi-K2-Instruct-0905 is &lt;code&gt;temperature = 0.6&lt;/code&gt;. If no special instructions are required, the system prompt above is a good default.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;h3&gt;Tool Calling&lt;/h3&gt;
&lt;p&gt;Kimi-K2-Instruct-0905 has strong tool-calling capabilities. To enable them, you need to pass the list of available tools in each request, then the model will autonomously decide when and how to invoke them.&lt;/p&gt;
&lt;p&gt;The following example demonstrates calling a weather tool end-to-end:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Your tool implementation
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-storage syntax-type syntax-function syntax-python&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;syntax-entity syntax-name syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;get_weather&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;city&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-annotation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-parameter syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-type syntax-python&quot;&gt;str&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-annotation syntax-return syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-return syntax-python&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-type syntax-python&quot;&gt;dict&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-function syntax-begin syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-return syntax-python&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;weather&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Sunny&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Tool schema definition
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tools&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;function&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;function&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;name&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;get_weather&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;description&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Retrieve current weather information. Call this when the user asks about the weather.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;parameters&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;object&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;required&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;city&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;properties&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;city&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;string&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;description&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Name of the city&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Map tool names to their implementations
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_map&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;get_weather&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;get_weather&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-storage syntax-type syntax-function syntax-python&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;syntax-entity syntax-name syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_with_client&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;client&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-annotation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-parameter syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;OpenAI&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-parameters syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-annotation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-annotation syntax-parameter syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-type syntax-python&quot;&gt;str&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-parameters syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-parameters syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-function syntax-begin syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;system&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;You are Kimi, an AI assistant created by Moonshot AI.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;What&amp;#39;s the weather like in Beijing today? Use the tool to check.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-statement syntax-while syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-while syntax-python&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-logical syntax-python&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-logical syntax-python&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-comparison syntax-python&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;tool_calls&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-block syntax-while syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completion&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;chat&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completions&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
            &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;messages&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;temperature&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;0&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;6&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;tools&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tools&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;          &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; tool list defined above
&lt;/span&gt;            &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;tool_choice&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choice&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completion&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choices&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-statement syntax-if syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-conditional syntax-python&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;finish_reason&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-comparison syntax-python&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;tool_calls&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-block syntax-conditional syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;append&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;message&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_calls&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-block syntax-for syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_name&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;name&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_arguments&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;loads&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;arguments&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_function&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_map&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_result&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;tool_function&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_arguments&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;tool_result:&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_result&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;append&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;tool&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;tool_call_id&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;name&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_call_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;dumps&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tool_result&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;-&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;content&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;tool_call_with_client&lt;/code&gt; function implements the pipeline from user query to tool execution. This pipeline requires the inference engine to support Kimi-K2’s native tool-parsing logic. For more information, see the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/blob/main/docs/tool_call_guidance.md&quot;&gt;Tool Calling Guide&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;6. License&lt;/h2&gt;
&lt;p&gt;Both the code repository and the model weights are released under the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/tree/main/LICENSE&quot;&gt;Modified MIT License&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;7. Third Party Notices&lt;/h2&gt;
&lt;p&gt;See &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905/blob/main/THIRD_PARTY_NOTICES.md&quot;&gt;THIRD PARTY NOTICES&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;7. Contact Us&lt;/h2&gt;
&lt;p&gt;If you have any questions, please reach out at &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;mailto:support@moonshot.cn&quot;&gt;support@moonshot.cn&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:d9d2e1b00a7d0c4accf8e503e2a1a5194c6cb567</id>
    <title type="text">Kimi K2</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-07-11-kimi-k2/"/>
    <link rel="via" type="text/html" href="https://www.kimi.com/en/blog/kimi-k2"/>
    <published>2025-07-11T00:00:00+00:00</published>
    <updated>2025-07-11T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-07-11</summary>
    <content type="html">&lt;p&gt;&lt;strong&gt;Update(0905)&lt;/strong&gt;：We have an updated weight that enhances &lt;strong&gt;agentic coding&lt;/strong&gt; and supports &lt;strong&gt;256K context&lt;/strong&gt;，&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905&quot;&gt;see here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kimi K2 is our latest Mixture-of-Experts model with 32 billion activated parameters and 1 trillion total parameters. It achieves state-of-the-art performance in frontier knowledge, math, and coding among non-thinking models. But it goes further — meticulously optimized for agentic tasks, Kimi K2 does not just answer; it acts.&lt;/p&gt;
&lt;p&gt;And now, it is within your reach. Today, we are open-sourcing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kimi-K2-Base:&lt;/strong&gt; The foundation model, a strong start for researchers and builders who want full control for fine-tuning and custom solutions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kimi-K2-Instruct:&lt;/strong&gt; The post-trained model best for drop-in, general-purpose chat and agentic experiences. It is a reflex-grade model without long thinking.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With Kimi K2, advanced agentic intelligence is more open and accessible than ever. We can&#39;t wait to see what you build.&lt;/p&gt;
&lt;h3&gt;Use cases&lt;/h3&gt;
&lt;p&gt;Give Kimi K2 your tools and describe your task.&lt;/p&gt;
&lt;p&gt;It automatically understands how to use the tools and gets the job done. You don&#39;t have to write any complex workflow for agentic applications.&lt;/p&gt;
&lt;p&gt;Imagine using Kimi K2 to explore remote-work salaries with the Salary Data Analysis example, where 16 IPython calls generate stats, visualizations, and an interactive webpage of insights. Dive into the Stanford NLP Genealogy, and get Kimi K2 to generate an interactive site built through 5 web searches, 4 browsings, 3 clicks, 5 scrolls, 6 edits, and 2 deployments. Or plan your dream Coldplay Tour 2025 in London with Kimi K2, it crafted the plan for you through 17 seamless tool calls spanning search, calendar, Gmail, flights, Airbnb, and restaurant bookings.&lt;/p&gt;
&lt;p&gt;Bring Kimi K2 to your command line. It edits files. It runs commands.&lt;/p&gt;
&lt;p&gt;Kimi K2 understands your environment, decides what actions to take, and executes them seamlessly.&lt;/p&gt;
&lt;p&gt;For clarity, the terminal displays only a summary of each trajectory. In every example, Kimi K2 orchestrates multiple tools and commands behind the scenes to accomplish complex objectives. For instance, Kimi K2 can automate Minecraft development in JavaScript: it manages rendering, runs and debugs test cases, captures logs on failure, and iteratively improves the code until all tests succeed. For pre/post norm analysis, Kimi K2 uses the Weights &amp;amp; Biases (wandb) data reader to extract insights from language model experiments and generates a polished analysis report. When converting a Flask project to Rust, Kimi K2 systematically refactors the codebase and runs performance benchmarks to ensure robust results.&lt;/p&gt;
&lt;h3&gt;Benchmarking Kimi K2&lt;/h3&gt;
&lt;h3&gt;Open Agentic Intelligence&lt;/h3&gt;
&lt;p&gt;Pre-training is the crucial foundation for &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://ysymyth.github.io/The-Second-Half/&quot;&gt;Agentic Intelligence&lt;/a&gt;, establishing the priors that makes reinforcement learning (RL) exploration tractable, efficient, and generalizable. However, as Ilya Sutskever also observes, human data is a finite &amp;quot;fossil fuel&amp;quot;, and its growth is lagging far behind the pace of compute. This makes &lt;strong&gt;token efficiency&lt;/strong&gt; during pre-training a new critical coefficient in the AI scaling laws.&lt;/p&gt;
&lt;p&gt;Post-training is pivotal in the &amp;quot;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://storage.googleapis.com/deepmind-media/Era-of-Experience%20/The%20Era%20of%20Experience%20Paper.pdf&quot;&gt;Era of Experience&lt;/a&gt;&amp;quot; (David Silver, Richard Sutton, 2025). In this era, LLMs increasingly learn from their own self-generated interactions, receiving rewards that free them from the limits of human data and enable them to surpass human capabilities.&lt;/p&gt;
&lt;p&gt;Kimi K2 is forged from these very insights.&lt;/p&gt;
&lt;h4&gt;MuonClip Optimizer&lt;/h4&gt;
&lt;p&gt;Without rigor, given an approximately finite pretraining dataset and a fixed model configuration, a more token-efficient optimizer generates more intelligence. Our previous work &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Moonlight&quot;&gt;Moonlight&lt;/a&gt; has demonstrated that the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://kellerjordan.github.io/posts/muon/&quot;&gt;Muon&lt;/a&gt; optimizer substantially outperforms the widely-used AdamW optimizer for LLM training.&lt;/p&gt;
&lt;p&gt;Kimi K2 was designed to further scale up Moonlight, which employs an architecture similar to DeepSeek-V3. Based on scaling-law analysis, we reduce the number of heads for long-context efficiency, and increase MoE sparsity for greater token efficiency. While scaling up, we encountered a persistent challenge: training instability caused by exploding attention logits, an issue that occurs more frequently with Muon but less with AdamW in our experiments. Existing solutions such as logit soft-capping and query-key normalization were found inadequate.&lt;/p&gt;
&lt;p&gt;To address this, we introduce the MuonClip optimizer that improves Muon with our proposed qk-clip technique. Specifically, qk-clip stabilizes training by directly rescaling the weight matrices of the query and key projections after Muon updates, thus controlling the scale of attention logits at the source. Concretely, the query and key projections are scaled as follows:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math math-display&quot;&gt;qᵢ = η^α W_q xᵢ&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math math-display&quot;&gt;kᵢ = η^(1−α) Wₖ xᵢ&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;where &lt;span class=&quot;math&quot;&gt;α&lt;/span&gt; is a balancing hyperparameter, so the attention logit becomes:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math math-display&quot;&gt;(η^α qᵢ)^⊤ (η^(1−α) kⱼ) = η, qᵢ^⊤ kⱼ&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The adaptive factor &lt;span class=&quot;math&quot;&gt;η&lt;/span&gt; (with threshold &lt;span class=&quot;math&quot;&gt;t&lt;/span&gt;) is set after every step based on the max attention logit in this step:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;math math-display&quot;&gt;η = min(t/( max_(i,j)(qᵢ^⊤ kⱼ)), 1)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;where &lt;span class=&quot;math&quot;&gt;t&lt;/span&gt; is a pre-set threshold. This is a general technique that can be possibly applied to other stabilization use cases.&lt;/p&gt;
&lt;p&gt;Our experiments show that MuonClip effectively prevents logit explosions while maintaining downstream task performance. In practice, Kimi K2 was pre-trained on 15.5T tokens using MuonClip with zero training spike, demonstrating MuonClip as a robust solution for stable, large-scale LLM training.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/4/2026-07-13/d9af7sff2ena62011o2g?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;Training loss vs tokens: Muon vs AdamW&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h4&gt;Agentic Capabilities&lt;/h4&gt;
&lt;p&gt;The enhanced agentic capabilities of Kimi K2 originate from two important aspects — large-scale agentic data synthesis and general reinforcement learning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Large-Scale Agentic Data Synthesis for Tool Use Learning:&lt;/strong&gt; To teach the model sophisticated tool-use capabilities, we developed a comprehensive pipeline inspired by ACEBench that simulates real-world tool-using scenarios at scale. Our approach systematically evolves hundreds of domains containing thousands of tools—including both real MCP (Model Context Protocol) tools and synthetic ones—then generates hundreds of agents with diverse tool sets.&lt;/p&gt;
&lt;p&gt;All tasks are rubric-based, enabling consistent evaluation. Agents interact with simulated environments and user agents, creating realistic multi-turn tool-use scenarios. An LLM judge evaluates simulation results against task rubrics, filtering for high-quality training data. This scalable pipeline generates diverse, high-quality data, paving the way for large-scale rejection sampling and reinforcement learning.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://kimi-file.kimi.ai/prod-chat-kimi/kfs/4/4/2026-07-13/d9af7svf2ena62011o3g?x-tos-process=image%2Fauto-orient%2C1%2Fstrip%2Fignore-error%2C1&quot; alt=&quot;Kimi K2 agentic data synthesis workflow&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;General Reinforcement Learning:&lt;/strong&gt; The key challenge is to apply RL to tasks with both verifiable and non-verifiable rewards; typical examples of verifiable tasks are math and competition coding, while writing a research report is usually viewed as non-verifiable. Going beyond verifiable rewards, our general RL system uses a self-judging mechanism where the model acts as its own critic, providing scalable, rubric-based feedback for non-verifiable tasks.&lt;/p&gt;
&lt;p&gt;Meanwhile, on-policy rollouts with verifiable rewards are used to continuously update the critic so that the critic keeps improving its evaluation accuracy on the latest policy. This can be viewed as a way of using verifiable rewards to improve the estimation of non-verifiable rewards.&lt;/p&gt;
&lt;h3&gt;Getting started with Kimi K2&lt;/h3&gt;
&lt;h4&gt;Try Kimi K2 on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/en&quot;&gt;kimi.com&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Starting today, Kimi users on web and mobile can select and use the new Kimi K2 model for free. At this moment, our MCP features for web and app are still in development. We hope to begin rolling them out in the coming weeks. In the meantime, you’re welcome to try our Researcher for an early look at its agentic capabilities. Please note that vision features are not supported for Kimi K2 yet.&lt;/p&gt;
&lt;h4&gt;Use Kimi K2 with API&lt;/h4&gt;
&lt;p&gt;The Kimi Platform offers an OpenAI/Anthropic compatible interface, allowing for easy adaptation of your existing applications to Kimi K2. We encourage developers to explore our tool calling API for building agent applications. For detailed information, visit &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://platform.kimi.com/&quot;&gt;platform.kimi.com&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Serve Kimi K2 on your own&lt;/h4&gt;
&lt;p&gt;We recommend running Kimi K2 on one of the following inference engines: vLLM, SGLang, KTransformers, or TensorRT-LLM. For detailed deployment instructions, please see our &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-K2?tab=readme-ov-file#4-deployment&quot;&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;What&#39;s next&lt;/h4&gt;
&lt;p&gt;While Kimi K2 serves as a strong foundation for open agentic intelligence, a general agent uses more advanced capabilities such as thinking and visual understanding. We plan to add these to Kimi K2 in the future.&lt;/p&gt;
&lt;h4&gt;Limitations&lt;/h4&gt;
&lt;p&gt;In our internal tests, we&#39;ve identified some limitations in current Kimi K2 models. When dealing with hard reasoning tasks or unclear tool definition, the model may generate excessive tokens, sometimes leading to truncated outputs or incomplete tool calls. Additionally, performance may decline on certain tasks if tool use is enabled. When building complete software projects, one-shot prompting yields performance degradation compared to using K2 under an agentic framework. We are working to address these issues in future releases and looking forward to more feedbacks.&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:82e261a7fd10e631e521bfb1de1d846c24d02c75</id>
    <title type="text">Kimi-Researcher</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-06-20-kimi-researcher/"/>
    <link rel="via" type="text/html" href="https://moonshotai.github.io/Kimi-Researcher/"/>
    <published>2025-06-20T00:00:00+00:00</published>
    <updated>2025-06-20T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-06-20</summary>
    <content type="html">&lt;h2&gt;End-to-End RL Training for Emerging Agentic Capabilities&lt;/h2&gt;
&lt;p&gt;June 20, 2025 • 10 min read&lt;/p&gt;
&lt;p&gt;Meet &lt;strong&gt;Kimi-Researcher&lt;/strong&gt;, an autonomous agent that excels at multi-turn search and reasoning. It performs an average of 23 reasoning steps and explores over 200 URLs per task. Built on an internal version of the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2501.12599&quot;&gt;Kimi k-series model&lt;/a&gt; and trained entirely through end-to-end agentic reinforcement learning (RL), it achieved a Pass@1 score of &lt;strong&gt;26.9%&lt;/strong&gt;—a state-of-the-art result—on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://agi.safe.ai/&quot;&gt;Humanity&#39;s Last Exam&lt;/a&gt;, and Pass@4 accuracy of &lt;strong&gt;40.17%&lt;/strong&gt;. Starting from an initial HLE score of 8.6%, Kimi-Researcher reached 26.9% almost entirely through end-to-end RL training, providing compelling evidence that end-to-end agentic RL can significantly advance agent intelligence.&lt;/p&gt;
&lt;p&gt;Kimi-Researcher has also achieved strong performance across several complex and challenging real-world benchmarks. On &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://xbench.org/&quot;&gt;xbench&lt;/a&gt;, a new, dynamic, professionally-aligned suite designed to bridge AI capabilities with real-world productivity, Kimi-Researcher achieved 69% pass@1 (averaged on 4 runs) on xbench-DeepSearch, outperforming models such as o3 with search tools. On benchmark tests for multi-turn search reasoning (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2409.12941&quot;&gt;FRAMES&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2506.01062v1&quot;&gt;Seal-0&lt;/a&gt;) and factual information (&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2411.04368&quot;&gt;SimpleQA&lt;/a&gt;), Kimi-Researcher also achieved strong performance.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/1.png&quot; alt=&quot;Comparison of Kimi-Researcher and other models&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 1&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Potential fluctuations in tools, such as search engines, may affect performance. The results are tested on: HLE on June 17, 2025; and xbench-DeepSearch, Seal-0, Frames, and SimpleQA on June 18, 2025.&lt;/li&gt;
&lt;li&gt;All Kimi-Researcher results were evaluated using o3-mini. Scores of other models are referenced from the relevant papers or leaderboards. &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://storage.googleapis.com/deepmind-media/gemini/gemini_v2_5_report.pdf&quot;&gt;[1]&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf&quot;&gt;[2]&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2503.20201&quot;&gt;[3]&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/introducing-deep-research/&quot;&gt;[4]&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://lastexam.ai/&quot;&gt;[5]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For benchmarks with fewer than 200 test samples (xbench, Seal-0), we performed four runs and reported the average result (avg@4).&lt;/li&gt;
&lt;li&gt;We do not compare multi-agent workflows based on multiple frontier models here, as our focus is on evaluating model capabilities.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;End-to-end agentic RL is promising but challenging&lt;/h3&gt;
&lt;p&gt;Kimi-Researcher is an autonomous agentic and thinking model designed to solve complex problems through multi-step planning, reasoning, and tool use. It leverages three main tools: a parallel, real-time internal &lt;strong&gt;search tool&lt;/strong&gt;; a text-based &lt;strong&gt;browser tool&lt;/strong&gt; for interactive web tasks; and a &lt;strong&gt;coding tool&lt;/strong&gt; for automated code execution.&lt;/p&gt;
&lt;p&gt;Formally, given the state observation \(s_t\) (for instance, \(s_0\) includes system prompt, tool declarations, and user query) , Kimi-Researcher generates \(\text{think}_t\) and \(\text{action}_t\). An action can either be a tool call or an indication to terminate the trajectory. The detailed behavior of Kimi-Researcher is as follows: \begin{cases} (s_t) \xrightarrow{\text{Kimi-Researcher}} (\text{think}_t, \text{action}_t) \\ s_{t+1} = \text{context_manager}(s_t, \text{think}_t, \text{tool_call_result}_t) &amp;amp; \text{if } \text{action}_t \neq \text{finish} \\ \text{terminate} &amp;amp; \text{if } \text{action}_t = \text{finish} \end{cases}&lt;/p&gt;
&lt;p&gt;Traditional agent development has key limitations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Workflow-Based Systems:&lt;/strong&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.anthropic.com/engineering/built-multi-agent-research-system&quot;&gt;Multi-agent workflows&lt;/a&gt; assign roles to specialized agents and coordinate the agents using prompt-based workflows. While effective, they are tied to specific LLM versions and need frequent manual updates as models or environments change, reducing scalability and flexibility.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Imitation Learning with Supervised Finetuning (SFT):&lt;/strong&gt; Imitation learning aligns models well with human demonstrations but struggles with data labeling—especially for long-horizon, agentic tasks in dynamic environments. Furthermore, SFT datasets are tightly coupled with specific tool versions, resulting in poor generalization as tools evolve.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;End-to-end agentic reinforcement learning trains a single model to solve problems holistically: given a query, the agent explores a large number of possible strategies, receives rewards for correct solutions, and learns from the full trajectory. Unlike SFT, it naturally handles long, on-policy reasoning and adapts to changing tools and environments; unlike modular approaches, all skills—planning, perception, and tool use—are learned together without hand-crafted rules or workflow templates. Previous work like &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://openai.com/index/introducing-deep-research/&quot;&gt;OpenAI&#39;s Deep Research&lt;/a&gt; also highlights the strong performance of this approach, but it introduces new challenges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dynamic Environments:&lt;/strong&gt; Agents must adapt to constantly changing conditions, as even identical queries can yield different results over time. The goal is robust generalization despite distribution shifts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Long-Horizon Tasks:&lt;/strong&gt; Kimi-Researcher can run 70+ search queries per trajectory, with context windows reaching hundreds of thousands of tokens. This demands advanced memory management and long-context models.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Scarcity:&lt;/strong&gt; High-quality RL datasets for agentic QA are rare. We address this by automatically synthesizing training data, allowing large-scale learning without manual labeling.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollout Efficiency:&lt;/strong&gt; Multi-turn reasoning and heavy tool use can slow training and cause GPU under-utilization. Optimizing rollout efficiency is crucial for scalable, practical agent RL training.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;* calculated based on a small set of queries.&lt;/p&gt;
&lt;h3&gt;Approach&lt;/h3&gt;
&lt;p&gt;Kimi-Researcher is trained via end-to-end reinforcement learning. We observe a consistent improvement in agent performance across different domains. &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://moonshotai.github.io/Kimi-Researcher/#figure-2-a&quot;&gt;Figure 2-a&lt;/a&gt; illustrates the overall training accuracy of Kimi-Researcher throughout the reinforcement learning process. &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://moonshotai.github.io/Kimi-Researcher/#figure-2-b&quot;&gt;Figure 2-b&lt;/a&gt; presents model performance on several internal datasets.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/2-a.svg&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 2-a&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/2-b.svg&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 2-b&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;Training data&lt;/h4&gt;
&lt;p&gt;To address the scarcity of high-quality agentic datasets, we engineered our training corpus with two complementary objectives.&lt;/p&gt;
&lt;p&gt;First, we developed a suite of challenging, tool-centric tasks designed to promote robust tool-use learning. These prompts are deliberately constructed such that solving the task requires invoking specific tools—making naive approaches either infeasible or substantially less efficient. By embedding tool dependencies into task design, the agent learns not only when to invoke a tool, but also how to orchestrate tool use effectively in complex, real-world settings. (See &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://moonshotai.github.io/Kimi-Researcher/#figure-3&quot;&gt;Figure 3&lt;/a&gt; for tool invocation rates using these training data.)&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/3.svg&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 3&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/4.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 4&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Second, we curated and synthesized reasoning-intensive tasks to reinforce the agent&#39;s core cognitive abilities and its capacity to integrate reasoning with tool usage. This component is further subdivided into:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Math and Code Reasoning:&lt;/strong&gt; Tasks that target logical inference, algorithmic problem-solving, and sequential computation. Kimi-Researcher learns to solve this kind of problem with our toolset beyond purely using chain-of-thought.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hard Search:&lt;/strong&gt; Scenarios where the agent must iteratively search, synthesize, and reason within context constraints to derive valid answers. Case studies illustrate how these hard search tasks drive the emergence of deeper planning and robust, tool-augmented reasoning strategies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To build this diverse prompt set at scale, we developed a &lt;strong&gt;fully automated pipeline&lt;/strong&gt; capable of generating and validating many question-answer pairs with &lt;strong&gt;minimal manual intervention&lt;/strong&gt;, ensuring both diversity and correctness at unprecedented scale. &lt;strong&gt;Ensuring accurate ground truth (GT) is critical for synthetic tasks&lt;/strong&gt;, so we introduced a robust GT extraction method to guarantee that each question is paired with a reliable answer whenever possible. Additionally, a rigorous filtering funnel removes ambiguous, trivial, or incorrect pairs — with &lt;strong&gt;Pass@N checks ensuring only non-trivial questions are retained&lt;/strong&gt;. &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://moonshotai.github.io/Kimi-Researcher/#figure-4&quot;&gt;Figure 4&lt;/a&gt; shows the effectiveness of our synthetic tasks based on two experimental results.&lt;/p&gt;
&lt;h4&gt;RL training&lt;/h4&gt;
&lt;p&gt;The model is primarily trained using the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://link.springer.com/content/pdf/10.1007/BF00992696.pdf&quot;&gt;REINFORCE&lt;/a&gt; algorithm. We have observed that the following factors contribute to more stable training:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;On-policy Training:&lt;/strong&gt; It is critical to generate strict on-policy data. During training, we disable LLM engine mechanisms like toolcall format enforcers to ensure each trajectory is generated entirely based on the model&#39;s own probability distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Negative Sample Control:&lt;/strong&gt; Negative samples lead to a decrease in token probabilities, which increases the risk of entropy collapse during RL training. To address this, we discard some negative samples strategically, allowing the model to continue improving over a longer training period.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Kimi-Researcher uses outcome rewards for training, aiming to provide a constant preference in a dynamic training environment.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Format Reward:&lt;/strong&gt; The model is penalized for trajectories that include invalid tool calls or if the context/iteration exceeds the maximum limitation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Correctness Reward:&lt;/strong&gt; For trajectories without format errors, rewards are based on the comparison between the model&#39;s answer and the ground truth.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To promote efficiency, a gamma-decay factor is applied to correct trajectories. Concretely, the reward of step \(i\) becomes \(r\times\gamma^{T - i}\), where \(r\) is the outcome reward, \(T\) is the number of steps, and \(0&amp;lt;\gamma&amp;lt;1\) represents the gamma-decay coeficient. This encourages the model to discover shorter, more efficient exploration. For example, while two correct trajectories may receive equal final rewards, the shorter one earns a higher reward for its initial actions.&lt;/p&gt;
&lt;h4&gt;Context management&lt;/h4&gt;
&lt;p&gt;A long-horizon research trajectory may involve massive observation contexts, and a naive agent without memory management can easily exceed the limitation within 10 iterations. To address this, we design a context-management mechanism that allows the model to retain important information while discarding unnecessary documents, thereby extending a single rollout trajectory to over 50 iterations. An early ablation study shows that a model trained with context management uses &lt;strong&gt;30%&lt;/strong&gt; more iterations, which enables it to acquire more information and achieve higher performance.&lt;/p&gt;
&lt;h4&gt;Large-scale agent RL infra&lt;/h4&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://moonshotai.github.io/Kimi-Researcher/assets/figure/5.png&quot; alt=&quot;Large-scale agent RL infrastructure&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Figure 5&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To address the efficiency and stability challenges of large-scale Agent RL, we have developed a suite of infrastructure with the following key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fully asynchronous rollout:&lt;/strong&gt; We implement a fully asynchronous rollout system with extensible Gym-like interfaces. The server-based architecture efficiently orchestrates actor rollouts, environmental interactions, and reward calculations in parallel. This design significantly outperforms its synchronous counterpart by eliminating resource idle time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Turn-level partial rollout:&lt;/strong&gt; During Agent RL, while the majority of tasks completed at the early stage, a small fraction required extensive turns. To solve this long-tail problem, we designed a Turn-level Partial Rollout mechanism. Concretely, tasks that exceed a time budget would be saved to a replay buffer. In subsequent iterations, the remaining turns would be executed with updated model weights. Combined with adapted algorithms, this mechanism delivers substantial rollout acceleration (at least 1.5x).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Robust sandbox environment:&lt;/strong&gt; Our unified sandbox architecture eliminates inter-container overhead while maintaining isolation. Zero-downtime scheduling with Kubernetes-based hybrid cloud architecture enables dynamic resource allocation. Agent-tool communication via Model Context Protocol (MCP) maintains stateful sessions with reconnection capabilities. Our implementation supports multi-replica deployment, ensuring fault-tolerant operation and high availability in production environments.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Emerging agentic capacities&lt;/h3&gt;
&lt;p&gt;During end-to-end reinforcement learning, we observed several notable emergent abilities in Kimi-Researcher. Here are two highlights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When presented with conflicting information from multiple sources, Kimi-Researcher resolves inconsistencies through iterative hypothesis refinement and self-correction.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;quot;Strange Stories from a Chinese Studio&amp;quot; is a collection of classical Chinese short stories written by the Qing Dynasty novelist Pu Songling. The earliest manuscript copies were already in circulation during the Kangxi reign of the Qing Dynasty, and the collection comprises over four hundred short stories in total. In Volume Ten of &amp;quot;Strange Stories from a Chinese Studio,&amp;quot; there is a story titled &amp;quot;The Green-Clothed Girl.&amp;quot; In this story, **how many sentences did the scholar Yu Jing speak with her?**&lt;/p&gt;
&lt;p&gt;...Now I will use the search tool. ...Numbers [^5^] and [^6^] are **vernacular translations from Himalaya**...In addition, numbers [^16^] and [^17^] are **the original texts**, I need to cross-reference them again...The dialogue between Yu Jing and the woman in green may have different records in **different versions**... ...I counted carefully, and in the vernacular translation of number [^5^], Yu Jing seems to have said **six sentences**. But in the original texts of numbers [^16^], [^44^], [^48^], etc., counting them up, Yu Jing said **four sentences**...Well, according to my previous compilation, numbers [^68^], [^88^], [^89^], [^90^], etc. all provide the original text of &amp;quot;The Woman in Green&amp;quot;...So, Yu Jing said a total of four sentences. Previously, when I counted six sentences in the translation of number [^5^], it may be because the translation converted some narrative sentences into direct quotations... ...Considering that in classical Chinese, these direct quotations are explicit, while if the translation added some dialogue, it may have been embellishment done for ease of understanding... ...After careful verification, the words Yu Jing directly said in the original text are: 1. &amp;quot;Your voice is delicate and soft, if you were to sing a song, it would surely be soul-stirring.&amp;quot; 2. &amp;quot;Why are you so deeply suspicious and fearful?&amp;quot; 3. &amp;quot;A stirring heart and wandering eyes are common occurrences, why do you say such things?&amp;quot; 4. &amp;quot;Yes.&amp;quot; Therefore, Yu Jing spoke a total of four sentences in the story. **Previously, in the translation of number [^5^], I mistakenly took some narrative sentences as dialogue, leading to a miscount. After confirmation, the original classical Chinese text is authoritative and has been verified multiple times.** It seems that in &amp;quot;The Woman in Green,&amp;quot; Yu Jing indeed said four sentences. I think I can answer this question now. Answer: **4** In &amp;quot;The Woman in Green&amp;quot; from Volume 10 of &amp;quot;Strange Tales from a Chinese Studio,&amp;quot; the scholar Yu Jing spoke a total of **4** sentences.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kimi-Researcher demonstrates caution and rigor: even for seemingly straightforward questions, it deliberately performs additional searches and cross-validates information before answering.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A country located in South America, where the most popular sport is baseball, not football. Football is relatively less popular in this country, which has never qualified for the FIFA World Cup finals but has hosted the Copa América. In terms of football, the country has had a star player who once played in the Bundesliga. Who might that be?&lt;/p&gt;
&lt;p&gt;...From the previous search results, I can infer: This South American country is **Venezuela**. Its most popular sport is baseball. It has never entered the World Cup finals. It hosted the Copa América (2007). Football star **Juan Arango** once played for Borussia Mönchengladbach in the Bundesliga. To confirm whether Juan Arango is a Venezuelan football star who once played in the Bundesliga, I... ...To further confirm, I want to search for more information about Juan Arango to verify... ...I previously assumed it was Venezuela, but need further verification... ...To further confirm the accuracy of the information...need to re-verify. ...Additionally, I also need to search for other players who might fit, perhaps whether Venezuelan players like Caracas, Torres, Maldonado, etc. have ever played in the Bundesliga...covering information in both Chinese and English to improve the comprehensiveness of the search. ...According to the information from references [^62^] and [^66^]...this information all supports that **Juan Fernando Arango** is Venezuela&#39;s star player in football who once played in the Bundesliga. Combined with the previous search results... To obtain more official and authoritative information for further confirmation, I decided to call up the complete content of reference [^62^]...I now feel that I have collected enough information to answer this question completely. Answer: **Juan Fernando Arango**&lt;/p&gt;
&lt;h3&gt;Use cases&lt;/h3&gt;
&lt;h3&gt;What&#39;s next&lt;/h3&gt;
&lt;p&gt;Kimi-Researcher is beginning its gradual rollout to users today. It empowers you to conduct deep, comprehensive research on any topic directly within &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.kimi.com/&quot;&gt;Kimi&lt;/a&gt;. Join the waitlist &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://forms.gle/CRcZGWKAoYNsMjad8&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It represents the early stage of our broader vision: evolving from a focused search and reasoning agent into a general-purpose agent capable of solving a wide range of complex tasks with an ever-expanding toolkit. To realize this vision, we are expanding the agent&#39;s capabilities across both tools and task domains, while also advancing the underlying reinforcement learning infrastructure and algorithms to ensure greater training stability and efficiency.&lt;/p&gt;
&lt;p&gt;To facilitate more research efforts in the field, we are planning on open-sourcing the base pretrained model as well as the reinforcement-learned model underlying Kimi-Researcher in the following months.&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:5343bfc8c7dbbb043385827d672443c981572285</id>
    <title type="text">Kimi-Dev</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-06-17-kimi-dev/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Kimi-Dev"/>
    <published>2025-06-17T00:00:00+00:00</published>
    <updated>2025-06-17T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-06-17</summary>
    <content type="html">&lt;p&gt;We introduce Kimi-Dev-72B, our new open-source coding LLM for software engineering tasks. Kimi-Dev-72B achieves a new state-of-the-art on SWE-bench Verified among open-source models.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Kimi-Dev-72B achieves 60.4% performance on SWE-bench Verified. It surpasses the runner-up, setting a new state-of-the-art result among open-source models.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Kimi-Dev-72B is optimized via large-scale reinforcement learning. It autonomously patches real repositories in Docker and gains rewards only when the entire test suite passes. This ensures correct and robust solutions, aligning with real-world development standards.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Kimi-Dev-72B is available for download and deployment on Hugging Face and GitHub. We welcome developers and researchers to explore its capabilities and contribute to development.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Dev/blob/master/assets/open_performance_white.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-Dev/raw/master/assets/open_performance_white.png&quot; alt=&quot;Kimi Logo&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Performance of Open-source Models on SWE-bench Verified.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;⚙️ Installation&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; clone repo&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;git&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; clone https://github.com/MoonshotAI/Kimi-Dev.git&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; create env&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;conda&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; create&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;n&lt;/span&gt; kimidev python=3.12&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; local install&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;e&lt;/span&gt; .&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;🛠️ How to use&lt;/h2&gt;
&lt;h3&gt;Prepare repo structure [From &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/OpenAutoCoder/Agentless/&quot;&gt;Agentless&lt;/a&gt;]&lt;/h3&gt;
&lt;p&gt;Since for each issue in the benchmark (both SWE-Bench Lite and SWE-Bench Verified) we need to checkout the repository and process the files, you might want to save some time by downloading the preprocessed data here: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://drive.google.com/file/d/15-4XjTmY48ystrsc_xcvtOkMs3Fx8RoW/view&quot;&gt;swebench_repo_structure.zip&lt;/a&gt;. After downloading, please unzip and export the location as such&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-storage syntax-modifier syntax-shell&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-other syntax-readwrite syntax-assignment syntax-shell&quot;&gt;PROJECT_FILE_LOC&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-shell&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-string syntax-unquoted syntax-shell&quot;&gt;&lt;span class=&quot;syntax-meta syntax-group syntax-expansion syntax-brace syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-expansion syntax-brace syntax-begin syntax-shell&quot;&gt;{&lt;/span&gt;folder which you saved&lt;span class=&quot;syntax-punctuation syntax-section syntax-expansion syntax-brace syntax-end syntax-shell&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Deploy vLLM Model&lt;/h3&gt;
&lt;h4&gt;Installation&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;# Install vLLM with CUDA 12.8.
# If you are using pip.
pip install vllm --extra-index-url https://download.pytorch.org/whl/cu128
# If you are using uv.
uv pip install vllm --torch-backend=auto
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Serving&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;vllm serve Kimi-Dev-72B --served-model-name kimi-dev --host 0.0.0.0 --port 8000 --gpu-memory-utilization 0.95 --max-seq-len-to-capture 131072 --tensor-parallel-size 8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Rollout&lt;/h3&gt;
&lt;p&gt;Kimi-Dev adopts a simplified two-stage framework for handling code repair and test writing tasks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;File Localization&lt;/strong&gt;: Intelligently identify key files that need modification based on problem descriptions and repository structure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Editing&lt;/strong&gt;: Perform precise code modifications on the located files, including bug fixes or unit test insertions&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Compared to multi-step localization methods, we perform localization at the file level and then pass the complete file to the repair step for more detailed reasoning.&lt;/p&gt;
&lt;p&gt;Run rollout script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;conda activate kimidev
# Bugfixer
python kimidev/examples/rollout_messages_bugfixer.py --model_name {vllm_serve_model}
# Testwriter
python kimidev/examples/rollout_messages_testwriter.py --model_name {vllm_serve_model}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;👀 Example Results&lt;/h2&gt;
&lt;p&gt;We provide some example result files as well as the files required for test-time scaling &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Dev/blob/master/resources&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also download these files from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://drive.google.com/file/d/1Tv4u9_CjCAOIhyZC1pOmpHFx3q0Ui8ru/view?usp=drive_link&quot;&gt;Google Drive&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;💪 Contributing&lt;/h2&gt;
&lt;p&gt;Welcome to submit Pull Requests or create Issues to help improve the project.&lt;/p&gt;
&lt;h2&gt;😺 Contact&lt;/h2&gt;
&lt;p&gt;If you have any questions, please feel free to submit a GitHub issue or contact &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;mailto:zhuhan@moonshot.cn&quot;&gt;zhuhan@moonshot.cn&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;📝 Citation&lt;/h2&gt;
&lt;p&gt;If you find our code and models useful, please kindly cite the following information.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@misc{yang2025kimidevagentlesstrainingskill,
      title={Kimi-Dev: Agentless Training as Skill Prior for SWE-Agents}, 
      author={Zonghan Yang and Shengjie Wang and Kelin Fu and Wenyang He and Weimin Xiong and Yibo Liu and Yibo Miao and Bofei Gao and Yejie Wang and Yingwei Ma and Yanhao Li and Yue Liu and Zhenxing Hu and Kaitai Zhang and Shuyi Wang and Huarong Chen and Flood Sung and Yang Liu and Yang Gao and Zhilin Yang and Tianyu Liu},
      year={2025},
      eprint={2509.23045},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2509.23045}, 
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:ec8df625def3c9440551795eb8a41a9109ac6c46</id>
    <title type="text">Kimi-Audio</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-04-26-kimi-audio/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Kimi-Audio"/>
    <published>2025-04-26T00:00:00+00:00</published>
    <updated>2025-04-26T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-04-26</summary>
    <content type="html">&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio/blob/master/assets/kimia_logo.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-Audio/raw/master/assets/kimia_logo.png&quot; alt=&quot;&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kimi-Audio-7B &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-Audio-7B&quot;&gt;🤗&lt;/a&gt;  | Kimi-Audio-7B-Instruct &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-Audio-7B-Instruct&quot;&gt;🤗&lt;/a&gt;  | 📑 &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/pdf/2504.18425&quot;&gt;Paper&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We present Kimi-Audio, an open-source audio foundation model excelling in &lt;strong&gt;audio understanding, generation, and conversation&lt;/strong&gt;. This repository contains the official implementation, models, and evaluation toolkit for Kimi-Audio.&lt;/p&gt;
&lt;h2&gt;🔥🔥🔥 News!!&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;May 29, 2025: 👋 We release a finetuning example of &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio/tree/master/finetune_codes&quot;&gt;Kimi-Audio-7B&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;April 27, 2025: 👋 We release pretrained model weights of &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-Audio-7B&quot;&gt;Kimi-Audio-7B&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;April 25, 2025: 👋 We release the inference code and model weights of &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-Audio-7B-Instruct&quot;&gt;Kimi-Audio-7B-Instruct&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;April 25, 2025: 👋 We release the audio evaluation toolkit &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio-Evalkit&quot;&gt;Kimi-Audio-Evalkit&lt;/a&gt;. We can easily reproduce the &lt;strong&gt;our results and baselines&lt;/strong&gt; by this toolkit!&lt;/li&gt;
&lt;li&gt;April 25, 2025: 👋 We release the technical report of &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/pdf/2504.18425&quot;&gt;Kimi-Audio&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#architecture-overview&quot;&gt;Architecture Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#quick-start&quot;&gt;Quick Start&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#evaluation&quot;&gt;Evaluation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#automatic-speech-recognition-asr&quot;&gt;Speech Recognition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#audio-understanding&quot;&gt;Audio Understanding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#audio-to-text-chat&quot;&gt;Audio-to-Text Chat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#speech-conversation&quot;&gt;Speech Conversation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#finetune&quot;&gt;Finetune&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#evaluation-toolkit&quot;&gt;Evaluation Toolkit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#generation-testset&quot;&gt;Generation Testset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#license&quot;&gt;License&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#acknowledgements&quot;&gt;Acknowledgements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#citation&quot;&gt;Citation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#contact-us&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Kimi-Audio is designed as a universal audio foundation model capable of handling a wide variety of audio processing tasks within a single unified framework. Key features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Universal Capabilities:&lt;/strong&gt; Handle diverse tasks like automatic speech recognition (ASR), audio question answering (AQA), automatic audio captioning (AAC), speech emotion recognition (SER), sound event/scene classification (SEC/ASC), and end-to-end speech conversation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State-of-the-Art Performance:&lt;/strong&gt; Achieve SOTA results on numerous audio benchmarks (see &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#evaluation&quot;&gt;Evaluation&lt;/a&gt; and the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/pdf/2504.18425&quot;&gt;Technical Report&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Large-Scale Pre-training:&lt;/strong&gt; Pre-train on over 13 million hours of diverse audio data (speech, music, sounds) and text data, enabling robust audio reasoning and language understanding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Novel Architecture:&lt;/strong&gt; Employ a hybrid audio input (continuous acoustic vectors + discrete semantic tokens) and an LLM core with parallel heads for text and audio token generation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Efficient Inference:&lt;/strong&gt; Feature a chunk-wise streaming detokenizer based on flow matching for low-latency audio generation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open-Source:&lt;/strong&gt; Release the code and model checkpoints for both pre-training and instruction fine-tuning, and release a comprehensive evaluation toolkit to foster community research and development.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Architecture Overview&lt;/h2&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio/blob/master/assets/kimia_framework.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-Audio/raw/master/assets/kimia_framework.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kimi-Audio consists of three main components:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Audio Tokenizer:&lt;/strong&gt; Converts input audio into:
&lt;ul&gt;
&lt;li&gt;Discrete semantic tokens (12.5Hz) using vector quantization.&lt;/li&gt;
&lt;li&gt;Continuous acoustic features derived from a Whisper encoder (downsampled to 12.5Hz).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audio LLM:&lt;/strong&gt; A transformer-based model (initialized from a pre-trained text LLM like Qwen 2.5 7B) with shared layers processing multimodal inputs, followed by parallel heads for autoregressively generating text tokens and discrete audio semantic tokens.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audio Detokenizer:&lt;/strong&gt; Converts the predicted discrete semantic audio tokens back into high-fidelity waveforms using a flow-matching model and a vocoder (BigVGAN), supporting chunk-wise streaming with a look-ahead mechanism for low latency.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Getting Started&lt;/h2&gt;
&lt;h3&gt;Step1: Get the Code&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;git&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; clone https://github.com/MoonshotAI/Kimi-Audio.git&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-cd syntax-shell&quot;&gt;cd&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; Kimi-Audio&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;git&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; submodule update&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;init&lt;/span&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;recursive&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;r&lt;/span&gt; requirements.txt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Kimi‑Audio can now be installed directly via &lt;strong&gt;pip&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install torch&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install git+https://github.com/MoonshotAI/Kimi-Audio.git&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;This example demonstrates basic usage for generating text from audio (ASR) and generating both text and speech in a conversational turn.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;soundfile&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-as syntax-python&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sf&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;kimia_infer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;api&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;kimia&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;KimiAudio&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; --- 1. Load Model ---
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Kimi-Audio-7B-Instruct&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;KimiAudio&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;load_detokenizer&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; --- 2. Define Sampling Parameters ---
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sampling_params&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio_temperature&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;0&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;8&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio_top_k&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text_temperature&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;0&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text_top_k&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio_repetition_penalty&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;1&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio_repetition_window_size&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text_repetition_penalty&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;1&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text_repetition_window_size&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; --- 3. Example 1: Audio-to-Text (ASR) ---
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages_asr&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; You can provide context or instructions as text
&lt;/span&gt;    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Please transcribe the following audio:&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Provide the audio file path
&lt;/span&gt;    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;test_audios/asr_example.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Generate only text output
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-language syntax-python&quot;&gt;_&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages_asr&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-unpacking syntax-mapping syntax-python&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sampling_params&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;output_type&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; ASR Output Text: &lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Expected output: &amp;quot;这并不是告别，这是一个篇章的结束，也是新篇章的开始。&amp;quot;
&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; --- 4. Example 2: Audio-to-Audio/Text Conversation ---
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages_conversation&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Start conversation with an audio query
&lt;/span&gt;    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;test_audios/qa_example.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Generate both audio and text output
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;wav_output&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages_conversation&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-unpacking syntax-mapping syntax-python&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sampling_params&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;output_type&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;both&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Save the generated audio
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;output_audio.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sf&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;write&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;wav_output&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;detach&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;view&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;numpy&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;24000&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Assuming 24kHz output
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-storage syntax-type syntax-string syntax-python&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; Conversational Output Audio saved to: &lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-source syntax-python syntax-embedded&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; Conversational Output Text: &lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Expected output: &amp;quot;当然可以，这很简单。一二三四五六七八九十。&amp;quot;
&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; --- 5. Example 3: Audio-to-Audio/Text Conversation with Multiturn ---
&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;test_audios/multiturn/case2/multiturn_q1.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; This is the first turn output of Kimi-Audio
&lt;/span&gt;    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;assistant&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio-text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;test_audios/multiturn/case2/multiturn_a1.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;当然可以，这很简单。一二三四五六七八九十。&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;message_type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;audio&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;test_audios/multiturn/case2/multiturn_q2.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;wav&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-unpacking syntax-mapping syntax-python&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sampling_params&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;output_type&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;both&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;


&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Generate both audio and text output
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;wav_output&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages_conversation&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-unpacking syntax-mapping syntax-python&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sampling_params&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;output_type&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;both&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Save the generated audio
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;output_audio.wav&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;sf&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;write&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;wav_output&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;detach&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;view&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;numpy&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;24000&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Assuming 24kHz output
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-storage syntax-type syntax-string syntax-python&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; Conversational Output Audio saved to: &lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-source syntax-python syntax-embedded&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;output_audio_path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; Conversational Output Text: &lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text_output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; Expected output: &amp;quot;没问题，继续数下去就是十一十二十三十四十五十六十七十八十九二十。&amp;quot;
&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Kimi-Audio inference examples complete.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Evaluation&lt;/h2&gt;
&lt;p&gt;Kimi-Audio achieves state-of-the-art (SOTA) performance across a wide range of audio benchmarks.&lt;/p&gt;
&lt;p&gt;The below is the overall performance:&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio/blob/master/assets/kimia_radar_chart.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-Audio/raw/master/assets/kimia_radar_chart.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here are performances on different benchmarks, you can easily reproduce the &lt;strong&gt;our results and baselines&lt;/strong&gt; by our &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio-Evalkit&quot;&gt;Kimi-Audio-Evalkit&lt;/a&gt; (also see &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio#evaluation-toolkit&quot;&gt;&lt;strong&gt;Evaluation Toolkit&lt;/strong&gt;&lt;/a&gt;):&lt;/p&gt;
&lt;h3&gt;Automatic Speech Recognition (ASR)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Datasets&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Performance (WER↓)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LibriSpeech&lt;/strong&gt; test-clean | test-other&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;1.74 | 4.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;3.02 | 6.04&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;3.19 | 10.67&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;2.37 | 4.21&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.28&lt;/strong&gt; | &lt;strong&gt;2.42&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Fleurs&lt;/strong&gt; zh | en&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;3.63 | 5.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;4.15 | 8.07&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;4.26 | 8.56&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;2.92 | &lt;strong&gt;4.17&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.69&lt;/strong&gt; | 4.44&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AISHELL-1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;1.52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;1.93&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;2.14&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;1.13&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.60&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AISHELL-2&lt;/strong&gt; ios&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;3.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;3.87&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;3.89&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.56&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.56&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WenetSpeech&lt;/strong&gt; test-meeting | test-net&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;8.40 | 7.64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;13.28 | 10.13&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;10.83 | 9.47&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;7.71 | 6.04&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6.28&lt;/strong&gt; | &lt;strong&gt;5.37&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Kimi-ASR Internal Testset&lt;/strong&gt; subset1 | subset2&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;2.31 | 3.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;3.41 | 5.60&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;2.82 | 4.74&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;1.53 | 2.68&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.42&lt;/strong&gt; | &lt;strong&gt;2.44&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Audio Understanding&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Datasets&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Performance↑&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MMAU&lt;/strong&gt; music | sound | speech&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;58.98 | 69.07 | 52.55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;49.10 | 59.46 | 42.47&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-4-Voice&lt;/td&gt;
&lt;td&gt;38.92 | 43.54 | 32.43&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;49.40 | 53.75 | 47.75&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;62.16&lt;/strong&gt; | 67.57 | 53.92&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;61.68 | &lt;strong&gt;73.27&lt;/strong&gt; | &lt;strong&gt;60.66&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ClothoAQA&lt;/strong&gt; test | dev&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;71.73 | 72.63&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;48.02 | 48.16&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;45.84 | 44.98&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;72.86&lt;/strong&gt; | 73.12&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;71.24 | &lt;strong&gt;73.18&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VocalSound&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;93.82&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;58.17&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;28.58&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;93.73&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;94.85&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nonspeech7k&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;87.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;59.03&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;21.38&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;69.89&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;93.93&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MELD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;51.23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;23.59&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;33.54&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;49.83&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;59.13&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TUT2017&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;33.83&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;27.9&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;7.41&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;43.27&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;65.25&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CochlScene&lt;/strong&gt; test | dev&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-base&lt;/td&gt;
&lt;td&gt;52.69 | 50.96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-base&lt;/td&gt;
&lt;td&gt;34.93 | 34.56&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;10.06 | 10.42&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;63.82 | 63.82&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;79.84&lt;/strong&gt; | &lt;strong&gt;80.99&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Audio-to-Text Chat&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Datasets&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Performance↑&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenAudioBench&lt;/strong&gt; AlpacaEval | Llama Questions | Reasoning QA | TriviaQA | Web Questions&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-chat&lt;/td&gt;
&lt;td&gt;57.19 | 69.67 | 42.77 | 40.30 | 45.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;59.65 | 74.33 | 46.73 | 55.40 | 58.70&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-4-Voice&lt;/td&gt;
&lt;td&gt;57.89 | 76.00 | 47.43 | 51.80 | 55.40&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StepAudio-chat&lt;/td&gt;
&lt;td&gt;56.53 | 72.33 | 60.00 | 56.80 | &lt;strong&gt;73.00&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;72.76 | 75.33 | &lt;strong&gt;63.76&lt;/strong&gt; | 57.06 | 62.80&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;75.73&lt;/strong&gt; | &lt;strong&gt;79.33&lt;/strong&gt; | 58.02 | &lt;strong&gt;62.10&lt;/strong&gt; | 70.20&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VoiceBench&lt;/strong&gt; AlpacaEval | CommonEval | SD-QA | MMSU&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-chat&lt;/td&gt;
&lt;td&gt;3.69 | 3.40 | 35.35 | 35.43&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;4.00 | 3.39 | 49.64 | 48.80&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-4-Voice&lt;/td&gt;
&lt;td&gt;4.06 | 3.48 | 43.31 | 40.11&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StepAudio-chat&lt;/td&gt;
&lt;td&gt;3.99 | 2.99 | 46.84 | 28.72&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;4.33 | 3.84 | 57.41 | 56.38&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.46&lt;/strong&gt; | &lt;strong&gt;3.97&lt;/strong&gt; | &lt;strong&gt;63.12&lt;/strong&gt; | &lt;strong&gt;62.17&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VoiceBench&lt;/strong&gt; OpenBookQA | IFEval | AdvBench | Avg&lt;/td&gt;
&lt;td&gt;Qwen2-Audio-chat&lt;/td&gt;
&lt;td&gt;49.01 | 22.57 | 98.85 | 54.72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baichuan-chat&lt;/td&gt;
&lt;td&gt;63.30 | 41.32 | 86.73 | 62.51&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-4-Voice&lt;/td&gt;
&lt;td&gt;52.97 | 24.91 | 88.08 | 57.17&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StepAudio-chat&lt;/td&gt;
&lt;td&gt;31.87 | 29.19 | 65.77 | 48.86&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen2.5-Omni&lt;/td&gt;
&lt;td&gt;79.12 | 53.88 | 99.62 | 72.83&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;83.52&lt;/strong&gt; | &lt;strong&gt;61.10&lt;/strong&gt; | &lt;strong&gt;100.00&lt;/strong&gt; | &lt;strong&gt;76.93&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Speech Conversation&lt;/h3&gt;
&lt;p&gt;Performance of Kimi-Audio and baseline models on speech conversation.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Ability&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-4o&lt;/td&gt;
&lt;td&gt;4.21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.65&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4.05&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.87&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.54&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.06&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step-Audio-chat&lt;/td&gt;
&lt;td&gt;3.25&lt;/td&gt;
&lt;td&gt;2.87&lt;/td&gt;
&lt;td&gt;3.33&lt;/td&gt;
&lt;td&gt;3.05&lt;/td&gt;
&lt;td&gt;4.14&lt;/td&gt;
&lt;td&gt;3.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-4-Voice&lt;/td&gt;
&lt;td&gt;3.83&lt;/td&gt;
&lt;td&gt;3.51&lt;/td&gt;
&lt;td&gt;3.77&lt;/td&gt;
&lt;td&gt;3.07&lt;/td&gt;
&lt;td&gt;4.04&lt;/td&gt;
&lt;td&gt;3.65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-4o-mini&lt;/td&gt;
&lt;td&gt;3.15&lt;/td&gt;
&lt;td&gt;2.71&lt;/td&gt;
&lt;td&gt;4.24&lt;/td&gt;
&lt;td&gt;3.16&lt;/td&gt;
&lt;td&gt;4.01&lt;/td&gt;
&lt;td&gt;3.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-Audio&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.30&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3.45&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.27&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3.39&lt;/td&gt;
&lt;td&gt;4.09&lt;/td&gt;
&lt;td&gt;3.90&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Finetune&lt;/h2&gt;
&lt;p&gt;We release the pre-trained model and the lightweight finetune codes. Please refer to the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio/blob/master/finetune_codes/README.md&quot;&gt;finetune_codes/README.md&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h2&gt;Evaluation Toolkit&lt;/h2&gt;
&lt;p&gt;Evaluating and comparing audio foundation models is challenging due to inconsistent metrics, varying inference configurations, and a lack of standardized generation evaluation. To address this, we developed and open-sourced an &lt;strong&gt;Evaluation Toolkit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Integrates Kimi-Audio and other recent audio LLMs.&lt;/li&gt;
&lt;li&gt;Implements standardized metric calculation and integrates LLMs for intelligent judging (e.g., for AQA).&lt;/li&gt;
&lt;li&gt;Provides a unified platform for side-by-side comparisons with shareable inference &#39;recipes&#39; for reproducibility.&lt;/li&gt;
&lt;li&gt;Includes a benchmark for evaluating speech conversation abilities (control, empathy, style).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We encourage the community to use and contribute to this toolkit to foster more reliable and comparable benchmarking. Find it here: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-Audio-Evalkit&quot;&gt;Kimi-Audio-Evalkit&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Generation Testset&lt;/h2&gt;
&lt;p&gt;We collect and release &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/datasets/moonshotai/Kimi-Audio-GenTest&quot;&gt;Kimi-Audio-Generation-Testset&lt;/a&gt;, which is designed to benchmark and evaluate the conversational capabilities of audio-based dialogue models. It consists of a collection of audio files containing various instructions and conversational prompts. The primary goal is to assess a model&#39;s ability to generate not just relevant, but also appropriately styled audio responses. The language in dataset is Chinese.&lt;/p&gt;
&lt;h2&gt;License&lt;/h2&gt;
&lt;p&gt;The model is based and modified from &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/QwenLM/Qwen2.5&quot;&gt;Qwen 2.5-7B&lt;/a&gt;. Code derived from Qwen2.5-7B is licensed under the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://www.apache.org/licenses/LICENSE-2.0&quot;&gt;Apache 2.0 License&lt;/a&gt;. Other parts of the code are licensed under the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://opensource.org/licenses/MIT&quot;&gt;MIT License&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;We would like to thank the following projects and individuals for their contributions to the development of Kimi-Audio:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/openai/whisper&quot;&gt;Whisper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/huggingface/transformers&quot;&gt;Transformers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/NVIDIA/BigVGAN&quot;&gt;BigVGAN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/THUDM/GLM-4-Voice&quot;&gt;GLM-4-Voice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/QwenLM/Qwen/tree/main&quot;&gt;Qwen&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you to all the open-source projects for their contributions to this project!&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;p&gt;If you find Kimi-Audio useful in your research or applications, please cite our technical report:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text-bibtex&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Text-bibtex&quot;&gt;@misc{kimiteam2025kimiaudiotechnicalreport,
      title={Kimi-Audio Technical Report}, 
      author={KimiTeam and Ding Ding and Zeqian Ju and Yichong Leng and Songxiang Liu and Tong Liu and Zeyu Shang and Kai Shen and Wei Song and Xu Tan and Heyi Tang and Zhengtao Wang and Chu Wei and Yifei Xin and Xinran Xu and Jianwei Yu and Yutao Zhang and Xinyu Zhou and Y. Charles and Jun Chen and Yanru Chen and Yulun Du and Weiran He and Zhenxing Hu and Guokun Lai and Qingcheng Li and Yangyang Liu and Weidong Sun and Jianzhou Wang and Yuzhi Wang and Yuefeng Wu and Yuxin Wu and Dongchao Yang and Hao Yang and Ying Yang and Zhilin Yang and Aoxiong Yin and Ruibin Yuan and Yutong Zhang and Zaida Zhou},
      year={2025},
      eprint={2504.18425},
      archivePrefix={arXiv},
      primaryClass={eess.AS},
      url={https://arxiv.org/abs/2504.18425}, 
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Contact Us&lt;/h2&gt;
&lt;p&gt;For questions, issues, or collaboration inquiries, please feel free to open an issue on GitHub.&lt;/p&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:32b3ea95359e7a55dfc7dd43d0cfc83a0cc0f0e9</id>
    <title type="text">Kimina-Prover Preview</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-04-15-kimina-prover-preview/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Kimina-Prover-Preview"/>
    <published>2025-04-15T00:00:00+00:00</published>
    <updated>2025-04-15T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-04-15</summary>
    <content type="html">&lt;p&gt;📈 Introducing &lt;strong&gt;Kimina-Prover Preview&lt;/strong&gt;, the first large formal reasoning model that can reason in a human-like way and prove mathematical theorems rigorously in the Lean 4 language.&lt;/p&gt;
&lt;p&gt;Some key ingredients about the design and training of Kimina-Prover Preview are listed as follows.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@article{kimina_prover_2025,
	title = {Kimina-Prover Preview: Towards Large Formal Reasoning Models with Reinforcement Learning},
	author = {Wang, Haiming and Unsal, Mert and Lin, Xiaohan and Baksys, Mantas and Liu, Junqi and Santos, Marco Dos and Sung, Flood and Vinyes, Marina and Ying, Zhenzhe and Zhu, Zekai and Lu, Jianqiao and Saxcé, Hugues de and Bailey, Bolton and Song, Chendong and Xiao, Chenjun and Zhang, Dehao and Zhang, Ebony and Pu, Frederick and Zhu, Han and Liu, Jiawei and Bayer, Jonas and Michel, Julien and Yu, Longhui and Dreyfus-Schmidt, Léo and Tunstall, Lewis and Pagani, Luigi and Machado, Moreira and Bourigault, Pauline and Wang, Ran and Polu, Stanislas and Barroyer, Thibaut and Li, Wen-Ding and Niu, Yazhe and Fleureau, Yann and Hu, Yangyang and Yu, Zhouliang and Wang, Zihan and Yang, Zhilin and Liu, Zhengying and Li, Jia},
	year = {2025},
	url = {http://arxiv.org/abs/2504.11354},
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:7fc289291c7ec22f59bafba1cbea421ad4b7442a</id>
    <title type="text">Kimi-VL</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-04-10-kimi-vl/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Kimi-VL"/>
    <published>2025-04-10T00:00:00+00:00</published>
    <updated>2025-04-10T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-04-10</summary>
    <content type="html">&lt;h2&gt;1. Introduction&lt;/h2&gt;
&lt;p&gt;We present &lt;strong&gt;Kimi-VL&lt;/strong&gt;, an efficient open-source Mixture-of-Experts (MoE) vision-language model (VLM) that offers &lt;strong&gt;advanced multimodal reasoning, long-context understanding, and strong agent capabilities&lt;/strong&gt;—all while activating only &lt;strong&gt;2.8B&lt;/strong&gt; parameters in its language decoder (Kimi-VL-A3B).&lt;/p&gt;
&lt;p&gt;Kimi-VL demonstrates strong performance across challenging domains: as a general-purpose VLM, Kimi-VL excels in multi-turn agent interaction tasks (e.g.,OSWorld), achieving state-of-the-art results comparable to flagship models. Furthermore, it exhibits remarkable capabilities across diverse challenging vision language tasks, including college-level image and video comprehension, optical character recognition (OCR), mathematical reasoning, multi-image understanding, and etc.&lt;/p&gt;
&lt;p&gt;In comparative evaluations, it effectively competes with cutting-edge efficient VLMs such as GPT-4o-mini, Qwen2.5-VL-7B, and Gemma-3-12B-IT, while surpassing GPT-4o in several specialized domains.&lt;/p&gt;
&lt;p&gt;Kimi-VL also advances the pareto frontiers of multimodal models in processing long contexts and perceiving clearly: Equipped with a 128K extended context window, Kimi-VL can processes long and diverse inputs, achieving impressive scores of 64.5 on LongVideoBench, and 35.1 on MMLongBench-Doc; Its native-resolution vision encoder, MoonViT, further allows it to see and understand ultra-high-resolution visual inputs, achieving 83.2 on InfoVQA and 34.5 on ScreenSpot-Pro, while maintaining lower computational cost with common visual inputs and general tasks.&lt;/p&gt;
&lt;p&gt;Building on this foundation, we introduce an advanced long-thinking variant: &lt;strong&gt;Kimi-VL-Thinking&lt;/strong&gt;. Developed through long chain-of-thought (CoT) supervised fine-tuning (SFT) and reinforcement learning (RL), this model exhibits strong long-horizon reasoning capabilities. It achieves scores of 61.7 on MMMU, 36.8 on MathVision, and 71.3 on MathVista while maintaining the compact 2.8B activated LLM parameter footprint, setting a new standard for efficient yet capable multimodal &lt;strong&gt;thinking&lt;/strong&gt; models.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Besides original model variants, we also provide a new &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Thinking-2506&quot;&gt;Kimi-VL-A3B-Thinking-2506&lt;/a&gt; variant with several new or improved abilities:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It Thinks Smarter while Consuming Less Tokens: The 2506 version reaches better accuracy on multimodal reasoning benchmarks: 56.9 on MathVision (+20.1), 80.1 on MathVista (+8.4), 46.3 on MMMU-Pro (+3.2), 64.0 on MMMU (+2.1), while in average reducing 20% thinking length.&lt;/li&gt;
&lt;li&gt;It Sees Clearer with Thinking: Unlike the previous version that specializes on thinking tasks, the 2506 version can also achieve the same or even better ability on general visual perception and understanding, e.g. MMBench-EN-v1.1 (84.4), MMStar (70.4), RealWorldQA (70.0), MMVet (78.4) compared to the original non-thinking version (Kimi-VL-A3B-Instruct).&lt;/li&gt;
&lt;li&gt;It Extends to Video Scenarios: The new 2506 version also improves on video reasoning and understanding benchmarks. It sets new state-of-the-art for open-source models on VideoMMMU (65.2), while also retaining good ability on general video understanding (71.9 on Video-MME).&lt;/li&gt;
&lt;li&gt;It Extends to Higher Resolution: The new 2506 version supports 3.2 million total pixels in a single image (1792x1792), 4X compared to the original release. This leads to non-trivial improvements on high-resolution perception and OS-agent grounding benchmarks: 83.2 on V* Benchmark (without extra tools), 52.8 on ScreenSpot-Pro, 52.5 on OSWorld-G (full set with refusal).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2. Architecture&lt;/h2&gt;
&lt;p&gt;The model adopts an MoE language model, a native-resolution visual encoder (MoonViT), and an MLP projector, as illustrated in the following image.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-VL/blob/main/figures/arch.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-VL/raw/main/figures/arch.png&quot; alt=&quot;&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;3. News&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;2025.06.21: Release of Kimi-VL-A3B-Thinking-2506: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/blog/moonshotai/kimi-vl-a3b-thinking-2506&quot;&gt;Tech Blog &amp;amp; Cookbook&lt;/a&gt;, &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Thinking-2506&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2025.04.15: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/vllm-project/vllm&quot;&gt;vLLM&lt;/a&gt; has supported Kimi-VL deployment. See &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/vllm-project/vllm/pull/16387&quot;&gt;#16387&lt;/a&gt; for details.&lt;/li&gt;
&lt;li&gt;2025.04.14: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/hiyouga/LLaMA-Factory&quot;&gt;LLaMA-Factory&lt;/a&gt; has supported Kimi-VL finetuning. See &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/hiyouga/LLaMA-Factory/pull/7719&quot;&gt;#7719&lt;/a&gt; for details.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. Model Variants&lt;/h2&gt;
&lt;p&gt;🤗 For common general multimodal perception and understanding, OCR, long video and long document, video perception, and OS-agent uses, we recommend &lt;code&gt;Kimi-VL-A3B-Instruct&lt;/code&gt; for efficient inference; meanwhile, our new thinking version, &lt;code&gt;Kimi-VL-A3B-Thinking-2506&lt;/code&gt; also has excellent multimodal perception, long video and long document and OS-agent grounding abilities while achieving better multimodal reasoning skills. See &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/blog/moonshotai/kimi-vl-a3b-thinking-2506&quot;&gt;this blog&lt;/a&gt; for more information.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;#Total Params&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;#Activated Params&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Context Length&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Download Link&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔥Kimi-VL-A3B-Thinking-2506&lt;/td&gt;
&lt;td&gt;16B&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;128K&lt;/td&gt;
&lt;td&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Thinking-2506&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-VL-A3B-Instruct&lt;/td&gt;
&lt;td&gt;16B&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;128K&lt;/td&gt;
&lt;td&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi-VL-A3B-Thinking (deprecated)&lt;/td&gt;
&lt;td&gt;16B&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;128K&lt;/td&gt;
&lt;td&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Thinking&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;Recommended parameter settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For &lt;strong&gt;Thinking models&lt;/strong&gt;, it is recommended to use &lt;code&gt;Temperature = 0.8&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;Instruct models&lt;/strong&gt;, it is recommended to use &lt;code&gt;Temperature = 0.2&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Hugging Face Demo&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;🤗 We serve our model demo in Hugging Face spaces:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chat with &lt;strong&gt;Kimi-VL-A3B-Thinking-2506&lt;/strong&gt;👀🤔🗺️🎬📖🖥️ (&lt;em&gt;unifying thinking, general understanding, puzzle solving, agent, video, PDF&lt;/em&gt;) model on &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/spaces/moonshotai/Kimi-VL-A3B-Thinking/&quot;&gt;Chat Web&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;5. Performance&lt;/h2&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;See the performance of Kimi-VL-A3B-Thinking-2506 at &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Kimi-VL-A3B-Thinking-2506#2-performance&quot;&gt;Hugging Face&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As an efficient model, Kimi-VL can robustly handle diverse tasks (fine-grained perception, math, college-level problems, OCR, agent, etc) across a broad spectrum of input forms (single-image, multi-image, video, long-document, etc).&lt;/p&gt;
&lt;p&gt;A brief comparison with existing 10B-level dense VLMs and DeepSeek-VL2 (A4.5B):&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-VL/blob/main/figures/instruct_perf.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-VL/raw/main/figures/instruct_perf.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With effective long-thinking abilities, Kimi-VL-A3B-Thinking (2504 version) can match the performance of 30B/70B frontier open-source VLMs on MathVision benchmark:&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Kimi-VL/blob/main/figures/thinking_perf.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Kimi-VL/raw/main/figures/thinking_perf.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;6. Example usage&lt;/h2&gt;
&lt;h3&gt;Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;conda&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; create&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;n&lt;/span&gt; kimi-vl python=3.10&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;conda&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; activate kimi-vl&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;r&lt;/span&gt; requirements.txt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;If you encounter Out-of-Memory or want to speed up inference, please install &lt;strong&gt;flash-attn&lt;/strong&gt; with &lt;code&gt;pip install flash-attn --no-build-isolation&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Inference with Hugging Face Transformers&lt;/h3&gt;
&lt;p&gt;We introduce how to use our model at inference stage using transformers library. It is recommended to use python=3.10, torch=2.5.1, and transformers=4.51.3 as the development environment.&lt;/p&gt;
&lt;h4&gt;Kimi-VL-A3B-Instruct:&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;torch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;PIL&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;transformers&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-import-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Kimi-VL-A3B-Instruct&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;torch_dtype&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;device_map&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; If flash-attn has been installed, it is recommended to set torch_dtype=torch.bfloat16 and attn_implementation=&amp;quot;flash_attention_2&amp;quot;
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; to save memory and speed up inference
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; model = AutoModelForCausalLM.from_pretrained(
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     model_path,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     torch_dtype=torch.bfloat16,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     device_map=&amp;quot;auto&amp;quot;,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     trust_remote_code=True,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     attn_implementation=&amp;quot;flash_attention_2&amp;quot;
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; )
&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;./figures/demo.png&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;open&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;What is the dome building in the picture? Think step by step.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;apply_chat_template&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;add_generation_prompt&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;processor&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;truncation&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;to&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;device&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_new_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;512&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids_trimmed&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;out_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;len&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;in_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-punctuation syntax-separator syntax-slice syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-expression syntax-generator syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-generator syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;in_ids&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-target-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;out_ids&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;zip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;input_ids&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;batch_decode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids_trimmed&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;skip_special_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;clean_up_tokenization_spaces&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Kimi-VL-A3B-Thinking-2506:&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;torch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;PIL&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;transformers&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-import-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Kimi-VL-A3B-Thinking-2506&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;torch_dtype&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;device_map&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; If flash-attn has been installed, it is recommended to set torch_dtype=torch.bfloat16 and attn_implementation=&amp;quot;flash_attention_2&amp;quot;
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; to save memory and speed up inference
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; model = AutoModelForCausalLM.from_pretrained(
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     model_path,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     torch_dtype=torch.bfloat16,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     device_map=&amp;quot;auto&amp;quot;,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     trust_remote_code=True,
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt;     attn_implementation=&amp;quot;flash_attention_2&amp;quot;
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; )
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_paths&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;./figures/demo1.png&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;./figures/demo2.png&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;images&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;open&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-expression syntax-generator syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-generator syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_paths&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-expression syntax-generator syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-generator syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_paths&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Please infer step by step who this manuscript belongs to and what it records&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;apply_chat_template&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;add_generation_prompt&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;processor&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;images&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;truncation&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;to&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;device&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_new_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;32768&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;temperature&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-float syntax-python&quot;&gt;0&lt;span class=&quot;syntax-punctuation syntax-separator syntax-decimal syntax-python&quot;&gt;.&lt;/span&gt;8&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids_trimmed&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;out_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;len&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;in_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-punctuation syntax-separator syntax-slice syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-expression syntax-generator syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-generator syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;in_ids&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-target-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;out_ids&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;zip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;input_ids&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;batch_decode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids_trimmed&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;skip_special_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;clean_up_tokenization_spaces&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;7. Finetuning&lt;/h2&gt;
&lt;p&gt;Collaborating closely with the open-source community, Kimi-VL now offers seamless support for efficient fine-tuning through the latest version of &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/hiyouga/LLaMA-Factory&quot;&gt;LLaMA-Factory&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The framework enables Single-GPU LoRA fine-tuning with 50GB of VRAM, as well as Multi-GPU full/lora fine-tuning using DeepSpeed ZeRO-2. For more detailed configuration instructions, check out &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/hiyouga/LLaMA-Factory/pull/7719#issue-2992644288&quot;&gt;this PR&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;8. Deployment&lt;/h2&gt;
&lt;h3&gt;Using vLLM&lt;/h3&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/vllm-project/vllm&quot;&gt;vLLM main branch&lt;/a&gt; has supported Kimi-VL deployment. You are welcome to deploy Kimi-VL using vLLM.&lt;/p&gt;
&lt;h4&gt;Offline Inference&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;PIL&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;transformers&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;vllm&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-variable syntax-other syntax-constant syntax-python&quot;&gt;LLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-import-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;SamplingParams&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Kimi-VL-A3B-Instruct&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; or &amp;quot;moonshotai/Kimi-VL-A3B-Thinking-2506&amp;quot;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;llm&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;LLM&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoProcessor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;./figures/demo.png&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;open&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;What is the dome building in the picture? Think step by step.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;processor&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;apply_chat_template&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;add_generation_prompt&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;outputs&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;llm&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;prompt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;multi_modal_data&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;sampling_params&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;SamplingParams&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;512&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;-&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;50&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-python&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-for syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;outputs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-block syntax-for syntax-python&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_text&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;outputs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;text&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_text&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;-&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;50&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;OpenAI-Compatible Server&lt;/h4&gt;
&lt;p&gt;Serve Kimi-VL with &lt;code&gt;vllm serve&lt;/code&gt; command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; If you need a longer context window, you can set --max-model-len and --max-num-batched-tokens to 131072&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; If you need more input images, you can set --limit-mm-per-prompt image=256 or 512&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; kimi-vl-thinking-2506&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;vllm&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; serve moonshotai/Kimi-VL-A3B-Thinking-2506&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;served-model-name&lt;/span&gt; kimi-vl-thinking-2506&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;trust-remote-code&lt;/span&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;tensor-parallel-size&lt;/span&gt; 1&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;max-num-batched-tokens&lt;/span&gt; 32768&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;max-model-len&lt;/span&gt; 32768&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;limit-mm-per-prompt&lt;/span&gt; image=64&lt;/span&gt;

&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt; kimi-vl-instruct&lt;/span&gt;&lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-shell&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;vllm&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; serve moonshotai/Kimi-VL-A3B-Instruct&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;served-model-name&lt;/span&gt; kimi-vl&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;trust-remote-code&lt;/span&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;tensor-parallel-size&lt;/span&gt; 1&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;max-num-batched-tokens&lt;/span&gt; 32768&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;max-model-len&lt;/span&gt; 32768&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;limit-mm-per-prompt&lt;/span&gt; image=64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Call the API&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;base64&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;PIL&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;io&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;BytesIO&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;openai&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;OpenAI&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;client&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;OpenAI&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;base_url&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;http://localhost:8000/v1&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;api_key&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;token-abc123&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;./figures/demo.png&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;open&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image_path&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;RGB&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;buffered&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;BytesIO&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;save&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;buffered&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;JPEG&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;img_b64_str&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;base64&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;b64encode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;buffered&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;getvalue&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;decode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;utf-8&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;base64_image_url&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-storage syntax-type syntax-string syntax-python&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-interpolated syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;data:image/jpeg;base64,&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-source syntax-python syntax-embedded&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;img_b64_str&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-interpolation syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-interpolation syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image_url&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;image_url&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;url&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;base64_image_url&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;type&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;text&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;What is the dome building in the picture? Think step by step.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completion&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;chat&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completions&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;create&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
  &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;kimi-vl-thinking-2506&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-comment syntax-line syntax-number-sign syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-comment syntax-python&quot;&gt;#&lt;/span&gt; or kimi-vl
&lt;/span&gt;  &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;messages&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;completion&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;choices&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;message&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;9. Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@misc{kimiteam2025kimivltechnicalreport,
      title={{Kimi-VL} Technical Report}, 
      author={Kimi Team and Angang Du and Bohong Yin and Bowei Xing and Bowen Qu and Bowen Wang and Cheng Chen and Chenlin Zhang and Chenzhuang Du and Chu Wei and Congcong Wang and Dehao Zhang and Dikang Du and Dongliang Wang and Enming Yuan and Enzhe Lu and Fang Li and Flood Sung and Guangda Wei and Guokun Lai and Han Zhu and Hao Ding and Hao Hu and Hao Yang and Hao Zhang and Haoning Wu and Haotian Yao and Haoyu Lu and Heng Wang and Hongcheng Gao and Huabin Zheng and Jiaming Li and Jianlin Su and Jianzhou Wang and Jiaqi Deng and Jiezhong Qiu and Jin Xie and Jinhong Wang and Jingyuan Liu and Junjie Yan and Kun Ouyang and Liang Chen and Lin Sui and Longhui Yu and Mengfan Dong and Mengnan Dong and Nuo Xu and Pengyu Cheng and Qizheng Gu and Runjie Zhou and Shaowei Liu and Sihan Cao and Tao Yu and Tianhui Song and Tongtong Bai and Wei Song and Weiran He and Weixiao Huang and Weixin Xu and Xiaokun Yuan and Xingcheng Yao and Xingzhe Wu and Xinxing Zu and Xinyu Zhou and Xinyuan Wang and Y. Charles and Yan Zhong and Yang Li and Yangyang Hu and Yanru Chen and Yejie Wang and Yibo Liu and Yibo Miao and Yidao Qin and Yimin Chen and Yiping Bao and Yiqin Wang and Yongsheng Kang and Yuanxin Liu and Yulun Du and Yuxin Wu and Yuzhi Wang and Yuzi Yan and Zaida Zhou and Zhaowei Li and Zhejun Jiang and Zheng Zhang and Zhilin Yang and Zhiqi Huang and Zihao Huang and Zijia Zhao and Ziwei Chen},
      year={2025},
      eprint={2504.07491},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2504.07491}, 
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:79b48f27241a8dfbf4acb69eb367cfc8f8b1eb26</id>
    <title type="text">Muon is Scalable for LLM Training</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-02-23-muon-is-scalable-for-llm-training/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Moonlight"/>
    <published>2025-02-23T00:00:00+00:00</published>
    <updated>2025-02-23T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-02-23</summary>
    <content type="html">&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Moonlight/blob/master/Moonlight.pdf&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Moonlight/raw/master/figures/banner.png&quot; alt=&quot;&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Recently, the &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/KellerJordan/Muon&quot;&gt;Muon optimizer&lt;/a&gt; based on matrix orthogonalization has demonstrated strong results in training small-scale language models, but the scalability to larger models has not been proven. We identify two crucial techniques for scaling up Muon: (1) adding weight decay and (2) carefully adjusting the per-parameter update scale. These techniques allow Muon to work out-of-the-box on large-scale training without the need of hyper-parameter tuning. Scaling law experiments indicate that Muon achieves ∼ 2× computational efficiency compared to AdamW with compute optimal training.&lt;/p&gt;
&lt;p&gt;Based on these improvements, we introduce &lt;strong&gt;Moonlight&lt;/strong&gt;, a 3B/16B-parameter Mixture-of-Expert (MoE) model trained with 5.7T tokens using Muon. Our model improves the current Pareto frontier, achieving better performance with much fewer training FLOPs compared to prior models.&lt;/p&gt;
&lt;p&gt;We open-source our distributed Muon implementation that is memory optimal and communication efficient. We also release the pretrained, instruction-tuned, and intermediate checkpoints to support future research.&lt;/p&gt;
&lt;p&gt;Our code is available at &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Moonlight&quot;&gt;MoonshotAI/Moonlight&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Key Ingredients&lt;/h2&gt;
&lt;p&gt;Our work builds upon Muon while systematically identifying and resolving its limitations in large-scale training scenarios. Our technical contributions include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Analysis for Effective Scaling of Muon&lt;/strong&gt;: Through extensive analysis, we identify that weight decay plays a crucial roles in Muon&#39;s scalability. Besides, we proposed to keep a consistent update root mean square (RMS) across different matrix and non-matrix parameters through parameter-wise update scale adjustments. Such adjustments significantly enhanced training stability.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Efficient Distributed Implementation&lt;/strong&gt;: We develop a distributed version of Muon with ZeRO-1 style optimization, achieving optimal memory efficiency and reduced communication overhead while preserving the mathematical properties of the algorithm.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scaling Law Validation&lt;/strong&gt;: We performed scaling law research that compares Muon with strong AdamW baselines, and showed the superior performance of Muon (see Figure 1). Based on the scaling law results, Muon achieves comparable performance to AdamW trained counterparts while requiring only approximately 52% of the training FLOPs.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/Moonlight/blob/master/figures/scaling.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/Moonlight/raw/master/figures/scaling.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Scaling up with Muon. &lt;strong&gt;(a)&lt;/strong&gt; Scaling law experiments comparing Muon and Adam. Muon is 2 times more sample efficient than Adam. &lt;strong&gt;(b)&lt;/strong&gt; The MMLU performance of our Moonlight model optimized with Muon and other comparable models. Moonlight advances the Pareto frontier of performance vs training FLOPs.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Performance&lt;/h2&gt;
&lt;p&gt;We named our lightweight model trained with Muon &amp;quot;Moonlight&amp;quot;. We compared Moonlight with SOTA public models at similar scale:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;LLAMA3-3B&lt;/strong&gt; is a 3B-parameter dense model trained with 9T tokens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Qwen2.5-3B&lt;/strong&gt; is a 3B-parameter dense model trained with 18T tokens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deepseek-v2-Lite&lt;/strong&gt; is a 2.4B/16B-parameter MOE model trained with 5.7T tokens&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Benchmark (Metric)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Llama3.2-3B&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Qwen2.5-3B&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;DSV2-Lite&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Moonlight&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Activated Param†&lt;/td&gt;
&lt;td&gt;2.81B&lt;/td&gt;
&lt;td&gt;2.77B&lt;/td&gt;
&lt;td&gt;2.24B&lt;/td&gt;
&lt;td&gt;2.24B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Total Params†&lt;/td&gt;
&lt;td&gt;2.81B&lt;/td&gt;
&lt;td&gt;2.77B&lt;/td&gt;
&lt;td&gt;15.29B&lt;/td&gt;
&lt;td&gt;15.29B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Training Tokens&lt;/td&gt;
&lt;td&gt;9T&lt;/td&gt;
&lt;td&gt;18T&lt;/td&gt;
&lt;td&gt;5.7T&lt;/td&gt;
&lt;td&gt;5.7T&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Optimizer&lt;/td&gt;
&lt;td&gt;AdamW&lt;/td&gt;
&lt;td&gt;*&lt;/td&gt;
&lt;td&gt;AdamW&lt;/td&gt;
&lt;td&gt;Muon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;English&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MMLU&lt;/td&gt;
&lt;td&gt;54.75&lt;/td&gt;
&lt;td&gt;65.6&lt;/td&gt;
&lt;td&gt;58.3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;70.0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;MMLU-pro&lt;/td&gt;
&lt;td&gt;25.0&lt;/td&gt;
&lt;td&gt;34.6&lt;/td&gt;
&lt;td&gt;25.5&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;42.4&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;BBH&lt;/td&gt;
&lt;td&gt;46.8&lt;/td&gt;
&lt;td&gt;56.3&lt;/td&gt;
&lt;td&gt;44.1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;65.2&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;TriviaQA‡&lt;/td&gt;
&lt;td&gt;59.6&lt;/td&gt;
&lt;td&gt;51.1&lt;/td&gt;
&lt;td&gt;65.1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;66.3&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HumanEval&lt;/td&gt;
&lt;td&gt;28.0&lt;/td&gt;
&lt;td&gt;42.1&lt;/td&gt;
&lt;td&gt;29.9&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;48.1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;MBPP&lt;/td&gt;
&lt;td&gt;48.7&lt;/td&gt;
&lt;td&gt;57.1&lt;/td&gt;
&lt;td&gt;43.2&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;63.8&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Math&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;GSM8K&lt;/td&gt;
&lt;td&gt;34.0&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;79.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;41.1&lt;/td&gt;
&lt;td&gt;77.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;MATH&lt;/td&gt;
&lt;td&gt;8.5&lt;/td&gt;
&lt;td&gt;42.6&lt;/td&gt;
&lt;td&gt;17.1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;45.3&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;CMath&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;80.0&lt;/td&gt;
&lt;td&gt;58.4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;81.1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chinese&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;C-Eval&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;75.0&lt;/td&gt;
&lt;td&gt;60.3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;77.2&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;CMMLU&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;75.0&lt;/td&gt;
&lt;td&gt;64.3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;78.2&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;em&gt;Qwen 2 &amp;amp; 2.5 reports didn&#39;t disclose their optimizer information. †The reported parameter counts exclude the embedding parameters. ‡We test all listed models with the full set of TriviaQA.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Example usage&lt;/h2&gt;
&lt;h3&gt;Model Download&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;#Total Params&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;#Activated Params&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Context Length&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Download Link&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Moonlight&lt;/td&gt;
&lt;td&gt;16B&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;8K&lt;/td&gt;
&lt;td&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Moonlight-16B-A3B&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moonlight-Instruct&lt;/td&gt;
&lt;td&gt;16B&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;8K&lt;/td&gt;
&lt;td&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://huggingface.co/moonshotai/Moonlight-16B-A3B-Instruct&quot;&gt;🤗 Hugging Face&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Inference with Hugging Face Transformers&lt;/h3&gt;
&lt;p&gt;We introduce how to use our model at inference stage using transformers library. It is recommended to use python=3.10, torch&amp;gt;=2.1.0, and transformers=4.48.2 as the development environment.&lt;/p&gt;
&lt;p&gt;For our pretrained model (Moonlight):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;transformers&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-import-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoTokenizer&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Moonlight-16B-A3B&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;torch_dtype&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;device_map&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoTokenizer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;prompt&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;1+1=2, 1+2=&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;prompt&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;truncation&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;to&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;device&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-arithmetic syntax-python&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_new_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;batch_decode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For our instruct model (Moonlight-Instruct):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Python&quot;&gt;&lt;span class=&quot;syntax-source syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-from syntax-python&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-source syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-import-path syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-import-name syntax-python&quot;&gt;transformers&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;span class=&quot;syntax-keyword syntax-control syntax-import syntax-python&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-statement syntax-import syntax-python&quot;&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-import-list syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoTokenizer&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;moonshotai/Moonlight-16B-A3B-Instruct&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoModelForCausalLM&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;
    &lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;torch_dtype&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;device_map&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;auto&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;AutoTokenizer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;from_pretrained&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model_path&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;trust_remote_code&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-structure syntax-list syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;system&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;You are a helpful assistant provided by Moonshot-AI.&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-list syntax-python&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;syntax-meta syntax-structure syntax-dictionary-or-set syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;role&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;user&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;content&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-key-value syntax-python&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;Is 123 a prime?&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-punctuation syntax-section syntax-list syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;input_ids&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;apply_chat_template&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;messages&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;add_generation_prompt&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-language syntax-python&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;return_tensors&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-string syntax-python&quot;&gt;&lt;span class=&quot;syntax-string syntax-quoted syntax-double syntax-python&quot;&gt;pt&lt;span class=&quot;syntax-punctuation syntax-definition syntax-string syntax-end syntax-python&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;to&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;device&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;generate&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;input_ids&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-separator syntax-arguments syntax-python&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;syntax-variable syntax-parameter syntax-python&quot;&gt;max_new_tokens&lt;/span&gt;&lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;500&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;syntax-keyword syntax-operator syntax-assignment syntax-python&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;tokenizer&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-accessor syntax-dot syntax-python&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-python&quot;&gt;batch_decode&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;generated_ids&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-item-access syntax-python&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-support syntax-function syntax-builtin syntax-python&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-qualified-name syntax-python&quot;&gt;&lt;span class=&quot;syntax-meta syntax-generic-name syntax-python&quot;&gt;response&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Moonlight has the same architecture as DeepSeek-V3, which is supported by many popular inference engines, such as VLLM and SGLang. As a result, our model can also be easily deployed using these tools.&lt;/p&gt;
&lt;h3&gt;Training&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;# train qwen-like dense model with muon
python3 examples/toy_train.py --model qwen --optimizer muon --dataset openwebtext-100k --hidden_size 896 --lr 1e-3

# train qwen-like dense model with adamw
python3 examples/toy_train.py --model qwen --optimizer adamw --dataset openwebtext-100k --hidden_size 896 --lr 1e-3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Intermediate Checkpoints&lt;/h2&gt;
&lt;p&gt;To support ongoing research efforts, we will soon release our intermediate checkpoints. Coming soon...&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;p&gt;If you find Moonlight is useful or want to use in your projects, please kindly cite our paper:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@misc{liu2025muonscalablellmtraining,
      title={Muon is Scalable for LLM Training}, 
      author={Jingyuan Liu and Jianlin Su and Xingcheng Yao and Zhejun Jiang and Guokun Lai and Yulun Du and Yidao Qin and Weixin Xu and Enzhe Lu and Junjie Yan and Yanru Chen and Huabin Zheng and Yibo Liu and Shaowei Liu and Bohong Yin and Weiran He and Han Zhu and Yuzhi Wang and Jianzhou Wang and Mengnan Dong and Zheng Zhang and Yongsheng Kang and Hao Zhang and Xinran Xu and Yutao Zhang and Yuxin Wu and Xinyu Zhou and Zhilin Yang},
      year={2025},
      eprint={2502.16982},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2502.16982}, 
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:8b6a8b0f3d3f7dba3bdc5702272342718b46651d</id>
    <title type="text">MoBA: Mixture of Block Attention for Long-Context LLMs</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-02-18-moba-mixture-of-block-attention-for-long-context-llms/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/MoBA"/>
    <published>2025-02-18T00:00:00+00:00</published>
    <updated>2025-02-18T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-02-18</summary>
    <content type="html">&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://arxiv.org/abs/2502.13189&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/banner.png&quot; alt=&quot;&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA/blob/master/MoBA_Tech_Report.pdf&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/logo.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt; &lt;strong&gt;Full Report&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🚀 Introducing &lt;strong&gt;MoBA --- Mixture of Block Attention&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Trainable Block Sparse Attention&lt;/strong&gt;: The full context is divided into blocks, where each query token learns to attend to the most relevant KV blocks, enabling efficient processing of long sequences.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parameter-less Gating Mechanism&lt;/strong&gt;: A novel Parameter-less top-k gating mechanism is introduced to selects the most relevant blocks for each query token, ensuring that the model focuses only on the most informative blocks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seamlessly Transition between Full and Sparse Attention&lt;/strong&gt;: MoBA is designed to be a flexible substitute for full attention, allowing seamless transitions between full and sparse attention modes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA/blob/master/figures/running_example.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/running_example.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt; &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA/blob/master/figures/moba_with_flash_attn.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/moba_with_flash_attn.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: MoBA requires continue training of existing models to achieve its acceleration benefits. It is not a drop-in sparse attention solution that can be directly applied to pretrained models without additional training.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Scaling the effective context length is essential for advancing large language models (LLMs) toward artificial general intelligence (AGI). However, the quadratic increase in computational complexity inherent in traditional attention mechanisms presents a prohibitive overhead. Existing approaches either impose strongly biased structures, such as sink or window attention which are task-specific, or radically modify the attention mechanism into linear approximations, whose performance in complex reasoning tasks remains inadequately explored.&lt;/p&gt;
&lt;p&gt;In this work, we propose a solution that adheres to the &lt;strong&gt;“less structure”&lt;/strong&gt; principle, allowing the model to autonomously determine where to attend, rather than introducing predefined biases. We introduce Mixture of Block Attention (MoBA), an innovative approach that applies the principles of Mixture of Experts (MoE) to the attention mechanism. This novel architecture demonstrates superior performance on long-context tasks while offering a key advantage: the ability to seamlessly transition between full and sparse attention, enhancing efficiency without the risk of compromising performance. MoBA has already been deployed to support Kimi’s long-context requests and demonstrates significant advancements in efficient attention computation for LLMs.&lt;/p&gt;
&lt;p&gt;Our code is available at &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA&quot;&gt;MoonshotAI/MoBA&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA/blob/master/figures/computation_time.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/computation_time.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Evaluation with 1M context length&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/MoonshotAI/MoBA/blob/master/figures/needle-in-a-haystack.png&quot;&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://github.com/MoonshotAI/MoBA/raw/master/figures/needle-in-a-haystack.png&quot; alt=&quot;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Environment Setup&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Note that current kernel implementations rely on &lt;code&gt;flash-attn==2.6.3&lt;/code&gt; and &lt;code&gt;torch &amp;gt;= 2.1.0&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;conda&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; create&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; -&lt;/span&gt;n&lt;/span&gt; moba python=3.10&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;conda&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; activate moba&lt;/span&gt;
&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pip&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; install .&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;We provide a transformers-friendly implementation for MoBA.&lt;/p&gt;
&lt;p&gt;Feel free to choose attention backends by &lt;code&gt;--attn&lt;/code&gt; between &lt;code&gt;moba&lt;/code&gt; and &lt;code&gt;moba_naive&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;python3&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; examples/llama.py&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;model&lt;/span&gt; meta-llama/Llama-3.1-8B&lt;span class=&quot;syntax-variable syntax-parameter syntax-option syntax-shell&quot;&gt;&lt;span class=&quot;syntax-punctuation syntax-definition syntax-parameter syntax-shell&quot;&gt; --&lt;/span&gt;attn&lt;/span&gt; moba&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Implementation Details&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;moba_naive&lt;/strong&gt;: A naive implementation based on attention masks. It&#39;s designed to help understand how MoBA selects corresponding chunks. You may save and visualize the attention masks to see the block selection process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;moba_efficient&lt;/strong&gt;: Our production-ready implementation optimized for performance. It achieves up to 40x speedup compared to moba_naive (tested with 32K sequence length, 1 attention head, MoBA Block 2048 and MoBA Topk 3). We recommend using this version for practical applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Unit Tests&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;code-snippet&quot; data-language=&quot;Shell&quot;&gt;&lt;span class=&quot;syntax-source syntax-shell syntax-bash&quot;&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-shell&quot;&gt;&lt;span class=&quot;syntax-variable syntax-function syntax-shell&quot;&gt;pytest&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;syntax-meta syntax-function-call syntax-arguments syntax-shell&quot;&gt; tests/test_moba_attn.py&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Llama Implementation: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/huggingface/transformers&quot;&gt;huggingface/transformers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Flash Attention: &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://github.com/Dao-AILab/flash-attention&quot;&gt;Dao-AILab/flash-attention&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;p&gt;If you find MoBA is useful or want to use in your projects, please kindly cite our paper:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@article{lu2025mobamixtureblockattention,
  author = {Enzhe Lu and Zhejun Jiang and Jingyuan Liu and Yulun Du and Tao Jiang and Chao Hong and Shaowei Liu and Weiran He and Enming Yuan and Yuzhi Wang and Zhiqi Huang and Huan Yuan and Suting Xu and Xinran Xu and Guokun Lai and Yanru Chen and Huabin Zheng and Junjie Yan and Jianlin Su and Yuxin Wu and Yutao Zhang and Zhilin Yang and Xinyu Zhou and Mingxing Zhang and Jiezhong Qiu},
  title = {MoBA: Mixture of Block Attention for Long-Context LLMs},
  journal={arXiv preprint arXiv:2502.13189},
  year={2025}
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry xml:lang="en-CN">
    <id>urn:aggr:item:77214df8bd6f2f4b0fe92ab07043216b2a5a9ad9</id>
    <title type="text">Kimi K1.5: Scaling Reinforcement Learning with LLMs</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/kimi-com/2025-01-20-kimi-k1-5-scaling-reinforcement-learning-with-llms/"/>
    <link rel="via" type="text/html" href="https://github.com/MoonshotAI/Kimi-k1.5"/>
    <published>2025-01-20T00:00:00+00:00</published>
    <updated>2025-01-20T00:00:00+00:00</updated>
    <author>
      <name>Kimi Research Blog | Moonshot AI</name>
    </author>
    <category term="ai"/>
    <source>
      <title>Kimi Research Blog | Moonshot AI</title>
    </source>
    <summary type="text">2025-01-20</summary>
    <content type="html">&lt;p&gt;There are a few key ingredients about the design and training of k1.5.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;code-snippet&quot;&gt;@article{team2025kimi,
  title={Kimi k1.5: Scaling reinforcement learning with llms},
  author={Team, Kimi and Du, Angang and Gao, Bofei and Xing, Bowei and Jiang, Changjiu and Chen, Cheng and Li, Cheng and Xiao, Chenjun and Du, Chenzhuang and Liao, Chonghua and others},
  journal={arXiv preprint arXiv:2501.12599},
  year={2025}
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
</feed>
