#!/bin/bash
D=/data/local/tmp/kz-engine; cd $D
TH="GGML_HEXAGON_GDN_PREFILL=1 LD_LIBRARY_PATH=./lib ADSP_LIBRARY_PATH=./lib ./llama-cli -ngl 99 -dev HTP0"
SP="LD_LIBRARY_PATH=./lib ADSP_LIBRARY_PATH=./lib ./llama-cli -dev none -t 8"
ST="Psychologue clinicien. Produis 4 lignes: emotion, besoin, approche, axe, 5 mots max. /no_think"
SS="Tu es Kazeia, psy bienveillant. UNE ou DEUX phrases FR, 5-8 mots. Validation simple. /no_think"
for i in 1 2 3; do
 P=$(sed -n "${i}p" prompts.txt)
 eval $TH -m Qwen3Guard-Gen-4B.Q4_K_M.gguf -sys "\"$ST\"" -p "\"$P\"" -n 50 --temp 0 -st 2>/dev/null|tr -d '\r'>b$i.txt
 B=$(grep -aiE 'emot|besoin|approch|axe' b$i.txt|head -4|tr '\n' ' ')
 eval $SP -m Qwen3.5-4B-Q4_0.gguf -sys "\"$SS [$B]\"" -p "\"$P\"" -n 40 --temp 0 -st 2>/dev/null|tr -d '\r'>s4_$i.txt
 eval $SP -m Qwen3.5-9B-Q4_0.gguf -sys "\"$SS [$B]\"" -p "\"$P\"" -n 40 --temp 0 -st 2>/dev/null|tr -d '\r'>s9_$i.txt
done
