Expand router into reproducible local AI platform
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROFILE_DIR="${PROFILE_DIR:-/etc/systemd/system/mike-ai-llama-ui.service.d}"
|
||||
SOURCE_DIR="${SOURCE_DIR:-/opt/mike-ai/platform/profiles}"
|
||||
SERVICE="${LLAMA_SERVICE:-mike-ai-llama-ui.service}"
|
||||
PROFILE="${1:-}"
|
||||
|
||||
case "$PROFILE" in
|
||||
fast|medium|long) ;;
|
||||
large) PROFILE=long ;;
|
||||
*)
|
||||
echo "Usage: llama-profile {fast|medium|long|large}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
SOURCE="$SOURCE_DIR/profile-$PROFILE.conf"
|
||||
TARGET="$PROFILE_DIR/override.conf"
|
||||
|
||||
if [[ ! -r "$SOURCE" ]]; then
|
||||
echo "Profildatei fehlt: $SOURCE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
install -d -m 0755 "$PROFILE_DIR"
|
||||
TEMP="$(mktemp "$PROFILE_DIR/.override.conf.XXXXXX")"
|
||||
trap 'rm -f "$TEMP"' EXIT
|
||||
install -m 0644 "$SOURCE" "$TEMP"
|
||||
mv -f "$TEMP" "$TARGET"
|
||||
trap - EXIT
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl restart "$SERVICE"
|
||||
echo "Profil '$PROFILE' wurde aktiviert."
|
||||
Reference in New Issue
Block a user