[GH-ISSUE #817] [Bug] 无法将ktransformers集成到dify中 #586

Closed
opened 2026-10-29 14:41:32 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @magic-hya on GitHub (Mar 6, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/817

检查清单

  • 1. 我已经搜索过相关问题,但未能获得预期的帮助
  • 2. 该问题在最新版本中尚未修复
  • 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性
  • 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭
  • 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭

问题描述

当前在主机上部署了ktransformers的server服务,也部署了dify,目前集成到dify中遇到以下问题:
1.集成OpenAI-API-compatible插件报错
2.集成Ollama插件报错

请问打算怎么处理这2个问题

复现步骤

1.集成OpenAI-API-compatible插件报错,错误如下:

Credentials validation failed: invalidresponse object, must be'chat.completion'

ktransformers的输出格式是"object":"chat.completion.chunk"
可能是这个原因导致
2.集成Ollama插件报错,后台报错如下:

File "/workspace/ktransformers/./ktransformers/server/api/ollama/completions.py", line 77, in generate
    raise NotImplementedError

查看源码发现该处有if input.stream:的验证,导致集成失败

环境信息

chatteohr/ktransformers:0.2.0镜像

dify1.0.0

Originally created by @magic-hya on GitHub (Mar 6, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/817 ### 检查清单 - [x] 1. 我已经搜索过相关问题,但未能获得预期的帮助 - [x] 2. 该问题在最新版本中尚未修复 - [x] 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性 - [x] 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [x] 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭 ### 问题描述 当前在主机上部署了ktransformers的server服务,也部署了dify,目前集成到dify中遇到以下问题: 1.集成OpenAI-API-compatible插件报错 2.集成Ollama插件报错 请问打算怎么处理这2个问题 ### 复现步骤 1.集成OpenAI-API-compatible插件报错,错误如下: ``` Credentials validation failed: invalidresponse object, must be'chat.completion' ``` ktransformers的输出格式是"object":"chat.completion.chunk" 可能是这个原因导致 2.集成Ollama插件报错,后台报错如下: ``` File "/workspace/ktransformers/./ktransformers/server/api/ollama/completions.py", line 77, in generate raise NotImplementedError ``` 查看源码发现该处有if input.stream:的验证,导致集成失败 ### 环境信息 chatteohr/ktransformers:0.2.0镜像 dify1.0.0
bsakaguchi 2026-10-29 14:41:32 +00:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@qiyuxinlin commented on GitHub (Mar 6, 2025):

ollama 接口没有实现非流式输出,欢迎提供 pr

<!-- gh-comment-id:2703087520 --> @qiyuxinlin commented on GitHub (Mar 6, 2025): ollama 接口没有实现非流式输出,欢迎提供 pr
Author
Owner

@ErvinXie commented on GitHub (Dec 11, 2025):

This issue has been automatically closed due to inactivity for 60 days.

If you believe this issue is still relevant, please feel free to reopen it with additional information or context.

Thank you for your contribution to KTransformers!


此 issue 因超过 60 天无活动而被自动关闭。

如果您认为此问题仍然存在,请随时重新打开并提供更多信息或上下文。

感谢您对 KTransformers 的贡献!

<!-- gh-comment-id:3639970724 --> @ErvinXie commented on GitHub (Dec 11, 2025): This issue has been automatically closed due to inactivity for 60 days. If you believe this issue is still relevant, please feel free to reopen it with additional information or context. Thank you for your contribution to KTransformers! --- 此 issue 因超过 60 天无活动而被自动关闭。 如果您认为此问题仍然存在,请随时重新打开并提供更多信息或上下文。 感谢您对 KTransformers 的贡献!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#586
No description provided.