受欢迎的博客标签

How LLM works(Ollama)?

Published

安装

Ollama的安装方式常用的有两种,一种是去官网下载,另一种是去GitHub下载,可以选择对应的系统版本进行下载

官网首页直接下载 https://ollama.com/
Github Relase下载 https://github.com/ollama/ollama/releases

 

模型

运行模型

ollama run qwen2:0.5b

 

访问

Ollama提供服务的本质是http接口,通过http接口的方式来调用/api/generate接口

curl http://localhost:11434/api/generate -d '{
  "model": "qwen2:7b",
  "prompt": "请你告诉我你知道的天气有哪些?用json格式输出",
  "stream": false
}'

 

useful links

https://www.cnblogs.com/mq0036/p/18866251