Spring AI(大模型工具Ollama介绍)
接上篇:Spring AI(多模态)
View Code
View Code
1、大模型工具Ollama介绍
本地搭建一套ollama大模型,不需要 open ai api key了,就可以进行功能上的开发;
2、大模型工具Ollama下载
官网下载地址:https://ollama.com/download
3、大模型工具Ollama安装
4、大模型工具Ollama运行
为ollama大模型工具安装一个底层模型(实现),此处使用阿里云的 qwen:0.5b-chat,也可选择其他的底层模型;
ollama run qwen:0.5b-chat
此处ollama底层选用阿里云的qwen(也可以选择其他的模型)
PS C:\Users\shiji> ollama run qwen:0.5b-chat pulling manifest pulling fad2a06e4cc7... 100% ▕████████████████████████████████████████████████████████▏ 394 MB pulling 41c2cf8c272f... 100% ▕████████████████████████████████████████████████████████▏ 7.3 KB pulling 1da0581fd4ce... 100% ▕████████████████████████████████████████████████████████▏ 130 B pulling f02dd72bb242... 100% ▕████████████████████████████████████████████████████████▏ 59 B pulling ea0a531a015b... 100% ▕████████████████████████████████████████████████████████▏ 485 B verifying sha256 digest writing manifest removing any unused layers success >>> 北京 北京是中国的首都,也是中国的四大古都之一。北京拥有众多的历史文化遗产和现代设施,是国内外游客的重要目的地。 >>> beijing Beijing is a provincial capital of China. It is located in the northeastern region of China, and it faces the Pacific Ocean on its west. Beijing has a rich history, which can be traced back to ancient times. The city has several important historical landmarks and cultural sites, such as Beijing opera house, Tiananmen Square, and the Great Wall. Beijing is also known for its modern technology and infrastructure. Many major companies have operations in Beijing, and it is also home to many international companies operating in China. In summary, Beijing is a provincial capital of China, located in the northeastern region of China. It has a rich history, modern technology, and infrastructure, making it a popular tourist destination worldwide. >>> 将一个简单的笑话 当一只蝴蝶在花园里翩翩起舞时,人们往往会问:“蝴蝶怎么跳舞呢?” >>> Send a message (/? for help)
5、大模型工具Ollama默认端口
netstat -ano | findstr 11434
C:\Users\shiji>netstat -ano | findstr 11434 TCP 127.0.0.1:11434 0.0.0.0:0 LISTENING 33492 TCP 127.0.0.1:52797 127.0.0.1:11434 TIME_WAIT 0 C:\Users\shiji>
至此,ai大模型工具ollama安装成功。示例中使用的是底层阿里云的qwen,并且选用的是0.5b-chat(5亿数据量的聊天模型,若需要更精准,建议选用大一点的)