0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Proxy 環境下で Ollama のモデルを pull する

0
Posted at

Proxy 環境下で Ollama のモデルを pull する

社内ネットワークなど,Proxy 経由でインターネットへ接続する Ubuntu 環境でモデルの pull に失敗する場合,systemctl editoverride.conf で Proxy を指定する.

1. systemctl edit で設定する方法

Ollama の systemd 設定を編集する.

sudo systemctl edit ollama

エディタが開いたら,以下を追加する.(プロキシ,ポートは適宜変更する)

[Service]
Environment="HTTPS_PROXY=http://プロキシ:ポート"
Environment="NO_PROXY=localhost,127.0.0.1"

保存後,systemd の設定を再読み込みし,Ollama を再起動する.

sudo systemctl daemon-reload
sudo systemctl restart ollama

これで,

ollama pull モデル名

などを実行すると,Proxy 経由でモデルを取得できるようになる.

2. override.conf を直接作成する方法

systemctl edit を使用せず,設定ファイルを直接作成することもできる.

sudo mkdir -p /etc/systemd/system/ollama.service.d/
sudo vi /etc/systemd/system/ollama.service.d/override.conf

以下を記述する.(プロキシ,ポートは適宜変更する)

[Service]
Environment="HTTPS_PROXY=http://プロキシ:ポート"
Environment="NO_PROXY=localhost,127.0.0.1"

その後,同様に再読み込みと再起動を行う.

sudo systemctl daemon-reload
sudo systemctl restart ollama

つまり,systemd の drop-in 設定を追加する.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?