From 0e26550dd751a4cdc827c683c3ed88bf0eeb3cec Mon Sep 17 00:00:00 2001 From: Ayo Date: Sun, 24 Aug 2025 13:08:22 +0200 Subject: [PATCH] feat(ai): add init & helper commands --- ai-brainstorm.sh | 3 +++ ai-coder.sh | 3 +++ ai.sh | 3 +++ ayo.sh | 3 +++ example.conf | 7 ++++++- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ai-brainstorm.sh b/ai-brainstorm.sh index 1180b4c..7fb1cbb 100644 --- a/ai-brainstorm.sh +++ b/ai-brainstorm.sh @@ -2,10 +2,13 @@ . ${HOME}/ayo.conf model=$brainstorm +modelfile=$brainstorm_modelfile if ! [ "$2" = "" ]; then if [ "$2" = "sleep" ]; then ollama stop $model + elif [ "$2" = "init" ]; then + ollama create $model -f "$modelfile" else start_time=$(date +%s%N) ollama run $model "$@" diff --git a/ai-coder.sh b/ai-coder.sh index f37d66e..d79c40d 100644 --- a/ai-coder.sh +++ b/ai-coder.sh @@ -2,10 +2,13 @@ . ${HOME}/ayo.conf model=$coder +modelfile=$coder_modelfile if ! [ "$2" = "" ]; then if [ "$2" = "sleep" ]; then ollama stop $model + elif [ "$2" = "init" ]; then + ollama create "$model" -f "$modelfile" else ollama run $model "$@" --hidethinking fi diff --git a/ai.sh b/ai.sh index fd78feb..d77a470 100644 --- a/ai.sh +++ b/ai.sh @@ -2,6 +2,7 @@ . ${HOME}/ayo.conf model=$helper +modelfile=$helper_modelfile if ! [ "$2" = "" ]; then if [ "$2" = "open-webui" ]; then @@ -9,6 +10,8 @@ if ! [ "$2" = "" ]; then open-webui serve python --version deactivate + elif [ "$2" = "init" ]; then + ollama create $model -f $modelfile elif [ "$2" = "wake" ]; then . $HOME/llm_env/bin/activate diff --git a/ayo.sh b/ayo.sh index 7c8067f..995194b 100755 --- a/ayo.sh +++ b/ayo.sh @@ -76,6 +76,9 @@ case $1 in ai-coder) . ${scripts_dir}/ai-coder.sh "$@" ;; + ai-helper) + . ${scripts_dir}/ai.sh "$@" + ;; ai) . ${scripts_dir}/ai.sh "$@" ;; diff --git a/example.conf b/example.conf index 2872c7d..eeed838 100644 --- a/example.conf +++ b/example.conf @@ -3,6 +3,11 @@ tasks_dir="${HOME}/Notes/Tasks" archive_dir="${HOME}/Notes/Archive" scripts_dir="${HOME}/Projects/scripts" editor="vim" -coder="coder:30b" + +# LLM configuration +coder="coder:8b" brainstorm="brainstorm:8b" helper="helper:8b" +coder_modelfile="${HOME}/Modelfile-coder" +brainstorm_modelfile="${HOME}/Modelfile-brainstorm" +helper_modelfile="${HOME}/Modelfile-brainstorm"