diff --git a/.continue/config.json b/.continue/config.json index f38e8df..7e82ff6 100644 --- a/.continue/config.json +++ b/.continue/config.json @@ -30,12 +30,14 @@ } ], "embeddingsProvider": { + "apiBase": "http://127.0.0.1:11434", "model": "nomic-embed-text:137m-v1.5-fp16", - "provider": "ollama" + "provider": "ollama", + "title": "embed local network" }, "models": [ { - "apiBase": "http://192.168.2.74:11434", + "apiBase": "http://127.0.0.1:11434", "model": "qwen2.5-coder:32b-instruct-q8_0", "provider": "ollama", "title": "local network" @@ -86,8 +88,9 @@ } ], "tabAutocompleteModel": { + "apiBase": "http://127.0.0.1:11434", "model": "qwen2.5-coder:32b-base-q8_0", "provider": "ollama", - "title": "tab qwen2.5-coder:32b-base-q8_0" + "title": "tab local network" } } diff --git a/bin/get-ip b/bin/get-ip index ffd6b42..962a8c6 100755 --- a/bin/get-ip +++ b/bin/get-ip @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -euo pipefail -if which ifconfig 2>&1 >/dev/null ; then +if type ifconfig &>/dev/null ; then ifconfig | grep -v '127\.0\.0\.' | sed -e 's;broadcast.*;;' -e 's;Bcast.*;;' -e 's;netmast.*;;' -e 's;Mask.*;;' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' -elif which networkctl 2>&1 >/dev/null ; then +elif type networkctl &>/dev/null ; then networkctl status 2>&1 | grep -v -E '(docker|carrier|Link)' | grep -v 'Gateway' | grep ' on ' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' fi diff --git a/bin/get-nic b/bin/get-nic index fc63558..fcffad9 100755 --- a/bin/get-nic +++ b/bin/get-nic @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -euo pipefail -if which ifconfig 2>&1 >/dev/null ; then +if type ifconfig &>/dev/null ; then ifconfig | grep -v -E '(^lo0|lo0 | ::1 | 127\.0\.0\.1 )' | grep -E '(^[a-z]|inet )' | grep -B1 'inet' | sed 's/flags=.*UP,/UP,/' | sed 's/UP,.*//' | sed "s, netmask,\n netmask," | sed "s, broadcast,\n broadcast," -elif which networkctl 2>&1 >/dev/null ; then +elif type networkctl &>/dev/null ; then networkctl status 2>&1 | grep -v -E '(docker|carrier|Link)' fi diff --git a/bin/macos-brew-update.sh b/bin/macos-brew-update.sh index 7fbccef..e09fd30 100755 --- a/bin/macos-brew-update.sh +++ b/bin/macos-brew-update.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -if which brew >/dev/null 2>&1 ; then +if type brew &>/dev/null ; then if [[ -e Brewfile ]] ; then set -x brew bundle || true diff --git a/bin/macos-ollama-server.sh b/bin/macos-ollama-server.sh new file mode 100755 index 0000000..8faf43b --- /dev/null +++ b/bin/macos-ollama-server.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +export OLLAMA_HOST=`get-ip`:11434 + +if type ollama &>/dev/null ; then + ollama serve +else + echo "ERROR: missing 'ollama'" + exit 1 +fi diff --git a/bin/macos-setup/macos-podmandesktop-init.sh b/bin/macos-setup/macos-podmandesktop-init.sh index 4bc109b..99c0750 100644 --- a/bin/macos-setup/macos-podmandesktop-init.sh +++ b/bin/macos-setup/macos-podmandesktop-init.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -if which podman >/dev/null 2>&1 ; then +if type podman &>/dev/null ; then set -x podman machine init podman machine start diff --git a/bin/setup-python3.sh b/bin/setup-python3.sh index 29c9e48..0e16095 100755 --- a/bin/setup-python3.sh +++ b/bin/setup-python3.sh @@ -11,7 +11,7 @@ if command -v apt-get >/dev/null 2>&1 ; then export DEBIAN_FRONTEND=noninteractive # Dependency for virtualenv sudo apt-get install --yes build-essential python-dev libffi-dev - which virtualenv || sudo apt-get install --yes python-virtualenv + type virtualenv &>/dev/null || sudo apt-get install --yes python-virtualenv # Dependency for ansible sudo apt-get install --yes libssl-dev fi @@ -32,7 +32,7 @@ echo "=> Detecting pip3, pip2 or pip..." command -v pip >/dev/null 2>&1 && PIP_BIN="pip" command -v pip3 >/dev/null 2>&1 && PIP_BIN="pip3" -if ! which python | grep -q ${VENV_FOLDER} ; then +if ! type python | grep -q ${VENV_FOLDER} ; then echo "!! Failed to use venv" exit 1 fi diff --git a/bin/ubuntu-container.sh b/bin/ubuntu-container.sh index ca85605..ae37e30 100755 --- a/bin/ubuntu-container.sh +++ b/bin/ubuntu-container.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -eux -if which docker >/dev/null 2>&1 ; then +if type docker &>/dev/null ; then DOCKER_BIN=docker else - if which podman >/dev/null 2>&1 ; then + if type podman &>/dev/null ; then DOCKER_BIN=podman fi fi diff --git a/bin/ubuntu-create-cloudinit-iso.sh b/bin/ubuntu-create-cloudinit-iso.sh index b3d12df..fd0c722 100755 --- a/bin/ubuntu-create-cloudinit-iso.sh +++ b/bin/ubuntu-create-cloudinit-iso.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -eux -if which docker >/dev/null 2>&1 ; then +if type docker &>/dev/null ; then DOCKER_BIN=docker else - if which podman >/dev/null 2>&1 ; then + if type podman &>/dev/null ; then DOCKER_BIN=podman fi fi