由于Dify 中再带的LM Studio插件,在工作流中报错,无法运行,暂时没有得到解决,故此使用openai 兼容工具提供商OpenAI-API-compatible插件。
LM Studio 插件错误
1 validation error for LLMNodeData model.mode Field required [type=missing, input_value={'provider': 'stvlynn/lms...'completion_params': {}}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/missing
Workflow using lm studio error · Issue #803 · langgenius/dify-official-plugins
在模型供应商里面搜索OpenAI-API-compatible
,然后安装
安装OpenAI-API-compatible
理论上兼容openai协议的大模型服务都可以参考
点击“添加模型”
添加模型配置参考
LM Studio 特别提示,地址后面要加v1
示例:
http://192.168.50.181:1234/v1
如果没加v1报错:
[openai_api_compatible] Error: req_id: 02e56e3a2e PluginInvokeError: {"args":{},"error_type":"ValueError","message":"Unexpected endpoint or method. (POST /chat/completions)"}
从命令行查日志发现请求地址为
http://192.168.50.181:1234/chat/completions
在LM Studio 日志同样发现请求了未知端点(接口地址)![]()
添加
/v1
后问题解决
查看
模型配置,选中OpenAI-API-compatible的模型即可。
https://blog.xqlee.com/article/2509171025424936.html