为什么LLM流是空的? 破解SSE 响应的实地指南
Why is my LLM stream empty? A field guide to broken SSE responses
如果你曾经调用过OpenAI兼容的 API 和流源已启用和接收... 什么也没有,你并不孤单。 没有出错,也没有例外——只是一个在你的UI保持空时"完成"的流. 在调试了几十个这类病例后——并建立了一个开源工具包来实现诊断自动化——我不断看到同样的四个故障模式. 这是野外指南 我希望我有。 1. 只有理由的答复 一些模型在推理频道("思考"部分)内发出全部答案并标出实际频道为空. 溪行而行. 报告使用量。 你的解剖师很快乐 你的UI什么也没有显示.
If you have ever called an OpenAI-compatible API with streaming enabled and received... nothing, you are not alone. No error, no exception — just a stream that "completes" successfully while your UI stays empty. After debugging dozens of these cases — and building an open-source toolkit to automate the diagnosis — I keep seeing the same four failure modes. Here is the field guide I wish I had. 1. Reasoning-only responses Some models emit their entire answer inside a reasoning channel (the "thinking" part) and mark the actual channel as empty. The stream works. Token usage is reported. Your parser is happy. Your UI shows nothing.