Skip to content

Loss of Final Tokens After Tool Call When Using kimi-k2 Model with Streaming Output #2660

@gscfwid

Description

@gscfwid

Question

Has anyone encountered an issue where, when using the kimi-k2 model, tokens at the end of the output disappear? I observed this after a tool call, but I’m not sure if it can also happen without a tool call, as I haven’t tested that case. I’m using streaming output (‎agent.iter() + ‎node.stream), and not only is the streaming output incomplete—the ‎final_output is also missing the last few tokens.

Additional Context

Pydantic-AI version: 0.7.4
Python version: 3.12

Metadata

Metadata

Assignees

Labels

StalequestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions