refs:
https://github.com/ollama/ollama/blob/main/docs/linux.md
1)安装
curl -fsSL https://ollama.com/install.sh | sh
2)修改服务配置,打开端口允许所有IP地址
refs(https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored)
Create a service file in /etc/systemd/system/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="OLLAMA_HOST=0.0.0.0"
Environment="PATH=/home/dtjk/bin:/home/dtjk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dtjk/.dotnet/tools:/home/dtjk/.dotnet/tools"[Install]
WantedBy=default.target
3)更新配置
sudo systemctl daemon-reload
sudo service ollama restart
4)check端口状况文章来源:https://www.toymoban.com/news/detail-841875.html
~$ sudo lsof -i:11434
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ollama 17243 ollama 3u IPv6 416111630 0t0 TCP *:11434 (LISTEN)文章来源地址https://www.toymoban.com/news/detail-841875.html
到了这里,关于linux下的ollama的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!