Skip to main content

本地Ollama模型做AI纠正报错

在使用本地Ollama模型来作为AI纠正的时候,它老是报错。一直去报这个错误,

测试失败: error sending request for url (http://localhost:11434/api/chat)

我的终端显示的是可以连接的啊,模型的名称我写的也是完全正确的。无论启不启用这个函数调用,它都是有这个报错的。

2 comments

Log in to comment and vote

Comments2

  • andy

    •

    Jan 9

    我也遇到了这个问题, 本地 ollama 使用 qwen3 或者 deepseek-r1 时,会输出thinking 内容,然后纠错结果就会是thinking的输出,不符合预期。 是否可以增加一个参数输入选项,可以自定义一些设置参数,方便关闭或开启目标模型的能力。 ollama 本身是支持 调用时是否开启后关闭 thinking的。😀 ❤️

  • 朱tom

    •

    Jan 2

    我测试了一下这个接口也是可以正常使用的啊,curl -v http://localhost:11434/api/chat \

    -H "Content-Type: application/json" \

    -d '{

    "model": "qwen3:4b-instruct-2507-q4_K_M",

    "stream": false,

    "messages": [

    {"role": "user", "content": "用一句话介绍一下你自己"}

    ]

    }'

    它是能够正常的返回内容的