feat: rewrite stt-module (HTTP variant) in Go

Replace Python streaming STT service with Go for smaller container images.
Local Whisper/ROCm variant (stt_streaming_local.py, Dockerfile.rocm) stays Python.

- AudioBuffer with session state management (listening/responding)
- RMS-based voice activity detection (pure Go, no cgo)
- Interrupt detection during LLM response playback
- JetStream AI_VOICE_STREAM setup
- Session auto-creation and cleanup
- Dockerfile: multi-stage golang:1.25-alpine → scratch
- CI: Gitea Actions with lint/test/release/docker/notify
This commit is contained in:
2026-02-19 18:04:15 -05:00
parent 43109cc931
commit 9d4d48e693
15 changed files with 1073 additions and 1852 deletions

View File

@@ -1,14 +1,23 @@
FROM python:3.12-slim
# Build stage — Go STT streaming service (HTTP variant)
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN apk add --no-cache ca-certificates
# Copy application code
COPY stt_streaming.py .
COPY healthcheck.py .
COPY go.mod go.sum ./
RUN go mod download
# Run the service
CMD ["python", "stt_streaming.py"]
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /stt-module .
# Runtime stage
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /stt-module /stt-module
USER 65534:65534
ENTRYPOINT ["/stt-module"]