Ollama install ubuntu 20.04: Perbedaan antara revisi
Loncat ke navigasi
Loncat ke pencarian
Tidak ada ringkasan suntingan |
|||
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/ | ||
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 | |||
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 | |||
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 | |||
Pastikan: | Pastikan: |
Revisi per 29 November 2024 08.06
Sumber: https://www.jeremymorgan.com/blog/generative-ai/local-llm-ubuntu/
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
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
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
Pastikan:
- OS bisa linux server, seperti ubuntu server.
- Memory RAM pastikan cukup untuk menyimpan model-nya. Model llama3 butuh memory paling tidak 8GB.
- Kalau mau lebih enak/lebih cepat sebaiknya pakai GPU, seperti nvidia telsa yang agak baru.
Install aplikasi pendukung
sudo su apt install curl
Download
curl -fsSL https://ollama.com/install.sh | sh
Sebagai user biasa run & download model
ollama serve ollama pull llama3 ollama run llama3
Install docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
OPTIONAL: Sebagai super user,
sudo su sudo snap install --beta open-webui
Install webui pake ini
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
Contoh
curl http://localhost:11434/api/generate -d '{ "model" : "llama3", "prompt" : "tell me a joke", "stream" : false }'
Download model ollama Indonesia