--- apiVersion: apps/v1 kind: Deployment metadata: name: llama-swap namespace: llama spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: llama-swap template: metadata: labels: app: llama-swap spec: initContainers: - name: download-whisper image: gitea.lumpiasty.xyz/lumpiasty/llama-swap:unified-vulkan-test command: - sh - -c - | mkdir -p /root/.cache/whisper if [ ! -f /root/.cache/whisper/ggml-small.bin ]; then echo "Downloading whisper-small model..." curl -L -o /root/.cache/whisper/ggml-small.bin \ https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin else echo "whisper-small model already present, skipping download" fi if [ ! -f /root/.cache/ffmpeg/ffmpeg ]; then echo "Downloading static ffmpeg..." mkdir -p /root/.cache/ffmpeg apt-get update -qq && apt-get install -y --no-install-recommends xz-utils curl -L -o /root/.cache/ffmpeg/ffmpeg.tar.xz \ https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz tar -xJf /root/.cache/ffmpeg/ffmpeg.tar.xz -C /root/.cache/ffmpeg --wildcards '*/ffmpeg' --strip-components=2 rm /root/.cache/ffmpeg/ffmpeg.tar.xz chmod +x /root/.cache/ffmpeg/ffmpeg else echo "ffmpeg already present, skipping download" fi volumeMounts: - name: models mountPath: /root/.cache containers: - name: llama-swap image: gitea.lumpiasty.xyz/lumpiasty/llama-swap:unified-vulkan-test imagePullPolicy: IfNotPresent command: - llama-swap args: - --config=/config/config.yaml - --watch-config env: - name: RADV_EXPERIMENTAL value: transfer_queue ports: - containerPort: 8080 name: http protocol: TCP volumeMounts: - name: models mountPath: /root/.cache - name: models mountPath: /usr/local/bin/ffmpeg subPath: ffmpeg/ffmpeg - mountPath: /dev/kfd name: kfd - mountPath: /dev/dri name: dri - mountPath: /config name: config securityContext: privileged: true volumes: - name: models persistentVolumeClaim: claimName: llama-models-lvmssd - name: kfd hostPath: path: /dev/kfd type: CharDevice - name: dri hostPath: path: /dev/dri type: Directory - name: config configMap: name: llama-swap --- apiVersion: v1 kind: Service metadata: name: llama namespace: llama spec: type: ClusterIP ports: - name: http port: 11434 targetPort: 8080 protocol: TCP selector: app: llama-swap