- Add secubox-app-localai package with LXC container support for LocalAI service - Add luci-app-localai with dashboard, chat, models and settings views - Implement RPCD backend for LocalAI API integration via /v1/models and /v1/chat/completions - Use direct RPC declarations in LuCI views for reliable frontend communication - Add LocalAI and Glances to secubox-portal services page - Move Glances from services to monitoring section Packages: - secubox-app-localai: 0.1.0-r1 - luci-app-localai: 0.1.0-r8 - luci-app-secubox-portal: 0.6.0-r5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41 lines
678 B
Bash
41 lines
678 B
Bash
#!/bin/sh /etc/rc.common
|
|
# SecuBox LocalAI - Self-hosted LLM service
|
|
# Copyright (C) 2025 CyberMind.fr
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
PROG=/usr/sbin/localaictl
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load localai
|
|
config_get enabled main enabled '0'
|
|
|
|
[ "$enabled" = "1" ] || {
|
|
echo "LocalAI is disabled. Enable with: uci set localai.main.enabled=1"
|
|
return 0
|
|
}
|
|
|
|
procd_open_instance
|
|
procd_set_param command $PROG service-run
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
stop_service() {
|
|
$PROG service-stop
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "localai"
|
|
}
|
|
|
|
reload_service() {
|
|
stop
|
|
start
|
|
}
|