Call a local model from plain Python: no SDK, no dependencies
一个仅使用 Python 3.10 标准库的最小脚本,可以通过向 http://localhost:11434/api/generate 发送 POST 请求来调用本地 Ollama 模型,并接收文本响应。
一个仅使用 Python 3.10 标准库的最小脚本,可以通过向 http://localhost:11434/api/generate 发送 POST 请求来调用本地 Ollama 模型,并接收文本响应。