Ollama 更改监听/Keep_Alive设置

How do I configure Ollama server?

Ollama server can be configured with environment variables.

Setting environment variables on Mac

If Ollama is run as a macOS application, environment variables should be set using launchctl:

  1. For each environment variable, call launchctl setenv. launchctl setenv OLLAMA_HOST "0.0.0.0:11434"
  2. Restart Ollama application.

Setting environment variables on Linux

If Ollama is run as a systemd service, environment variables should be set using systemctl:

  1. Edit the systemd service by calling systemctl edit ollama.service. This will open an editor.
  2. For each environment variable, add a line Environment under section [Service]: [Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
  3. Save and exit.
  4. Reload systemd and restart Ollama:
   systemctl daemon-reload
   systemctl restart ollama

Setting environment variables on Windows

On Windows, Ollama inherits your user and system environment variables.

Start the Ollama application from the Windows Start menu.

First Quit Ollama by clicking on it in the task bar.

Start the Settings (Windows 11) or Control Panel (Windows 10) application and search for environment variables.

Click on Edit environment variables for your account.

Edit or create a new variable for your user account for OLLAMA_HOST, OLLAMA_MODELS, etc.

Click OK/Apply to save.

更改用户环境变量,添加

OLLAMA_HOST 值为 0.0.0.0

OLLAMA_KEEP_ALIVE 如果想久一些,简单的方法是-1,如果不生效,改成一个较大的数值即可,例如1000000

参考:

https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇