Last active
September 14, 2024 17:29
-
-
Save andrescevp/f0c43afa02a5802a5f58e54718221a27 to your computer and use it in GitHub Desktop.
Collection of scripts to setup IA locally in your machine using linux, docker and GPUs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# - Docker | |
# - Nvidia Toolkit | |
# Ollama Install | |
# https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image | |
# install nvidia toolkit | |
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installation | |
export DATA_DIR=$HOME | |
# Ollama CPU | |
docker run -d \ | |
--add-host host.docker.internal:host-gateway \ | |
-v $DATA_DIR/Ollama:/root/.ollama \ | |
--restart always \ | |
-p 11434:11434 \ | |
--name ollama \ | |
ollama/ollama | |
# Ollama Nvidia GPU | |
docker run \ | |
-d \ | |
--gpus=all \ | |
--add-host host.docker.internal:host-gateway \ | |
-v $DATA_DIR/Ollama:/root/.ollama \ | |
-p 11434:11434 \ | |
--restart always \ | |
--name ollama \ | |
ollama/ollama | |
# web ui for ollama | |
docker run -d \ | |
-p 8111:8080 \ | |
--add-host=host.docker.internal:host-gateway \ | |
-v $DATA_DIR/OpenWebUIData:/app/backend/data \ | |
--name open-webui \ | |
--restart always \ | |
--add-host host.docker.internal:host-gateway \ | |
ghcr.io/open-webui/open-webui:main | |
# ConfyUI | |
mkdir $DATA_DIR/ComfyUIData | |
docker run -d --rm \ | |
--name comfyui \ | |
--gpus all \ | |
-p 8188:8188 \ | |
-v $DATA_DIR/ComfyUIData:/home/runner \ | |
-e CLI_ARGS="" \ | |
--add-host host.docker.internal:host-gateway \ | |
--restart always \ | |
yanwk/comfyui-boot:cu121 | |
# OpenHands (OpenDevin) - container per session | |
docker run -it \ | |
--pull=always \ | |
--add-host host.docker.internal:host-gateway \ | |
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9-nikolaik \ | |
-e SANDBOX_USER_ID=$(id -u) \ | |
-e WORKSPACE_MOUNT_PATH=$DATA_DIR/OpenHandsData \ | |
-e LLM_API_KEY="ollama" \ | |
-e LLM_BASE_URL="http://host.docker.internal:11434" \ | |
-e LLM_OLLAMA_BASE_URL="http://host.docker.internal:11434" \ | |
-v $DATA_DIR/OpenHandsData:/opt/workspace_base \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-p 8112:3000 \ | |
--add-host host.docker.internal:host-gateway \ | |
--name openhands-app-$(date +%Y%m%d%H%M%S) \ | |
ghcr.io/all-hands-ai/openhands:0.9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment