From 84ca5b2b75dde885fbb9ba9f805ff8fba2e27a48 Mon Sep 17 00:00:00 2001 From: mirage335 Date: Tue, 21 Oct 2025 22:22:10 +0100 Subject: [PATCH] Upstream. --- _lib/ubiquitous_bash | 2 +- compile.sh | 174 +++++++++++++++++++++--------- ubiquitous_bash.sh | 250 ++++++++++++++++++++++++++++++++----------- 3 files changed, 313 insertions(+), 113 deletions(-) diff --git a/_lib/ubiquitous_bash b/_lib/ubiquitous_bash index 59dc725..6e7ed87 160000 --- a/_lib/ubiquitous_bash +++ b/_lib/ubiquitous_bash @@ -1 +1 @@ -Subproject commit 59dc7258af7e4a0bf4ba0cd4ac889b6dca52d303 +Subproject commit 6e7ed87cd935367690ed2a21682faec84d4c46e0 diff --git a/compile.sh b/compile.sh index a260793..28f9660 100755 --- a/compile.sh +++ b/compile.sh @@ -39,7 +39,7 @@ _ub_cksum_special_derivativeScripts_contents() { #export ub_setScriptChecksum_disable='true' ( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true' export ub_setScriptChecksum_header='3620520443' -export ub_setScriptChecksum_contents='2856944674' +export ub_setScriptChecksum_contents='2181078362' # CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary. # WARNING: Performance may be crucial here. @@ -3227,21 +3227,82 @@ _wait_not_all_exist() { #http://stackoverflow.com/questions/687948/timeout-a-command-in-bash-without-unnecessary-delay _timeout() { ( set +b; sleep "$1" & "${@:2}" & wait -n; r=$?; kill -9 `jobs -p`; exit $r; ) } + +# NOTICE +# ATTRIBUTION-AI: Modern terminate of subprocesses. ubChatGPT o3 GPT-5 2025-09-28 + + + +# List all descendants (children, grandchildren, ...) of a PID (one PID per line). +# The PID itself is NOT included. +_descendants_of_pid() { + local rootPID="$1" + local -a q=("$rootPID") out=() + local cur ch + while ((${#q[@]})); do + cur="${q[0]}"; q=("${q[@]:1}") + while read -r ch; do + [[ -z "$ch" ]] && continue + out+=("$ch") + q+=("$ch") + done < <(pgrep -P "$cur" 2>/dev/null || true) + done + ((${#out[@]})) && printf '%s\n' "${out[@]}" | sort -u +} + +# Send a signal (default TERM) to descendants only (not the parent/wrapper). +_kill_descendants_only() { + local rootPID="$1" sig="${2:-TERM}" lst + lst="$(_descendants_of_pid "$rootPID")" + if [[ -n "$lst" ]]; then + # shellcheck disable=SC2086 + kill -s "$sig" $lst 2>/dev/null || true + ! _if_cygwin && sudo -n kill -s "$sig" $lst 2>/dev/null || true + fi +} + + _terminate() { - local processListFile - processListFile="$tmpSelf"/.pidlist_$(_uid) - - local currentPID - - cat "$safeTmp"/.pid >> "$processListFile" 2> /dev/null - - while read -r currentPID - do - pkill -P "$currentPID" - kill "$currentPID" - done < "$processListFile" - - rm "$processListFile" + local processListFile + processListFile="$tmpSelf"/.pidlist_$(_uid) + local currentPID + + cat "$safeTmp"/.pid >> "$processListFile" 2> /dev/null + + # 1) descendants only (per-connection socats, etc.) + while read -r currentPID; do + _kill_descendants_only "$currentPID" TERM + done < "$processListFile" + + # 2) Kill direct children (listener) so "$@" returns and _stop can run + while read -r currentPID; do + pkill -P "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n pkill -P "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # 3) Grace period so wrappers can run _stop and clean $safeTmp + while read -r currentPID; do + for _i in 1 2 3 4 5; do + ps --no-headers -p "$currentPID" &>/dev/null || break + sleep 0.2 + done + # 4) If still alive, ask wrapper to exit (triggers traps/_stop) + ps --no-headers -p "$currentPID" &>/dev/null && kill "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # ... keep your existing backoff/wait code here if present ... + + if [[ "$ub_kill" == "true" ]]; then + # 5) Last resort + while read -r currentPID; do + _kill_descendants_only "$currentPID" KILL + pkill -KILL -P "$currentPID" 2>/dev/null || true + kill -KILL "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n kill -KILL "$currentPID" 2>/dev/null || true + done < "$processListFile" + fi + + rm "$processListFile" } _terminateMetaHostAll() { @@ -3291,41 +3352,54 @@ _terminateAll_sequence() { } _terminateAll_procedure() { _terminateMetaHostAll - - local processListFile - processListFile="$tmpSelf"/.pidlist_$(_uid) - - local currentPID - - - cat ./.s_*/.pid >> "$processListFile" 2> /dev/null - - cat ./.e_*/.pid >> "$processListFile" 2> /dev/null - cat ./.m_*/.pid >> "$processListFile" 2> /dev/null - - cat ./w_*/.pid >> "$processListFile" 2> /dev/null - - while read -r currentPID - do - pkill -P "$currentPID" - ! _if_cygwin && sudo -n pkill -P "$currentPID" - kill "$currentPID" - ! _if_cygwin && sudo -n kill "$currentPID" - done < "$processListFile" - - if [[ "$ub_kill" == "true" ]] - then - sleep 9 - while read -r currentPID - do - pkill -KILL -P "$currentPID" - ! _if_cygwin && sudo -n pkill -KILL -P "$currentPID" - kill -KILL "$currentPID" - ! _if_cygwin && sudo -n kill -KILL "$currentPID" - done < "$processListFile" - fi - - rm "$processListFile" + + local processListFile + processListFile="$tmpSelf"/.pidlist_$(_uid) + local currentPID + + # snapshot of all known wrapper PIDs + cat ./.s_*/.pid >> "$processListFile" 2> /dev/null + cat ./.e_*/.pid >> "$processListFile" 2> /dev/null + cat ./.m_*/.pid >> "$processListFile" 2> /dev/null + cat ./w_*/.pid >> "$processListFile" 2> /dev/null + + # 1) descendants only + while read -r currentPID; do + _kill_descendants_only "$currentPID" TERM + done < "$processListFile" + + # 2) direct children (listeners) + while read -r currentPID; do + pkill -P "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n pkill -P "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # 3) grace for _stop to clean $safeTmp + while read -r currentPID; do + for _i in 1 2 3 4 5; do + ps --no-headers -p "$currentPID" &>/dev/null || break + sleep 0.2 + done + # 4) only if still around, nudge parent (runs traps) + ps --no-headers -p "$currentPID" &>/dev/null && kill "$currentPID" 2>/dev/null || true + done < "$processListFile" + + if [[ "$ub_kill" == "true" ]]; then + while read -r currentPID; do + _kill_descendants_only "$currentPID" KILL + pkill -KILL -P "$currentPID" 2>/dev/null || true + kill -KILL "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n kill -KILL "$currentPID" 2>/dev/null || true + done < "$processListFile" + fi + + rm "$processListFile" +} + +_killAll_procedure() { + export ub_kill="true" + _terminateAll_procedure + export ub_kill= } _killAll() { diff --git a/ubiquitous_bash.sh b/ubiquitous_bash.sh index a1b234e..1b3f39f 100755 --- a/ubiquitous_bash.sh +++ b/ubiquitous_bash.sh @@ -39,7 +39,7 @@ _ub_cksum_special_derivativeScripts_contents() { #export ub_setScriptChecksum_disable='true' ( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true' export ub_setScriptChecksum_header='3620520443' -export ub_setScriptChecksum_contents='3577355353' +export ub_setScriptChecksum_contents='33799528' # CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary. # WARNING: Performance may be crucial here. @@ -3227,21 +3227,82 @@ _wait_not_all_exist() { #http://stackoverflow.com/questions/687948/timeout-a-command-in-bash-without-unnecessary-delay _timeout() { ( set +b; sleep "$1" & "${@:2}" & wait -n; r=$?; kill -9 `jobs -p`; exit $r; ) } + +# NOTICE +# ATTRIBUTION-AI: Modern terminate of subprocesses. ubChatGPT o3 GPT-5 2025-09-28 + + + +# List all descendants (children, grandchildren, ...) of a PID (one PID per line). +# The PID itself is NOT included. +_descendants_of_pid() { + local rootPID="$1" + local -a q=("$rootPID") out=() + local cur ch + while ((${#q[@]})); do + cur="${q[0]}"; q=("${q[@]:1}") + while read -r ch; do + [[ -z "$ch" ]] && continue + out+=("$ch") + q+=("$ch") + done < <(pgrep -P "$cur" 2>/dev/null || true) + done + ((${#out[@]})) && printf '%s\n' "${out[@]}" | sort -u +} + +# Send a signal (default TERM) to descendants only (not the parent/wrapper). +_kill_descendants_only() { + local rootPID="$1" sig="${2:-TERM}" lst + lst="$(_descendants_of_pid "$rootPID")" + if [[ -n "$lst" ]]; then + # shellcheck disable=SC2086 + kill -s "$sig" $lst 2>/dev/null || true + ! _if_cygwin && sudo -n kill -s "$sig" $lst 2>/dev/null || true + fi +} + + _terminate() { - local processListFile - processListFile="$tmpSelf"/.pidlist_$(_uid) - - local currentPID - - cat "$safeTmp"/.pid >> "$processListFile" 2> /dev/null - - while read -r currentPID - do - pkill -P "$currentPID" - kill "$currentPID" - done < "$processListFile" - - rm "$processListFile" + local processListFile + processListFile="$tmpSelf"/.pidlist_$(_uid) + local currentPID + + cat "$safeTmp"/.pid >> "$processListFile" 2> /dev/null + + # 1) descendants only (per-connection socats, etc.) + while read -r currentPID; do + _kill_descendants_only "$currentPID" TERM + done < "$processListFile" + + # 2) Kill direct children (listener) so "$@" returns and _stop can run + while read -r currentPID; do + pkill -P "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n pkill -P "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # 3) Grace period so wrappers can run _stop and clean $safeTmp + while read -r currentPID; do + for _i in 1 2 3 4 5; do + ps --no-headers -p "$currentPID" &>/dev/null || break + sleep 0.2 + done + # 4) If still alive, ask wrapper to exit (triggers traps/_stop) + ps --no-headers -p "$currentPID" &>/dev/null && kill "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # ... keep your existing backoff/wait code here if present ... + + if [[ "$ub_kill" == "true" ]]; then + # 5) Last resort + while read -r currentPID; do + _kill_descendants_only "$currentPID" KILL + pkill -KILL -P "$currentPID" 2>/dev/null || true + kill -KILL "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n kill -KILL "$currentPID" 2>/dev/null || true + done < "$processListFile" + fi + + rm "$processListFile" } _terminateMetaHostAll() { @@ -3291,41 +3352,54 @@ _terminateAll_sequence() { } _terminateAll_procedure() { _terminateMetaHostAll - - local processListFile - processListFile="$tmpSelf"/.pidlist_$(_uid) - - local currentPID - - - cat ./.s_*/.pid >> "$processListFile" 2> /dev/null - - cat ./.e_*/.pid >> "$processListFile" 2> /dev/null - cat ./.m_*/.pid >> "$processListFile" 2> /dev/null - - cat ./w_*/.pid >> "$processListFile" 2> /dev/null - - while read -r currentPID - do - pkill -P "$currentPID" - ! _if_cygwin && sudo -n pkill -P "$currentPID" - kill "$currentPID" - ! _if_cygwin && sudo -n kill "$currentPID" - done < "$processListFile" - - if [[ "$ub_kill" == "true" ]] - then - sleep 9 - while read -r currentPID - do - pkill -KILL -P "$currentPID" - ! _if_cygwin && sudo -n pkill -KILL -P "$currentPID" - kill -KILL "$currentPID" - ! _if_cygwin && sudo -n kill -KILL "$currentPID" - done < "$processListFile" - fi - - rm "$processListFile" + + local processListFile + processListFile="$tmpSelf"/.pidlist_$(_uid) + local currentPID + + # snapshot of all known wrapper PIDs + cat ./.s_*/.pid >> "$processListFile" 2> /dev/null + cat ./.e_*/.pid >> "$processListFile" 2> /dev/null + cat ./.m_*/.pid >> "$processListFile" 2> /dev/null + cat ./w_*/.pid >> "$processListFile" 2> /dev/null + + # 1) descendants only + while read -r currentPID; do + _kill_descendants_only "$currentPID" TERM + done < "$processListFile" + + # 2) direct children (listeners) + while read -r currentPID; do + pkill -P "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n pkill -P "$currentPID" 2>/dev/null || true + done < "$processListFile" + + # 3) grace for _stop to clean $safeTmp + while read -r currentPID; do + for _i in 1 2 3 4 5; do + ps --no-headers -p "$currentPID" &>/dev/null || break + sleep 0.2 + done + # 4) only if still around, nudge parent (runs traps) + ps --no-headers -p "$currentPID" &>/dev/null && kill "$currentPID" 2>/dev/null || true + done < "$processListFile" + + if [[ "$ub_kill" == "true" ]]; then + while read -r currentPID; do + _kill_descendants_only "$currentPID" KILL + pkill -KILL -P "$currentPID" 2>/dev/null || true + kill -KILL "$currentPID" 2>/dev/null || true + ! _if_cygwin && sudo -n kill -KILL "$currentPID" 2>/dev/null || true + done < "$processListFile" + fi + + rm "$processListFile" +} + +_killAll_procedure() { + export ub_kill="true" + _terminateAll_procedure + export ub_kill= } _killAll() { @@ -22238,8 +22312,6 @@ _createVMimage() { [[ -e "$lock_open" ]] && _messagePlain_bad 'bad: locked!' && _messageFAIL && _stop 1 [[ -e "$scriptLocal"/l_o ]] && _messagePlain_bad 'bad: locked!' && _messageFAIL && _stop 1 - [[ "$ubVirtImageOverride" == "" ]] && ! [[ $(df --block-size=1000000000 --output=avail "$scriptLocal" | tr -dc '0-9') -gt "25" ]] && _messageFAIL && _stop 1 - local imagedev @@ -22262,6 +22334,10 @@ _createVMimage() { export vmSize=$(_vmsize) [[ "$ub_vmImage_micro" == "true" ]] && export vmSize=$(_vmsize-micro) + + #[[ "$ubVirtImageOverride" == "" ]] && ! [[ $(df --block-size=1000000000 --output=avail "$scriptLocal" | tr -dc '0-9') -gt "25" ]] && _messageFAIL && _stop 1 + [[ "$ubVirtImageOverride" == "" ]] && ! [[ $(df --block-size=1048576 --output=avail "$scriptLocal" | tr -dc '0-9') -gt "$vmSize" ]] && _messageFAIL && _stop 1 + export vmSize_boundary=$(bc <<< "$vmSize - 1") _createRawImage "$vmImageFile" @@ -27229,10 +27305,12 @@ _setup_researchEngine() { if [[ "$1" == "" ]] then _setup_researchEngine-kit + return else "$@" + return fi - return + #return fi if [[ -e "$scriptLib"/ubiquitous_bash/_lib/kit/app/researchEngine ]] @@ -27242,10 +27320,12 @@ _setup_researchEngine() { if [[ "$1" == "" ]] then _setup_researchEngine-kit + return else "$@" + return fi - return + #return fi if [[ -e "$scriptLib"/ubDistBuild/_lib/ubiquitous_bash/_lib/kit/app/researchEngine ]] @@ -27255,10 +27335,12 @@ _setup_researchEngine() { if [[ "$1" == "" ]] then _setup_researchEngine-kit + return else "$@" + return fi - return + #return fi _messagePlain_bad 'bad: missing: kit researchEngine' @@ -27273,6 +27355,8 @@ _upgrade_researchEngine() { _setup_researchEngine _upgrade_researchEngine_searxng "$@" _setup_researchEngine _upgrade_researchEngine_openwebui "$@" + _setup_researchEngine _upgrade_researchEngine_trillium "$@" + _setup_researchEngine _upgrade_researchEngine_postgresql "$@" _setup_researchEngine _service_researchEngine-docker-chroot-stop } @@ -27282,11 +27366,22 @@ _upgrade_researchEngine-nvidia() { _setup_researchEngine _upgrade_researchEngine_searxng "$@" _setup_researchEngine _upgrade_researchEngine_openwebui-nvidia "$@" + _setup_researchEngine _upgrade_researchEngine_trillium "$@" + _setup_researchEngine _upgrade_researchEngine_postgresql "$@" _setup_researchEngine _service_researchEngine-docker-chroot-stop } +_install_researchEngine-MSWindows() { + _setup_researchEngine _install_researchEngine-MSWindows +} + +_install_researchEngine-MSWindows-nvidia() { + _setup_researchEngine _install_researchEngine-MSWindows-nvidia +} + + # WARNING: May be untested. # Avoids attempting to upgrade services more likely to break (ie. 'searxng'). _upgrade_researchEngine-safe() { @@ -27294,6 +27389,8 @@ _upgrade_researchEngine-safe() { #_setup_researchEngine _upgrade_researchEngine_searxng "$@" _setup_researchEngine _upgrade_researchEngine_openwebui "$@" + #_setup_researchEngine _upgrade_researchEngine_trillium "$@" + _setup_researchEngine _upgrade_researchEngine_postgresql "$@" _setup_researchEngine _service_researchEngine-docker-chroot-stop } @@ -27302,6 +27399,8 @@ _upgrade_researchEngine-safe-nvidia() { #_setup_researchEngine _upgrade_researchEngine_searxng "$@" _setup_researchEngine _upgrade_researchEngine_openwebui-nvidia "$@" + #_setup_researchEngine _upgrade_researchEngine_trillium "$@" + _setup_researchEngine _upgrade_researchEngine_postgresql "$@" _setup_researchEngine _service_researchEngine-docker-chroot-stop } @@ -28730,6 +28829,10 @@ _setup_ollama_model_dev_sequence() { cd "$safeTmp" + +# Computer vision built-in. In practice, computer vision may be better achieved with other models. +if false +then # Suggested <6144 token context window (ie. 'num_ctx') . May be unreliable (at the limits of what fits in 16GB VRAM, limiting context window, etc). ollama pull hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS @@ -28750,6 +28853,27 @@ CZXWXcRMTo8EmM8i4d ollama create hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41 #ollama run hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41 describe this image ./download.png +fi + + + +# Commonality with other 'dev' AI models in use may help save disk space. + ollama pull hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS + echo FROM hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS > Modelfile + echo PARAMETER num_gpu 41 >> Modelfile + echo PARAMETER num_ctx 6144 >> Modelfile + + cat << 'CZXWXcRMTo8EmM8i4d' >> Modelfile + LICENSE """Apache 2.0 License +https://huggingface.co/mistralai/Devstral-Small-2505 +Apache 2.0 License + +https://huggingface.co/bartowski/mistralai_Devstral-Small-2505-GGUF +License: apache-2.0 +""" +CZXWXcRMTo8EmM8i4d + + ollama create hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41 _stop } @@ -28768,19 +28892,19 @@ _ollama_run_dev() { then local current_api_timeout="$OLLAMA_TIMEOUT" [[ "$current_api_timeout" == "" ]] && current_api_timeout=7200 - #jq -Rs '{model:"hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41", prompt:., stream: false}' | _timeout "$current_api_timeout" curl -fsS --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -r '.response' - #jq -Rs '{model:"hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' + #jq -Rs '{model:"hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41", prompt:., stream: false}' | _timeout "$current_api_timeout" curl -fsS --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -r '.response' + #jq -Rs '{model:"hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' if [[ "$*" == "" ]] then - jq -Rs '{model:"hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' + jq -Rs '{model:"hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' return else - _safeEcho_newline "$@" | jq -Rs '{model:"hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' + _safeEcho_newline "$@" | jq -Rs '{model:"hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41", prompt:., stream: true}' | _timeout "$current_api_timeout" curl -fsS --no-buffer --max-time "$current_api_timeout" -X POST -H "Content-Type: application/json" --data-binary @- http://"$OLLAMA_HOST"/api/generate | jq -rj --unbuffered 'if .done? then "\n" elif .response? then .response else empty end' return fi fi - if ! ollama show hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41 --modelfile > /dev/null 2>&1 + if ! ollama show hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41 --modelfile > /dev/null 2>&1 then "$scriptAbsoluteLocation" _setup_ollama_model_dev_sequence > /dev/null 2>&1 fi @@ -28798,12 +28922,12 @@ _ollama_run_dev() { # https://github.com/ollama/ollama/issues/5081 export OLLAMA_LOAD_TIMEOUT="$OLLAMA_TIMEOUT"s - _timeout "$OLLAMA_TIMEOUT" ollama run hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41 "$@" + _timeout "$OLLAMA_TIMEOUT" ollama run hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41 "$@" ) return fi - ollama run hf.co/bartowski/mistralai_Devstral-Small-2505-GGUF:IQ4_XS-g41 "$@" + ollama run hf.co/unsloth/Devstral-Small-2507-GGUF:IQ4_XS-g41 "$@" } # 'l'... 'LLM', 'language', 'Llama', etc . _d() { @@ -48485,6 +48609,8 @@ then mkdir -p "$HOME"/.ssh chmod 700 "$HOME"/.ssh 2> /dev/null + + chown "$USER" "$HOME"/.ssh 2> /dev/null local currentString=\$(printf '%s' "\$1" | awk '{print \$2}' | tr -dc 'a-zA-Z0-9')