AI/Ollama: Difference between revisions
Jump to navigation
Jump to search
| Line 403: | Line 403: | ||
{|class='wikitable mw-collapsible mw-collapsed' | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Legion 5 Pro (Gen6 + R7 5800H + 32GB + 1TB) | |||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
| Line 422: | Line 422: | ||
>>> Adding current user to ollama group... | >>> Adding current user to ollama group... | ||
>>> Creating ollama systemd service... | >>> Creating ollama systemd service... | ||
>>> Enabling and starting ollama service... | |||
>>> | Created symlink /etc/systemd/system/default.target.wants/ollama.service → /etc/systemd/system/ollama.service. | ||
>>> NVIDIA GPU installed. | |||
>>> | |||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 444: | Line 441: | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed' | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| Ollama » | !scope='col' style='text-align:left' colspan='2'| Ollama » Utility | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
sudo journalctl -u ollama --no-pager | grep -i "sycl\|intel\|gpu" | sudo journalctl -u ollama --no-pager | grep -i "sycl\|intel\|gpu" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 462: | Line 458: | ||
apt-get clean;sleep 5 | apt-get clean;sleep 5 | ||
EXE | EXE | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
| Line 544: | Line 473: | ||
User=ollama | User=ollama | ||
Group=ollama | Group=ollama | ||
# Ollama listens on any host | # Ollama listens on any host | ||
Environment="OLLAMA_HOST=0.0.0.0" | Environment="OLLAMA_HOST=0.0.0.0" | ||
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" | Environment="PATH=/home/linuxbrew/.linuxbrew/Cellar/pyenv-virtualenv/1.2.3/shims:/home/shahed/.pyenv/shims:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/shahed/.rbenv/shims:/home/shahed/.rbenv/bin:/home/shahed/.cargo/bin:/home/shahed/.nvm/versions/node/v18.12.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/cli/sencha/cmd:/opt/cli/sencha/cmd:/home/shahed/.local/share/JetBrains/Toolbox/scripts:/home/shahed/.local/share/JetBrains/Toolbox/scripts" | ||
ExecStart=/usr/local/bin/ollama serve | ExecStart=/usr/local/bin/ollama serve | ||
| Line 580: | Line 506: | ||
telnet 10.20.40.16 11434 | telnet 10.20.40.16 11434 | ||
telnet 192.168.49.2 11434 | telnet 192.168.49.2 11434 | ||
telnet shahed- | telnet shahed-ac.local 11434 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
| Line 643: | Line 569: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
export ANTHROPIC_BASE_URL=http://shahed- | export ANTHROPIC_BASE_URL=http://shahed-ac.local:11434 | ||
export ANTHROPIC_AUTH_TOKEN=ollama | export ANTHROPIC_AUTH_TOKEN=ollama | ||
export ANTHROPIC_API_KEY='' | export ANTHROPIC_API_KEY='' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
| Line 661: | Line 580: | ||
ollama ps | ollama ps | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top'| | |||
|} | |} | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed' | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
ASUS NUC 15 Pro (L10 + U7 255H + 64GB + 2TB) | |||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
| Line 684: | Line 606: | ||
>>> Adding current user to ollama group... | >>> Adding current user to ollama group... | ||
>>> Creating ollama systemd service... | >>> Creating ollama systemd service... | ||
>>> | WARNING: systemd is not running | ||
>>> The Ollama API is now available at 127.0.0.1:11434. | |||
>>> | >>> Install complete. Run "ollama" from the command line. | ||
WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode. | |||
>>> The Ollama API is now available at 127.0.0.1:11434. | |||
>>> Install complete. Run "ollama" from the command line. | |||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 703: | Line 628: | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed' | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| Ollama » | !scope='col' style='text-align:left' colspan='2'| Ollama » ArcGPU | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
sudo journalctl -u ollama --no-pager | grep -i "sycl\|intel\|gpu" | sudo journalctl -u ollama --no-pager | grep -i "sycl\|intel\|gpu" | ||
sudo intel_gpu_top | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 720: | Line 646: | ||
apt-get clean;sleep 5 | apt-get clean;sleep 5 | ||
EXE | EXE | ||
</syntaxhighlight> | |||
|- | |||
!scope='col'| Intel | |||
!scope='col'| Ubuntu | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
curl -fsSL https://repositories.intel.com/gpu/intel-graphics.key \ | |||
| sudo tee /etc/apt/keyrings/intel-graphics.asc >/dev/null | |||
DISTRIBUTION=$(. /etc/os-release && echo "${VERSION_CODENAME}") | |||
cat << SRC | sudo tee /etc/apt/sources.list.d/intel-graphics.list >/dev/null | |||
deb [arch=$(dpkg --print-architecture)\ | |||
signed-by=/etc/apt/keyrings/intel-graphics.asc]\ | |||
https://repositories.intel.com/gpu/ubuntu ${DISTRIBUTION} unified | |||
SRC | |||
cat <<'EXE' | sudo bash | |||
apt-get update;echo | |||
apt-get upgrade -y;echo | |||
apt-get install -y intel-gpu-tools | |||
apt-get install -y intel-opencl-icd libze1 libze-intel-gpu1 | |||
apt-get install -y clinfo intel-media-va-driver-non-free | |||
apt-get clean | |||
EXE | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
cat <<'EXE' | sudo bash | |||
rm /etc/apt/sources.list.d/intel-graphics.list | |||
rm /etc/apt/keyrings/intel-graphics.asc | |||
EXE | |||
cat <<'EXE' | sudo bash | |||
apt-get update;echo | |||
apt-get upgrade -y;echo | |||
apt-get purge -y intel-gpu-tools | |||
apt-get purge -y intel-opencl-icd libze1 libze-intel-gpu1 | |||
apt-get install -y clinfo intel-media-va-driver-non-free | |||
apt-get clean | |||
EXE | |||
cat <<'EXE' | sudo bash | |||
apt-get update;echo | |||
apt-get upgrade -y;echo | |||
apt-get install -y intel-opencl-icd libze-intel-gpu1 libze1 | |||
apt-get install -y intel-media-va-driver-non-free clinfo | |||
apt-get install -y intel-gpu-tools | |||
apt-get clean | |||
EXE | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
ollama ps | |||
ls /dev/dri | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
sudo intel_gpu_top | |||
clinfo | grep 'Device Name' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
| Line 735: | Line 728: | ||
User=ollama | User=ollama | ||
Group=ollama | Group=ollama | ||
# Intel optimizations if available | |||
Environment="OLLAMA_INTEL_GPU=1" | |||
# Ollama listens on any host | # Ollama listens on any host | ||
Environment="OLLAMA_HOST=0.0.0.0" | Environment="OLLAMA_HOST=0.0.0.0" | ||
Environment="PATH= | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" | ||
ExecStart=/usr/local/bin/ollama serve | ExecStart=/usr/local/bin/ollama serve | ||
| Line 768: | Line 764: | ||
telnet 10.20.40.16 11434 | telnet 10.20.40.16 11434 | ||
telnet 192.168.49.2 11434 | telnet 192.168.49.2 11434 | ||
telnet shahed- | telnet shahed-ap.local 11434 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
| Line 831: | Line 827: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
export ANTHROPIC_BASE_URL=http://shahed- | export ANTHROPIC_BASE_URL=http://shahed-ap.local:11434 | ||
export ANTHROPIC_AUTH_TOKEN=ollama | export ANTHROPIC_AUTH_TOKEN=ollama | ||
export ANTHROPIC_API_KEY='' | export ANTHROPIC_API_KEY='' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
export ANTHROPIC_BASE_URL=http://10.20.40.16:11434 | |||
export ANTHROPIC_AUTH_TOKEN=ollama | |||
export ANTHROPIC_API_KEY='' | |||
</syntaxhighlight> | |||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
| Line 842: | Line 845: | ||
ollama ps | ollama ps | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
|} | |} | ||
Revision as of 16:15, 8 March 2026
curl -fsSL https://ollama.com/install.sh | sh
ollama pull gpt-oss:20b
ollama --version
ollama ls
curl -fsSL https://claude.ai/install.sh | bash
ollama launch claude --model gpt-oss:20b
|
export ANTHROPIC_BASE_URL=http://localhost:11434
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=''
export OLLAMA_NUM_CTX=32768
export OLLAMA_KEEP_ALIVE=5m
claude --model gpt-oss:20b
| ||||
| |||||
Optimization
|
Optimization | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Installation
|
Installation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
References
|
References | ||
|---|---|---|