## 1. Perf tab — fixed based on actual /props + /slots JSON User provided raw JSON showing the real field names: - default_generation_settings.params.temperature (NOT .temperature) - modalities.vision (NOT has_multimodal) - default_generation_settings.n_ctx (NOT n_context) - slots: n_prompt_tokens / n_prompt_tokens_processed / n_prompt_tokens_cache - slots: next_token[0].n_decoded / n_remain - slots: NO timings field (only available in chat completions) - slots: speculative boolean (not spec object) **Fix:** - SlotInfo interface extended with all new fields - OverviewView: extracts gen from dgs.params (nested), checks modalities.vision, uses dgs.n_ctx for total ctx, shows build_info, shows speculative status - SlotsView: uses n_prompt_tokens_processed (newer) ?? n_past (legacy) for ctx display, shows n_prompt_tokens + n_prompt_tokens_cache, shows next_token decoded/remaining when no timings, shows speculative badge - Sampling values now use .toFixed(2) for readability - Raw JSON dump section preserved (useful for future field changes) ## 2. TTS service (openedai-speech) Added OpenAI-compatible TTS service using openedai-speech: - compose.yaml: new 'tts' service with profile 'tts' - image: ghcr.io/matatonic/openedai-speech:latest - gpus: all (GPU acceleration for faster synthesis) - volumes: gpu/tts/voices + gpu/tts/cache - port: 8000 (internal) - labels: node.role=tts - tailscale serve: port 8100 → tts:8000 - sleep_mode: tts added to removal list - wake_mode: tts added to startup list with --profile tts - gpuctl usage: tts added to services list - dashboard: tts added to ServiceRole type, COMPOSE_PROFILES, VALID_ROLES TTS API is OpenAI-compatible: POST http://gpu-node:8100/v1/audio/speech { model: 'tts-1', voice: 'alloy', input: 'Hello world' } → audio/mpeg response ## 3. Version bump to 0.7.0 ## After merge ```sh git pull && sh build.sh docker compose up -d --force-recreate dashboard docker compose --profile tts up -d tts ``` Check footer — v0.7.0. For TTS: ```sh curl -X POST http://gpu-node-win:8100/v1/audio/speech \ -H 'Content-Type: application/json' \ -d '{"model":"tts-1","voice":"alloy","input":"Hello world"}' \ --output test.mp3 ```
188 lines
4.9 KiB
Bash
188 lines
4.9 KiB
Bash
#!/bin/sh
|
|
|
|
show_status() {
|
|
docker ps \
|
|
--filter "label=node.instance=${NODE_INSTANCE}" \
|
|
--format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
|
}
|
|
|
|
update_ssh() {
|
|
cd "$PROJECT_DIR"
|
|
|
|
require_host_project_path
|
|
require_ssh_role
|
|
|
|
case "$SSH_ROLE" in
|
|
main)
|
|
TARGET_SSH_SERVICE="ssh-companion"
|
|
;;
|
|
companion)
|
|
TARGET_SSH_SERVICE="ssh"
|
|
;;
|
|
*)
|
|
echo "ERROR: unknown SSH role: $SSH_ROLE" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo "Current SSH role: $SSH_ROLE"
|
|
echo "Node instance: $NODE_INSTANCE"
|
|
echo "Host project: $HOST_PROJECT_PATH"
|
|
|
|
echo "Rebuilding images..."
|
|
sh "$PROJECT_DIR/build.sh"
|
|
|
|
echo "Restarting: $TARGET_SSH_SERVICE + model-worker + dashboard"
|
|
|
|
HOST_PROJECT_PATH="$HOST_PROJECT_PATH" \
|
|
docker compose \
|
|
-f "$COMPOSE_FILE" \
|
|
--profile wake \
|
|
up -d \
|
|
--force-recreate \
|
|
"$TARGET_SSH_SERVICE" \
|
|
model-worker \
|
|
dashboard
|
|
}
|
|
|
|
stop_service() {
|
|
CONTAINER="$(get_service_container "$1")" || {
|
|
echo "Unknown service: $1" >&2
|
|
return 1
|
|
}
|
|
|
|
docker stop "$CONTAINER" 2>/dev/null || true
|
|
}
|
|
|
|
restart_service() {
|
|
CONTAINER="$(get_service_container "$1")" || {
|
|
echo "Unknown service: $1" >&2
|
|
return 1
|
|
}
|
|
|
|
docker restart "$CONTAINER"
|
|
}
|
|
|
|
logs_service() {
|
|
CONTAINER="$(get_service_container "$1")" || {
|
|
echo "Unknown service: $1" >&2
|
|
return 1
|
|
}
|
|
|
|
docker logs -f "$CONTAINER"
|
|
}
|
|
|
|
container_is_running() {
|
|
TARGET="$1"
|
|
|
|
RESOLVED=$(get_service_container "$TARGET" 2>/dev/null) || true
|
|
if [ -n "$RESOLVED" ]; then
|
|
TARGET="$RESOLVED"
|
|
fi
|
|
|
|
[ "$(docker inspect \
|
|
--format '{{.State.Running}}' "$TARGET" 2>/dev/null || true)" = "true" ]
|
|
}
|
|
|
|
sleep_mode() {
|
|
cd "$PROJECT_DIR"
|
|
|
|
require_host_project_path
|
|
require_ssh_role
|
|
require_node_instance
|
|
|
|
MAIN_CONTAINER=$(get_service_container "ssh-main") || MAIN_CONTAINER=""
|
|
COMPANION_CONTAINER=$(get_service_container "ssh-companion") || COMPANION_CONTAINER=""
|
|
|
|
if [ -n "$MAIN_CONTAINER" ] && container_is_running "$MAIN_CONTAINER"; then
|
|
KEEP_SSH_ROLE="ssh-main"
|
|
REMOVE_SSH_ROLE="ssh-companion"
|
|
elif [ -n "$COMPANION_CONTAINER" ] && container_is_running "$COMPANION_CONTAINER"; then
|
|
KEEP_SSH_ROLE="ssh-companion"
|
|
REMOVE_SSH_ROLE="ssh-main"
|
|
else
|
|
echo "No SSH container running for instance '$NODE_INSTANCE'. Starting ssh-main..."
|
|
|
|
HOST_PROJECT_PATH="$HOST_PROJECT_PATH" \
|
|
docker compose \
|
|
-f "$COMPOSE_FILE" \
|
|
up -d ssh
|
|
|
|
KEEP_SSH_ROLE="ssh-main"
|
|
REMOVE_SSH_ROLE="ssh-companion"
|
|
fi
|
|
|
|
echo "Entering sleep mode for instance: $NODE_INSTANCE"
|
|
echo "Keeping: tailscale + $KEEP_SSH_ROLE"
|
|
|
|
for ROLE in llama comfyui gpu-test model-worker webdav dashboard tts; do
|
|
CTR=$(get_service_container "$ROLE" 2>/dev/null) || true
|
|
[ -n "$CTR" ] && docker rm -f "$CTR" 2>/dev/null || true
|
|
done
|
|
|
|
REMOVE_CTR=$(get_service_container "$REMOVE_SSH_ROLE" 2>/dev/null) || true
|
|
[ -n "$REMOVE_CTR" ] && docker rm -f "$REMOVE_CTR" 2>/dev/null || true
|
|
|
|
echo
|
|
echo "Sleep mode ready."
|
|
show_status
|
|
}
|
|
|
|
wake_mode() {
|
|
cd "$PROJECT_DIR"
|
|
|
|
require_host_project_path
|
|
require_ssh_role
|
|
require_node_instance
|
|
|
|
case "$SSH_ROLE" in
|
|
main)
|
|
TARGET_SSH_SERVICE="ssh-companion"
|
|
;;
|
|
companion)
|
|
TARGET_SSH_SERVICE="ssh"
|
|
;;
|
|
*)
|
|
echo "ERROR: unknown SSH role: $SSH_ROLE" >&2
|
|
return 1
|
|
;;
|
|
esac
|
|
|
|
echo "Entering wake mode for instance: $NODE_INSTANCE"
|
|
echo "Current SSH role: $SSH_ROLE"
|
|
echo "Host project: $HOST_PROJECT_PATH"
|
|
echo "Starting: $TARGET_SSH_SERVICE + model-worker + webdav + dashboard + tts"
|
|
|
|
HOST_PROJECT_PATH="$HOST_PROJECT_PATH" \
|
|
docker compose \
|
|
-f "$COMPOSE_FILE" \
|
|
--profile wake \
|
|
--profile tts \
|
|
up -d \
|
|
"$TARGET_SSH_SERVICE" \
|
|
model-worker \
|
|
webdav \
|
|
dashboard \
|
|
tts
|
|
|
|
# Belt-and-suspenders: ensure dashboard is up even if the --profile wake
|
|
# flag above didn't include it (compose v2 with --profile + explicit names
|
|
# should work, but older versions may skip services without a matching
|
|
# profile).
|
|
DASHBOARD_CTR=$(get_service_container "dashboard" 2>/dev/null) || DASHBOARD_CTR=""
|
|
if [ -z "$DASHBOARD_CTR" ] || ! container_is_running "$DASHBOARD_CTR"; then
|
|
echo "Dashboard not running after wake — starting it explicitly..."
|
|
HOST_PROJECT_PATH="$HOST_PROJECT_PATH" \
|
|
docker compose \
|
|
-f "$COMPOSE_FILE" \
|
|
up -d dashboard
|
|
fi
|
|
|
|
echo
|
|
echo "Containers:"
|
|
show_status
|
|
|
|
echo
|
|
show_gpu
|
|
}
|