1 下载ollama
https://ollama.com/
2 下载模型
3 查看下载的模型
执行命令
ollama list显示如下,已经下载了qweb3:8b模型
4 以命令形式运行模型
export OLLAMA_HOST="0.0.0.0:11434" ollama serve5 以curl命令调用接口
curl http://127.0.0.1:11434/api/generate -d '{ "model": "qwen3:8b", "prompt": "请用中文解释一下人工智能是什么?", "stream": true }'"stream": true,是流式输出