Ollama install ubuntu 20.04: Perbedaan antara revisi

Dari Dokumentasi Robie
Loncat ke navigasi Loncat ke pencarian
Tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
 
(5 revisi perantara oleh pengguna yang sama tidak ditampilkan)
Baris 1: Baris 1:
Sumber: https://www.jeremymorgan.com/blog/generative-ai/local-llm-ubuntu/
Sumber: https://www.jeremymorgan.com/blog/generative-ai/local-llm-ubuntu/
Pastinya sudah tidak asing lagi dengan chatGPT, pada kesempatan kali ini saya mencoba menginstall chatGPT versi lokal server dengan nama ollama. Didalam web ollama sudah disediakan model yang siap untuk digunakan.
Sebelum mulai menginstall semua aplikasi, saya menggunakan spek server seperti berikut
[[Berkas:Spek server ollama.jpg|pus|jmpl]]


Install docker
Install docker
Baris 40: Baris 46:


  docker volume create ollama_data
  docker volume create ollama_data
 
Menjalankan docker ollama_data
  docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
  docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
 
Perintah untuk melihat docker yang sedang berjalan
  docker ps
  docker ps
 
Perintah untuk menginstall ollama (mesin chatGPT) dan mendowload model bernama llama3.
  sudo docker exec ollama ollama run llama3
  sudo docker exec ollama ollama run llama3
 
Perintah untuk melihat status ollama
  sudo docker exec ollama ollama ps
  sudo docker exec ollama ollama ps
 
Perintah untuk menginstall docker open-webui agar ollama dan model dapat ditampilkan ke web based.
  docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
  docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main


Baris 54: Baris 60:


= History =
= History =
    1  apt update
      apt update
    2  apt upgrade
      apt upgrade
    3  apt install curl
      apt install curl
    4  # Add Docker's official GPG key:
      # Add Docker's official GPG key:
    5  sudo apt-get update
      sudo apt-get update
    6  sudo apt-get install ca-certificates curl
      sudo apt-get install ca-certificates curl
    7  sudo install -m 0755 -d /etc/apt/keyrings
      sudo install -m 0755 -d /etc/apt/keyrings
    8  sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
      sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
    9  sudo chmod a+r /etc/apt/keyrings/docker.asc
      sudo chmod a+r /etc/apt/keyrings/docker.asc
  10  # Add the repository to Apt sources:
        # Add the repository to Apt sources:
  11  echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
        echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  12    $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  13  sudo apt-get update
      sudo apt-get update
  14  apt install sudo
      apt install sudo
  15  # Add Docker's official GPG key:
      # Add Docker's official GPG key:
  16  sudo apt-get update
      sudo apt-get update
  17  sudo apt-get install ca-certificates curl
      sudo apt-get install ca-certificates curl
  18  sudo install -m 0755 -d /etc/apt/keyrings
      sudo install -m 0755 -d /etc/apt/keyrings
  19  sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
      sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
  20  sudo chmod a+r /etc/apt/keyrings/docker.asc
      sudo chmod a+r /etc/apt/keyrings/docker.asc
  21  # Add the repository to Apt sources:
      # Add the repository to Apt sources:
  22  echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
      echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  23    $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  24  sudo apt-get update
      sudo apt-get update
  25  sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
      sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  26  docker volume create ollama_data
      docker volume create ollama_data
  27  docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
      docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
  28  docker ps
      docker ps
  29  sudo docker exec ollama ollama run llama3
      sudo docker exec ollama ollama run llama3
  30  sudo docker exec ollama ollama ps
      sudo docker exec ollama ollama ps
  31  docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open- webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
      docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open- webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
    32  ip a
    33  history
root@debian:~#




=  Referensi =
=  Referensi =
https://docs.docker.com/engine/install/debian/
https://docs.docker.com/engine/install/debian/
https://ollama.com/

Revisi terkini sejak 30 November 2024 04.52

Sumber: https://www.jeremymorgan.com/blog/generative-ai/local-llm-ubuntu/

Pastinya sudah tidak asing lagi dengan chatGPT, pada kesempatan kali ini saya mencoba menginstall chatGPT versi lokal server dengan nama ollama. Didalam web ollama sudah disediakan model yang siap untuk digunakan.

Sebelum mulai menginstall semua aplikasi, saya menggunakan spek server seperti berikut

Gagal membuat miniatur: Berkas tak ditemukan


Install docker

Ubuntu

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Debian

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 
https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

membuat docker baru

docker volume create ollama_data

Menjalankan docker ollama_data

docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

Perintah untuk melihat docker yang sedang berjalan

docker ps

Perintah untuk menginstall ollama (mesin chatGPT) dan mendowload model bernama llama3.

sudo docker exec ollama ollama run llama3

Perintah untuk melihat status ollama

sudo docker exec ollama ollama ps

Perintah untuk menginstall docker open-webui agar ollama dan model dapat ditampilkan ke web based.

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main


History

      apt update
      apt upgrade
      apt install curl
      # Add Docker's official GPG key:
      sudo apt-get update
      sudo apt-get install ca-certificates curl
      sudo install -m 0755 -d /etc/apt/keyrings
      sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
      sudo chmod a+r /etc/apt/keyrings/docker.asc
       # Add the repository to Apt sources:
       echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |   sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      sudo apt-get update
      apt install sudo
      # Add Docker's official GPG key:
      sudo apt-get update
      sudo apt-get install ca-certificates curl
      sudo install -m 0755 -d /etc/apt/keyrings
      sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
      sudo chmod a+r /etc/apt/keyrings/docker.asc
      # Add the repository to Apt sources:
      echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |   sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      sudo apt-get update
      sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
      docker volume create ollama_data
      docker run -d -v ollama_data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
      docker ps
      sudo docker exec ollama ollama run llama3
      sudo docker exec ollama ollama ps
      docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open- webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main


Referensi

https://docs.docker.com/engine/install/debian/

https://ollama.com/