fix: prefer AI tools env for gateway checks
This commit is contained in:
parent
48cb0fee93
commit
3409e2a5ae
|
|
@ -1355,6 +1355,7 @@ backstage_brain_enabled() {
|
|||
backstage_brain_note() {
|
||||
local topic="$1"
|
||||
local routes_file="${LAB_AI_STACK_MODEL_ROUTES_FILE:-/data/homelab-ai-stack/models.env}"
|
||||
local tools_env_file="${LAB_AI_STACK_TOOLS_ENV_FILE:-/data/homelab-ai-stack/ai-tools.env}"
|
||||
local provider="${LAB_AI_GATEWAY_PROVIDER:-ollama}"
|
||||
local endpoint="${LAB_AI_GATEWAY_URL:-${LAB_OLLAMA_URL:-http://127.0.0.1:11434}}"
|
||||
local model="${LAB_AI_GATEWAY_MODEL:-qwen2.5:0.5b}"
|
||||
|
|
@ -1370,6 +1371,14 @@ backstage_brain_note() {
|
|||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
if [[ -s "${tools_env_file}" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${tools_env_file}"
|
||||
provider="${LAB_AI_GATEWAY_PROVIDER:-omniroute}"
|
||||
endpoint="${OPENAI_BASE_URL:-${LAB_AI_GATEWAY_URL:-http://127.0.0.1:20128/v1}}"
|
||||
model="${LAB_AI_GATEWAY_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-agent-fast-free}}"
|
||||
api_key="${OPENAI_API_KEY:-${LAB_AI_GATEWAY_API_KEY:-${api_key}}}"
|
||||
fi
|
||||
if [[ -s "${routes_file}" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${routes_file}"
|
||||
|
|
@ -2554,6 +2563,11 @@ ai_check() {
|
|||
|
||||
if [[ -s "${tools_env_file}" ]]; then
|
||||
printf '%-28s ok - %s\n' "ai tools env" "${tools_env_file}"
|
||||
# shellcheck disable=SC1090
|
||||
. "${tools_env_file}"
|
||||
provider="${LAB_AI_GATEWAY_PROVIDER:-omniroute}"
|
||||
endpoint="${OPENAI_BASE_URL:-${LAB_AI_GATEWAY_URL:-http://127.0.0.1:20128/v1}}"
|
||||
model="${LAB_AI_GATEWAY_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-agent-fast-free}}"
|
||||
else
|
||||
printf '%-28s missing - run ./jeannie deploy-ai-tools\n' "ai tools env"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue