From 8c5c884b4d7dd2ceb953133f68b948b9c6371f92 Mon Sep 17 00:00:00 2001 From: Roger Oriol Date: Wed, 29 Jul 2026 00:07:10 +0200 Subject: [PATCH] add stt and tts services --- llamacpp/deployment-stt.yaml | 97 ++++++++++++++++++++++++++++++++++++ llamacpp/deployment-tts.yaml | 93 ++++++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 llamacpp/deployment-stt.yaml create mode 100644 llamacpp/deployment-tts.yaml diff --git a/llamacpp/deployment-stt.yaml b/llamacpp/deployment-stt.yaml new file mode 100644 index 0000000..1d955be --- /dev/null +++ b/llamacpp/deployment-stt.yaml @@ -0,0 +1,97 @@ +# Wyoming Speech-to-Text (rhasspy/wyoming-whisper). +# +# Exposes the Wyoming protocol over TCP on port 10300 so Home Assistant's +# Wyoming STT integration can stream audio and receive transcriptions. Uses +# faster-whisper under the hood with the language pinned to Catalan (`ca`). +# +# These are lightweight CPU-only pods (no GPU), so they are NOT pinned to the +# NUCBox via nodeSelector — k3s can schedule them on any amd64 node. Models are +# cached in a local-path PVC (`/data`) so they survive pod restarts without +# re-downloading. +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wyoming-whisper-data + namespace: llamacpp + labels: + app: llamacpp + component: stt +spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wyoming-whisper + namespace: llamacpp + labels: + app: llamacpp + component: stt +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: llamacpp + component: stt + template: + metadata: + labels: + app: llamacpp + component: stt + spec: + nodeSelector: + kubernetes.io/arch: amd64 + containers: + - name: wyoming-whisper + image: rhasspy/wyoming-whisper + imagePullPolicy: IfNotPresent + args: + - --uri + - tcp://0.0.0.0:10300 + - --language # pin transcription language to Catalan + - ca + - --model # faster-whisper model (tune up to medium for accuracy) + - small + ports: + - name: wyoming + containerPort: 10300 + resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "1000m" + memory: "1Gi" + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: wyoming-whisper-data +--- +apiVersion: v1 +kind: Service +metadata: + name: wyoming-whisper + namespace: llamacpp + labels: + app: llamacpp + component: stt +spec: + type: ClusterIP + selector: + app: llamacpp + component: stt + ports: + - name: wyoming + port: 10300 + targetPort: 10300 diff --git a/llamacpp/deployment-tts.yaml b/llamacpp/deployment-tts.yaml new file mode 100644 index 0000000..1bc18e8 --- /dev/null +++ b/llamacpp/deployment-tts.yaml @@ -0,0 +1,93 @@ +# Wyoming Text-to-Speech (rhasspy/wyoming-piper). +# +# Exposes the Wyoming protocol over TCP on port 10200 so Home Assistant's +# Wyoming TTS integration can send text and receive synthesized audio. Uses +# Piper under the hood with the Catalan voice `ca_ES-upc_ona-medium`. +# +# Lightweight CPU-only pod (no GPU), not pinned to the NUCBox. The voice is +# cached in a local-path PVC (`/data`) so it survives pod restarts. +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wyoming-piper-data + namespace: llamacpp + labels: + app: llamacpp + component: tts +spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wyoming-piper + namespace: llamacpp + labels: + app: llamacpp + component: tts +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: llamacpp + component: tts + template: + metadata: + labels: + app: llamacpp + component: tts + spec: + nodeSelector: + kubernetes.io/arch: amd64 + containers: + - name: wyoming-piper + image: rhasspy/wyoming-piper + imagePullPolicy: IfNotPresent + args: + - --uri + - tcp://0.0.0.0:10200 + - --voice # Catalan (Spain) medium-quality UPC Ona voice + - ca_ES-upc_ona-medium + ports: + - name: wyoming + containerPort: 10200 + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: wyoming-piper-data +--- +apiVersion: v1 +kind: Service +metadata: + name: wyoming-piper + namespace: llamacpp + labels: + app: llamacpp + component: tts +spec: + type: ClusterIP + selector: + app: llamacpp + component: tts + ports: + - name: wyoming + port: 10200 + targetPort: 10200