EINO组件目前对于vllm 0.18.0版本启动的llm返回的思考内容无法较好的解析,存在多出来的很多双引号
- Dominant language
- Go
- Stars
- 13k
- Forks
- 1.1k
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 41
Description
描述问题:在使用 Eino 调用通过 vLLM 0.18.0 部署的推理模型时,Eino 无法正确解析模型返回的“思考内容”(即推理过程中的思维链)。经排查,根本原因在于 vLLM 新版本修改了响应字段名,导致 Eino 无法识别。
复现步骤:使用 vLLM 0.18.0 版本部署一个推理模型(例如 QwQ-32B、DeepSeek-R1 等),并启用 --reasoning-parser 参数。在 Eino 中通过 ChatModel 组件,使用 OpenAI 兼容接口方式连接该 vLLM 服务(即设置 BaseURL 指向 vLLM 端点)。向 vLLM 服务发送一条需要模型进行推理的聊天请求。在代码中尝试从 Eino 返回的 Message 对象中获取推理思考内容。
预期行为:Eino 应能正确解析并提取模型返回的推理思考内容,并存入 Message 结构体的 ReasoningContent 字段或类似专用于存储推理内容的字段中。
实际行为:推理思考内容无法从 Message 对象中正常获取,ReasoningContent 字段返回为空或不存在。原因是 vLLM 0.18.0 已将响应中的 reasoning_content 字段废弃,改用 reasoning 字段,但 Eino 的 schema.Message 仍在尝试解析名为 reasoning_content 的字段,导致映射失败。
版本信息:vLLM 版本:0.18.0;Eino 版本:Eino v0.9.0
环境信息:Go 版本:1.24.5;操作系统:Linux-arm
补充说明:vLLM 官方文档已确认,reasoning 字段将永久替代 reasoning_content,且无法通过配置参数恢复旧字段名。目前,Eino 的 schema.Message 结构体包含 Extra 字段,可用于存储未映射的额外数据。临时解决方案是可以通过 Message.Extra["reasoning"] 手动获取推理内容。但为了更好地支持 vLLM 等推理框架的标准输出,建议 Eino 在 Message 中增加专用于存储推理内容的字段,或提供可配置的字段映射机制,以适配不同后端的字段命名差异。
Contributor guide
Research direction
Start with schema.Message and the OpenAI-compatible ChatModel response path described in the issue; compare vLLM 0.18.0's reasoning field with the existing reasoning_content mapping. Check how Message.Extra currently exposes unmapped data. Done means reasoning content from a vLLM 0.18.0 response is available through the intended Message field rather than requiring manual Extra lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100