2025年5月17日星期六

linux下的ollama的代理设置

需要在/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="PATH=/home/abc/.local/bin"

Environment="PATH=$PATH"

Environment="CUDA_VISIBLE_DEVICES=0,1,2,3"

Environment="OLLAMA_SCHED_SPREAD=1"

Environment="OLLAMA_KEEP_ALIVE=-1"

Environment="OLLAMA_HOST=0.0.0.0"

Environment="OLLAMA_NUM_PARALLEL=10"

Environment="OLLAMA_ORIGINS=*"

Environment="https_proxy=http://abc.com:80"

Environment="http_proxy=http://abc.com:80"

[Install]

WantedBy=default.target


没有评论:

发表评论

小型网站的ubuntu服务器如何提升连接数

 当服务器有多个api应用,或者网站的时候,会出现网页打不开。但是cpu、内存等都很空闲。这种情况,有可能是网站的文件数设置不正确。 查询服务器支持的TCP连接数: ulimit -n 默认是1024 需要增加方法: 编辑/etc/security/limits.conf * s...