From 1ae556dc2f8ca7318d032c401f6619b34a80566f Mon Sep 17 00:00:00 2001 From: Eike Haller <58111764+eksrha@users.noreply.github.com> Date: Sat, 14 Nov 2026 09:51:43 +0100 Subject: [PATCH 1/2] feat: add Parakeet-TDT-0.6B-v3 as a fast CPU transcription backend for short audio A second OpenAI-compatible transcription backend (onnx-asr on ONNX Runtime, int8 model baked into a Chainguard Python image). The router sends /v1/audio/transcriptions to it only when the multipart model field names parakeet-tdt-0.6b-v3; everything else, including translations, stays on Whisper. The chart adds an optional parakeet Deployment, Service and a NetworkPolicy that admits only the router (disabled by default). Refs #28 --- .github/workflows/ci.yml | 29 ++ .github/workflows/release.yml | 56 ++- .relctl.yaml | 5 + AGENTS.md | 2 + Makefile | 20 +- README.md | 3 +- cmd/router/main.go | 1 + deploy/Containerfile.parakeet | 89 ++++ .../helm/templates/parakeet/deployment.yaml | 155 +++++++ deploy/helm/templates/router/deployment.yaml | 6 + deploy/helm/values.yaml | 99 +++++ deploy/parakeet/requirements.txt | 18 + deploy/parakeet/server.py | 400 ++++++++++++++++++ deploy/parakeet/tests/test_server.py | 219 ++++++++++ docs/configuration.md | 10 + docs/tuning.md | 36 ++ internal/config/config.go | 22 +- internal/proxy/proxy.go | 71 +++- internal/proxy/proxy_test.go | 109 +++++ renovate.json | 1 + scripts/test-chart.sh | 23 + 21 files changed, 1366 insertions(+), 8 deletions(-) create mode 100644 deploy/Containerfile.parakeet create mode 100644 deploy/helm/templates/parakeet/deployment.yaml create mode 100644 deploy/parakeet/requirements.txt create mode 100644 deploy/parakeet/server.py create mode 100644 deploy/parakeet/tests/test_server.py create mode 100755 scripts/test-chart.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8b9446..fcfa725 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,32 @@ jobs: - name: Test run: pytest -q deploy/whisper + + # ── Python: parakeet server tests (fake model, real audio decoding) ─────── + parakeet: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Install test dependencies + run: | + grep -E '^(numpy|av|fastapi|python-multipart)==' deploy/parakeet/requirements.txt > /tmp/test-req.txt + pip install -r /tmp/test-req.txt httpx pytest + + - name: Test + run: pytest -q deploy/parakeet + + # ── Helm: render the chart with optional backends off and on ────────────── + chart: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: azure/setup-helm@v4 + + - name: Test + run: scripts/test-chart.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6af0200..2f44531 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: inputs: components: - description: "Components to release even if nothing changed (comma-separated: router,tei,embedding-model,reranker-model,whisper,chart or 'all')" + description: "Components to release even if nothing changed (comma-separated: router,tei,embedding-model,reranker-model,whisper,parakeet,chart or 'all')" required: false default: "" type: string @@ -43,6 +43,7 @@ jobs: embedding-model: ${{ steps.decide.outputs.embedding-model }} reranker-model: ${{ steps.decide.outputs.reranker-model }} whisper: ${{ steps.decide.outputs.whisper }} + parakeet: ${{ steps.decide.outputs.parakeet }} chart: ${{ steps.decide.outputs.chart }} steps: - uses: actions/checkout@v7 @@ -70,6 +71,9 @@ jobs: - name: Changed (whisper) id: whisper run: relctl release changed --component whisper + - name: Changed (parakeet) + id: parakeet + run: relctl release changed --component parakeet - name: Changed (chart) id: chart run: relctl release changed --component chart @@ -83,6 +87,7 @@ jobs: CHANGED_EMBEDDING_MODEL: ${{ steps.embedding-model.outputs.RELCTL_CHANGED }} CHANGED_RERANKER_MODEL: ${{ steps.reranker-model.outputs.RELCTL_CHANGED }} CHANGED_WHISPER: ${{ steps.whisper.outputs.RELCTL_CHANGED }} + CHANGED_PARAKEET: ${{ steps.parakeet.outputs.RELCTL_CHANGED }} CHANGED_CHART: ${{ steps.chart.outputs.RELCTL_CHANGED }} run: | decide() { # name changed @@ -99,6 +104,7 @@ jobs: decide embedding-model "${CHANGED_EMBEDDING_MODEL}" decide reranker-model "${CHANGED_RERANKER_MODEL}" decide whisper "${CHANGED_WHISPER}" + decide parakeet "${CHANGED_PARAKEET}" decide chart "${CHANGED_CHART}" # ── router ──────────────────────────────────────────────────────────────── @@ -382,6 +388,54 @@ jobs: relctl-version: ${{ env.RELCTL_TOOL_VERSION }} run: relctl release publish --component whisper --release-id ${{ needs.whisper-release.outputs.release-id }} + # ── parakeet (image tag: tdt-0.6b-v3- and latest) ────────────── + parakeet-release: + needs: changes + if: needs.changes.outputs.parakeet == 'true' + uses: ./.github/workflows/component-release.yml + with: + component: parakeet + + parakeet-build: + needs: parakeet-release + if: needs.parakeet-release.outputs.release-id != '' + runs-on: ubuntu-latest + env: + VERSION: ${{ needs.parakeet-release.outputs.version }} + MODEL_TAG: tdt-0.6b-v3-${{ needs.parakeet-release.outputs.version }} + steps: + - uses: actions/checkout@v7 + + - name: Log in to GHCR + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push parakeet + run: | + docker build \ + -f deploy/Containerfile.parakeet \ + -t ${{ env.REGISTRY }}/parakeet:${MODEL_TAG} \ + -t ${{ env.REGISTRY }}/parakeet:latest \ + . + docker push ${{ env.REGISTRY }}/parakeet:${MODEL_TAG} + docker push ${{ env.REGISTRY }}/parakeet:latest + + - name: Install cosign + uses: sigstore/cosign-installer@v3 + + - name: Sign image (keyless via OIDC, by digest) + run: scripts/sign-image.sh "${{ env.REGISTRY }}/parakeet:${MODEL_TAG}" + + - name: Publish release + uses: layer87-labs/relctl-action@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + relctl-version: ${{ env.RELCTL_TOOL_VERSION }} + run: relctl release publish --component parakeet --release-id ${{ needs.parakeet-release.outputs.release-id }} + # ── chart (OCI → ghcr.io) ───────────────────────────────────────────────── # Runs after router and tei so that the chart pins the versions just released. chart-release: diff --git a/.relctl.yaml b/.relctl.yaml index a692a96..880978b 100644 --- a/.relctl.yaml +++ b/.relctl.yaml @@ -31,6 +31,11 @@ components: - "deploy/whisper/**" - "deploy/Containerfile.whisper" version_scheme: calver + parakeet: + paths: + - "deploy/parakeet/**" + - "deploy/Containerfile.parakeet" + version_scheme: calver # The chart pins the router and tei image tags when it is packaged, so it is # also released when one of those components is. chart: diff --git a/AGENTS.md b/AGENTS.md index 14a4165..ab83b5c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,6 +13,7 @@ This file provides context for AI coding agents working in this repository. | Embedding | TEI (Rust) | BAAI/bge-m3 | `/v1/embeddings`, `/embed`, `/embed_sparse` | `EMBEDDING_ENABLED`, `EMBEDDING_URL` | | Reranker | TEI (Rust, ONNX) | cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 (default), BAAI/bge-reranker-v2-m3 | `/v1/rerank`, `/rerank` | `RERANKER_ENABLED`, `RERANKER_URL` | | Whisper ASR | faster-whisper (Python) | large-v3-turbo | `/v1/audio/transcriptions`, `/v1/audio/translations` | `WHISPER_ENABLED`, `WHISPER_URL` | +| Parakeet ASR | onnx-asr + ONNX Runtime (Python) | parakeet-tdt-0.6b-v3 (int8) | `/v1/audio/transcriptions` when `model` names it | `PARAKEET_ENABLED`, `PARAKEET_URL` | `/v1/models` returns a merged list from all enabled backends (with static fallback). @@ -41,6 +42,7 @@ deploy/ Containerfile.reranker-model-init Reranker model init container Containerfile.reranker-server FlagEmbedding FastAPI server (/v1/rerank) Containerfile.whisper Whisper ASR server (deploy/whisper/server.py) with model baked in + Containerfile.parakeet Parakeet ASR server (deploy/parakeet/server.py), Chainguard Python base, model baked in whisper/ server.py faster-whisper FastAPI server (/v1/audio/transcriptions) reranker/ diff --git a/Makefile b/Makefile index 9fe3c81..721829b 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ WHISPER_MODEL ?= $(shell grep '^ARG WHISPER_MODEL=' deploy/Containerfile.whisp docker/tei-base docker/tei-runtime \ docker/tei-model-init-embedding \ docker/tei-reranker-model-init \ - docker/whisper \ + docker/whisper docker/parakeet push/parakeet \ push push/router push/tei push/reranker push/whisper \ versions @@ -127,12 +127,26 @@ docker/whisper: -t $(REGISTRY)/whisper:$(WHISPER_MODEL)-$(WHISPER_IMAGE_VERSION) \ . +## ── Docker: Parakeet ──────────────────────────────────────────────────────── + +PARAKEET_IMAGE_VERSION ?= $(VERSION) + +# parakeet — tag = tdt-0.6b-v3- +docker/parakeet: + docker build \ + -f deploy/Containerfile.parakeet \ + -t $(REGISTRY)/parakeet:tdt-0.6b-v3-$(PARAKEET_IMAGE_VERSION) \ + . + +push/parakeet: + docker push $(REGISTRY)/parakeet:tdt-0.6b-v3-$(PARAKEET_IMAGE_VERSION) + ## ── Build all ───────────────────────────────────────────────────────────────── docker: docker/router docker/tei-base docker/tei-runtime \ docker/tei-model-init-embedding \ docker/tei-reranker-model-init \ - docker/whisper + docker/whisper docker/parakeet ## ── Push ───────────────────────────────────────────────────────────────────── @@ -150,7 +164,7 @@ push/reranker: push/whisper: docker push $(REGISTRY)/whisper:$(WHISPER_MODEL)-$(WHISPER_IMAGE_VERSION) -push: push/router push/tei push/reranker push/whisper +push: push/router push/tei push/reranker push/whisper push/parakeet ## ── Info ────────────────────────────────────────────────────────────────────── diff --git a/README.md b/README.md index d508a68..85a41ae 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ batch tokens) is in [docs/tuning.md](docs/tuning.md); all chart options are comm | `POST /v1/embeddings` | embedding | OpenAI-style. The advertised model id `BAAI/bge-m3` may be sent as `model`. | | `POST /embed`, `POST /embed_sparse` | embedding | TEI native (dense and sparse) | | `POST /v1/rerank`, `POST /rerank` | reranker | `/v1/rerank` is rewritten to TEI's `/rerank` | -| `POST /v1/audio/transcriptions` | whisper | multipart; `json`, `text`, `verbose_json`, `srt`, `vtt` | +| `POST /v1/audio/transcriptions` | whisper, parakeet | multipart; `json`, `text`, `verbose_json`, `srt`, `vtt`. Goes to parakeet only when it is enabled and `model` is `parakeet-tdt-0.6b-v3` | | `POST /v1/audio/translations` | whisper | exposed, but `large-v3-turbo` is not trained for translation | | `GET /v1/models` | all enabled | merged list incl. `limits` of embedding and reranker | | `GET /healthz`, `GET /readyz` | router | per-backend status, always HTTP 200 (`ok` or `degraded`) | @@ -135,6 +135,7 @@ concurrency bound `503 backend_overloaded` with `Retry-After`. | embedding-model | `tei-model-init` | `BAAI/bge-m3` baked in, copies to the volume | | reranker-model | `tei-reranker-model-init` | Reranker as ONNX: `cross-encoder/mmarco-mMiniLMv2-L12-H384-v1` (default) or `BAAI/bge-reranker-v2-m3` | | whisper | `whisper` | faster-whisper server, `large-v3-turbo` baked in | +| parakeet | `parakeet` | Fast transcription of short audio: NVIDIA Parakeet-TDT-0.6B-v3 (int8 ONNX, CC-BY-4.0) on ONNX Runtime, baked in | | chart | `charts/inference-stack` (OCI) | Helm chart | Why the default reranker is the small model: on 4 CPUs it needs 0.76 to 0.85 s for 20 documents of 800 diff --git a/cmd/router/main.go b/cmd/router/main.go index 7e9f024..fdbc5fd 100644 --- a/cmd/router/main.go +++ b/cmd/router/main.go @@ -33,6 +33,7 @@ func main() { zap.Bool("embedding_enabled", cfg.Embedding.Enabled), zap.Bool("reranker_enabled", cfg.Reranker.Enabled), zap.Bool("whisper_enabled", cfg.Whisper.Enabled), + zap.Bool("parakeet_enabled", cfg.Parakeet.Enabled), ) ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) diff --git a/deploy/Containerfile.parakeet b/deploy/Containerfile.parakeet new file mode 100644 index 0000000..9611903 --- /dev/null +++ b/deploy/Containerfile.parakeet @@ -0,0 +1,89 @@ +# syntax=docker/dockerfile:1 +# +# Containerfile.parakeet — Parakeet ASR HTTP server (CPU), model baked in +# +# OpenAI-compatible POST /v1/audio/transcriptions served by +# deploy/parakeet/server.py on top of onnx-asr and ONNX Runtime (CPU). A fast +# path for short recordings; Whisper stays the long-form backend. +# +# Model: NVIDIA Parakeet-TDT-0.6B-v3, int8 ONNX export by istupakov +# (https://huggingface.co/istupakov/parakeet-tdt-0.6b-v3-onnx), converted from +# https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3. +# License of the model: CC-BY-4.0 (attribution in /opt/model/NOTICE and in +# the image description). The files are downloaded at a fixed commit and every +# file is checked against its SHA-256; a moved or changed source fails the +# build. Only ONNX and text files, no pickle. No download at runtime. +# To update: pick a new commit, set PARAKEET_MODEL_REVISION and the SHA-256 +# values below (Hugging Face file page, "Git LFS Details", or sha256sum). +# +# Base: Chainguard wolfi-base (glibc) with Python 3.13 from the Wolfi +# repository. The public cgr.dev/chainguard/python image only ships the +# newest Python (3.15 at the time of writing), for which ONNX Runtime has no +# wheels yet; wolfi-base lets the build pick the Python minor version. +# BASE_IMAGE can point to a mirror of cgr.dev/chainguard. +# +# Hardened: non-root (uid 65532), no compilers or pip in the runtime image, +# no network access needed at runtime. + +ARG BASE_IMAGE=cgr.dev/chainguard/wolfi-base:latest@sha256:6b818b54724b30d095379a7471d9a9b6428a51ff52be188676d1d6e5ea67a1e4 +ARG PYTHON=3.13 + +FROM ${BASE_IMAGE} AS build +ARG PYTHON + +ARG PARAKEET_MODEL_REPO=istupakov/parakeet-tdt-0.6b-v3-onnx +ARG PARAKEET_MODEL_REVISION=8f23f0c03c8761650bdb5b40aaf3e40d2c15f1ce + +RUN apk add --no-cache python-${PYTHON} py${PYTHON}-pip +COPY deploy/parakeet/requirements.txt /tmp/requirements.txt +RUN python${PYTHON} -m venv /venv && \ + /venv/bin/pip install --no-cache-dir -r /tmp/requirements.txt && \ + rm /tmp/requirements.txt + +# Model files and their SHA-256 (int8 encoder and decoder; the NeMo +# preprocessor ships inside onnx-asr). +COPY <<'EOF' /tmp/model.sha256 +666903c76b9798caf2c210afd4f6cd60b08a8dbf9800ec8d7a3bc0d2148ac466 config.json +eea7483ee3d1a30375daedc8ed83e3960c91b098812127a0d99d1c8977667a70 decoder_joint-model.int8.onnx +6139d2fa7e1b086097b277c7149725edbab89cc7c7ae64b23c741be4055aff09 encoder-model.int8.onnx +d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d vocab.txt +EOF + +RUN mkdir -p /opt/model && cd /opt/model && \ + for f in $(awk '{print $2}' /tmp/model.sha256); do \ + /venv/bin/python -c "import sys, urllib.request; urllib.request.urlretrieve(sys.argv[1], sys.argv[2])" \ + "https://huggingface.co/${PARAKEET_MODEL_REPO}/resolve/${PARAKEET_MODEL_REVISION}/${f}" "${f}" || exit 1; \ + done && \ + sha256sum -c /tmp/model.sha256 + +COPY <<'EOF' /opt/model/NOTICE +Parakeet-TDT-0.6B-v3 by NVIDIA (https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3), +ONNX export by istupakov (https://huggingface.co/istupakov/parakeet-tdt-0.6b-v3-onnx). +Licensed under CC-BY-4.0 (https://creativecommons.org/licenses/by/4.0/). +Changes: none to the weights; int8-quantized ONNX files are redistributed as published. +EOF + +FROM ${BASE_IMAGE} +ARG PYTHON + +RUN apk add --no-cache python-${PYTHON} && \ + adduser -D -u 65532 -s /sbin/nologin nonroot 2>/dev/null || true + +COPY --from=build /venv /venv +COPY --from=build /opt/model /opt/model +COPY deploy/parakeet/server.py /app/server.py + +ENV PATH=/venv/bin:$PATH \ + MODEL_PATH=/opt/model \ + MODEL_NAME=parakeet-tdt-0.6b-v3 \ + PORT=9000 + +WORKDIR /app +USER 65532 +EXPOSE 9000 + +ENTRYPOINT ["/venv/bin/python", "/app/server.py"] + +LABEL org.opencontainers.image.source="https://github.com/layer87-labs/inference-stack" +LABEL org.opencontainers.image.description="Parakeet ASR HTTP server (CPU, ONNX Runtime) — OpenAI-compatible /v1/audio/transcriptions. Model: NVIDIA Parakeet-TDT-0.6B-v3 (int8 ONNX export by istupakov), CC-BY-4.0" +LABEL org.opencontainers.image.licenses="Apache-2.0 AND CC-BY-4.0" diff --git a/deploy/helm/templates/parakeet/deployment.yaml b/deploy/helm/templates/parakeet/deployment.yaml new file mode 100644 index 0000000..eafe13d --- /dev/null +++ b/deploy/helm/templates/parakeet/deployment.yaml @@ -0,0 +1,155 @@ +{{- if .Values.parakeet.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "inference-stack.fullname" . }}-parakeet + labels: + {{- include "inference-stack.labels" . | nindent 4 }} + app.kubernetes.io/component: parakeet +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "inference-stack.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: parakeet + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "inference-stack.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: parakeet + spec: + securityContext: + {{- toYaml .Values.parakeet.podSecurityContext | nindent 8 }} + {{- include "inference-stack.imagePullSecrets" (dict "local" .Values.parakeet.imagePullSecrets "global" .Values.global.imagePullSecrets) | nindent 6 }} + {{- with (coalesce .Values.parakeet.nodeSelector .Values.global.nodeSelector) }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with (coalesce .Values.parakeet.tolerations .Values.global.tolerations) }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.parakeet.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.parakeet.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: parakeet + image: {{ include "inference-stack.image" (dict "registry" .Values.global.imageRegistry "repo" .Values.parakeet.image.repository "tag" .Values.parakeet.image.tag "appVersion" .Chart.AppVersion) }} + imagePullPolicy: {{ .Values.parakeet.image.pullPolicy }} + env: + - name: MODEL_NAME + value: {{ .Values.parakeet.modelName | quote }} + - name: PORT + value: {{ .Values.parakeet.service.port | quote }} + - name: CPU_THREADS + value: {{ .Values.parakeet.cpuThreads | quote }} + - name: PARAKEET_LANGUAGE + value: {{ .Values.parakeet.language | quote }} + - name: MAX_UPLOAD_MB + value: {{ .Values.parakeet.maxUploadMB | quote }} + - name: MAX_AUDIO_S + value: {{ .Values.parakeet.maxAudioSeconds | quote }} + - name: CHUNK_S + value: {{ .Values.parakeet.chunkSeconds | quote }} + - name: MAX_CONCURRENT + value: {{ .Values.parakeet.maxConcurrent | quote }} + - name: MAX_QUEUE + value: {{ .Values.parakeet.maxQueue | quote }} + - name: PYTHONDONTWRITEBYTECODE + value: "1" + ports: + - name: http + containerPort: {{ .Values.parakeet.service.port }} + protocol: TCP + # /health never queues behind inference and reports ready only after + # the model is loaded and the warmup has run. + readinessProbe: + httpGet: + path: /health + port: http + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /health + port: http + periodSeconds: 30 + timeoutSeconds: 10 + failureThreshold: 6 + {{- if .Values.parakeet.startupProbe.enabled }} + startupProbe: + httpGet: + path: /health + port: http + periodSeconds: {{ .Values.parakeet.startupProbe.periodSeconds }} + failureThreshold: {{ .Values.parakeet.startupProbe.failureThreshold }} + {{- end }} + resources: + {{- toYaml .Values.parakeet.resources | nindent 10 }} + securityContext: + {{- toYaml .Values.parakeet.securityContext | nindent 10 }} + volumeMounts: + - name: tmp + mountPath: /tmp + volumes: + - name: tmp + emptyDir: + sizeLimit: {{ .Values.parakeet.tmpSizeLimit }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "inference-stack.fullname" . }}-parakeet + labels: + {{- include "inference-stack.labels" . | nindent 4 }} + app.kubernetes.io/component: parakeet +spec: + type: ClusterIP + ports: + - name: http + port: {{ .Values.parakeet.service.port }} + targetPort: http + protocol: TCP + selector: + app.kubernetes.io/name: {{ include "inference-stack.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: parakeet +{{- if .Values.parakeet.networkPolicy.enabled }} +--- +# Ingress only from the router pods of this release, on the service port. +# No egress: the model is in the image and the server calls nothing. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "inference-stack.fullname" . }}-parakeet + labels: + {{- include "inference-stack.labels" . | nindent 4 }} + app.kubernetes.io/component: parakeet +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: {{ include "inference-stack.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: parakeet + policyTypes: [Ingress, Egress] + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: {{ include "inference-stack.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: router + ports: + - port: http + protocol: TCP + egress: [] +{{- end }} +{{- end }} diff --git a/deploy/helm/templates/router/deployment.yaml b/deploy/helm/templates/router/deployment.yaml index a809ebc..368e056 100644 --- a/deploy/helm/templates/router/deployment.yaml +++ b/deploy/helm/templates/router/deployment.yaml @@ -71,6 +71,12 @@ spec: - name: WHISPER_URL value: "http://{{ include "inference-stack.fullname" . }}-whisper:{{ .Values.whisper.service.port }}" {{- end }} + - name: PARAKEET_ENABLED + value: {{ .Values.parakeet.enabled | quote }} + {{- if .Values.parakeet.enabled }} + - name: PARAKEET_URL + value: "http://{{ include "inference-stack.fullname" . }}-parakeet:{{ .Values.parakeet.service.port }}" + {{- end }} {{- with .Values.router.extraEnv }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index c280595..22e9b95 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -460,6 +460,105 @@ whisper: # app.kubernetes.io/component: whisper topologySpreadConstraints: [] +# ── Parakeet — fast ASR for short audio ────────────────────────────────────── +# NVIDIA Parakeet-TDT-0.6B-v3 (int8 ONNX, ONNX Runtime on CPU) behind +# deploy/parakeet/server.py. Meant for short recordings such as dictation: +# ~0.7 s for 10 s of audio on 4 CPUs, ~1.5 s on 2 CPUs. Whisper stays the +# default; the router sends POST /v1/audio/transcriptions here only when the +# request's model field is "parakeet-tdt-0.6b-v3". The model is baked into +# the image (~0.7 GB). Model license: CC-BY-4.0 (NVIDIA; ONNX export by +# istupakov), see the image's /opt/model/NOTICE. +parakeet: + enabled: false + + # Released as parakeet:tdt-0.6b-v3- (and latest). Pin a released + # tag with its digest when enabling, e.g. "tdt-0.6b-v3-@sha256:...". + image: + repository: parakeet + tag: "latest" + pullPolicy: IfNotPresent + + modelName: "parakeet-tdt-0.6b-v3" + + # Echoed as `language` in verbose_json when a request sends none. The model + # detects the language itself and cannot be forced. + language: "" + + # ONNX Runtime intra-op threads; match the CPU limit (the runtime sizes + # itself by the node's cores otherwise). + cpuThreads: 2 + + # Upload limit (MB) and longest accepted audio (seconds, 413 beyond). + maxUploadMB: 25 + maxAudioSeconds: 120 + # Audio longer than chunkSeconds is cut at the quietest point of the last + # few seconds before each limit and transcribed chunk by chunk. + chunkSeconds: 30 + + # Transcriptions running at once, and requests allowed to wait behind them; + # beyond that the server answers 429 with Retry-After. + maxConcurrent: 1 + maxQueue: 4 + + service: + port: 9000 + + # Measured in the container (int8, 2 threads, 30 s chunks): 1.6 GiB peak + # memory for 66 s of audio. Without chunking 66 s peaked at 2.2 GiB, so keep + # chunkSeconds at 30 with a 2Gi limit. + resources: + requests: + cpu: "2000m" + memory: "2Gi" + limits: + cpu: "2000m" + memory: "2Gi" + + podSecurityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + + securityContext: + runAsNonRoot: true + runAsUser: 65532 + runAsGroup: 65532 + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: [ALL] + seccompProfile: + type: RuntimeDefault + + # Uploads are written to /tmp (emptyDir, the root filesystem is read-only). + tmpSizeLimit: 512Mi + + # Model load and warmup take a few seconds from local disk. + startupProbe: + enabled: true + periodSeconds: 5 + failureThreshold: 36 + + # Only the router may connect (and nothing else is reachable from the pod). + networkPolicy: + enabled: true + + imagePullSecrets: [] + nodeSelector: {} + tolerations: [] + # Default: keep away from the embedding pods, whose load peaks would slow + # down transcription on the same node. Only a preference. + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchLabels: + app.kubernetes.io/component: embedding + topologySpreadConstraints: [] + # ── ServiceMonitor (Prometheus Operator) ────────────────────────────────────── serviceMonitor: enabled: false diff --git a/deploy/parakeet/requirements.txt b/deploy/parakeet/requirements.txt new file mode 100644 index 0000000..704ed1f --- /dev/null +++ b/deploy/parakeet/requirements.txt @@ -0,0 +1,18 @@ +# Python dependencies of the parakeet image (deploy/Containerfile.parakeet). +# Everything the server imports is pinned; bump deliberately and re-run the +# image smoke test (start the container, POST a short clip to +# /v1/audio/transcriptions). + +# Model runtime: onnx-asr only depends on numpy; ONNX Runtime does the work. +onnx-asr==0.12.0 +onnxruntime==1.32.0 +numpy==2.5.4 + +# Audio decoding and resampling (wav, mp3, ogg/opus, webm, mp4/m4a, flac). +# The wheel bundles the FFmpeg libraries, so no system ffmpeg is needed. +av==19.0.2 + +# HTTP server (deploy/parakeet/server.py). +fastapi==0.142.2 +uvicorn[standard]==0.54.0 +python-multipart==0.0.32 diff --git a/deploy/parakeet/server.py b/deploy/parakeet/server.py new file mode 100644 index 0000000..328204d --- /dev/null +++ b/deploy/parakeet/server.py @@ -0,0 +1,400 @@ +"""Parakeet ASR HTTP server — OpenAI-compatible /v1/audio/transcriptions. + +A fast CPU path for short recordings (dictation): NVIDIA Parakeet-TDT-0.6B-v3 +(int8 ONNX export) on ONNX Runtime via onnx-asr. Whisper stays the backend for +long or quality-critical audio; the router picks the backend by model id. + +Exposes: + POST /v1/audio/transcriptions — transcribe an audio file + GET /v1/models — list the loaded model + GET /health — liveness/readiness (never queues behind inference) + +Request (multipart/form-data), OpenAI-compatible subset: + file audio file (wav, mp3, ogg/opus, webm, mp4/m4a, flac, ...), + decoded with PyAV (FFmpeg libraries bundled in the wheel) + model accepted for compatibility, ignored (one model is loaded) + language accepted and echoed in verbose_json; Parakeet-v3 detects the + language itself (25 European languages), it cannot be forced + prompt accepted and ignored: the model has no prompt or hotword input + response_format json (default) | text | verbose_json | srt | vtt + temperature accepted and ignored (greedy TDT decoding) + +verbose_json carries `segments` (split at sentence punctuation) and `words`. +Both have start/end from the model's token timestamps (80 ms frames). The +confidence of a word is exp(mean log-probability of its tokens) taken from the +decoder's joint network: a relative score in 0..1, not a calibrated +probability. + +Audio longer than CHUNK_S is cut into chunks at the quietest 100 ms within the +last CHUNK_SEARCH_S seconds before each chunk boundary (energy, no VAD model) +and the chunks are transcribed one after another. Audio longer than +MAX_AUDIO_S is rejected with 413: this backend is the short-dictation path. + +Inference runs in a worker thread, at most MAX_CONCURRENT at a time. Up to +MAX_QUEUE further requests wait; beyond that the server answers 429 with +Retry-After at once instead of queuing without bound. + +Every request writes one JSON log line ("parakeet_request {...}") with sizes, +timings and real-time factor. Audio and transcript are never logged. + +At startup the model is loaded and a short synthetic clip is transcribed so the +first real request does not pay the initialisation cost; /health reports ready +only after that. +""" + +import asyncio +import json +import math +import os +import re +import tempfile +import time +from contextlib import asynccontextmanager + +import numpy as np +from fastapi import FastAPI, File, Form, HTTPException, UploadFile +from fastapi.responses import JSONResponse, PlainTextResponse + +MODEL_PATH = os.environ.get("MODEL_PATH", "/opt/model") +MODEL_NAME = os.environ.get("MODEL_NAME", "parakeet-tdt-0.6b-v3") +# onnx-asr model type of the files in MODEL_PATH. +MODEL_TYPE = os.environ.get("MODEL_TYPE", "nemo-parakeet-tdt-0.6b-v3") +QUANTIZATION = os.environ.get("QUANTIZATION", "int8") or None +CPU_THREADS = int(os.environ.get("CPU_THREADS", "0")) # 0 = ONNX Runtime default +DEFAULT_LANGUAGE = os.environ.get("PARAKEET_LANGUAGE", "") or None +MAX_UPLOAD_MB = int(os.environ.get("MAX_UPLOAD_MB", "25")) +MAX_AUDIO_S = float(os.environ.get("MAX_AUDIO_S", "120")) +CHUNK_S = float(os.environ.get("CHUNK_S", "30")) +CHUNK_SEARCH_S = float(os.environ.get("CHUNK_SEARCH_S", "5")) +MAX_CONCURRENT = int(os.environ.get("MAX_CONCURRENT", "1")) +MAX_QUEUE = int(os.environ.get("MAX_QUEUE", "4")) +RETRY_AFTER_S = os.environ.get("RETRY_AFTER_S", "2") +WARMUP = os.environ.get("PARAKEET_WARMUP", "true").lower() == "true" +PORT = int(os.environ.get("PORT", "9000")) + +SAMPLE_RATE = 16000 +# Shorter than this is treated as no audio at all. +MIN_AUDIO_S = 0.1 +# Duration of one encoder frame (10 ms hop x subsampling 8): the resolution of +# token timestamps and the end of the last token. +FRAME_S = 0.08 +FORMATS = {"json", "text", "verbose_json", "srt", "vtt"} +SENTENCE_END = re.compile(r"[.!?…]$") + +_model = None +_ready = False +_sem: asyncio.Semaphore | None = None +_inflight = 0 # admitted requests: running plus waiting for the semaphore + + +class AudioTooLong(Exception): + pass + + +def _load_model(): + import onnx_asr + import onnxruntime as ort + + opts = ort.SessionOptions() + if CPU_THREADS > 0: + opts.intra_op_num_threads = CPU_THREADS + opts.inter_op_num_threads = 1 + print(f"Loading parakeet model: {MODEL_PATH} (type={MODEL_TYPE}, quantization={QUANTIZATION}, " + f"cpu_threads={CPU_THREADS})", flush=True) + t0 = time.monotonic() + model = onnx_asr.load_model(MODEL_TYPE, MODEL_PATH, quantization=QUANTIZATION, sess_options=opts, + providers=["CPUExecutionProvider"]).with_timestamps() + print(f"Model loaded in {time.monotonic() - t0:.1f}s", flush=True) + return model + + +def _warmup_audio(): + """Two seconds of a quiet tone plus noise (deterministic).""" + n = 2 * SAMPLE_RATE + t = np.arange(n, dtype=np.float32) / SAMPLE_RATE + noise = np.random.default_rng(0).standard_normal(n).astype(np.float32) + return (0.05 * np.sin(2 * np.pi * 220 * t) + 0.02 * noise).astype(np.float32) + + +def _warmup(): + t0 = time.monotonic() + try: + _model.recognize(_warmup_audio()) + print(f"Warmup done in {time.monotonic() - t0:.1f}s", flush=True) + except Exception as exc: + print(f"Warmup failed ({type(exc).__name__}); continuing", flush=True) + + +@asynccontextmanager +async def lifespan(app: FastAPI): + global _model, _ready, _sem + _sem = asyncio.Semaphore(MAX_CONCURRENT) + _model = await asyncio.to_thread(_load_model) + if WARMUP: + await asyncio.to_thread(_warmup) + _ready = True + yield + + +app = FastAPI(title="parakeet", lifespan=lifespan) + + +@app.get("/health") +async def health(): + if _model is None or not _ready: + return JSONResponse({"status": "loading"}, status_code=503) + return {"status": "ok"} + + +@app.get("/v1/models") +async def models(): + return { + "object": "list", + "data": [{"id": MODEL_NAME, "object": "model", "created": 0, "owned_by": "inference-stack"}], + } + + +def decode(path: str, max_s: float) -> np.ndarray: + """Decode any FFmpeg-readable file to 16 kHz mono float32. + + Raises AudioTooLong as soon as more than max_s seconds are decoded, so an + over-long upload is not decoded to the end. + """ + import av + + limit = int(max_s * SAMPLE_RATE) + parts: list[np.ndarray] = [] + total = 0 + resampler = av.AudioResampler(format="flt", layout="mono", rate=SAMPLE_RATE) + with av.open(path, mode="r") as container: + stream = next((s for s in container.streams if s.type == "audio"), None) + if stream is None: + raise ValueError("no audio stream") + frames = container.decode(stream) + for frame in frames: + for out in resampler.resample(frame): + parts.append(out.to_ndarray().reshape(-1)) + total += out.samples + if total > limit: + raise AudioTooLong() + for out in resampler.resample(None): + parts.append(out.to_ndarray().reshape(-1)) + total += out.samples + if total > limit: + raise AudioTooLong() + if not parts: + return np.zeros(0, dtype=np.float32) + return np.concatenate(parts).astype(np.float32, copy=False) + + +def split_points(audio: np.ndarray, chunk_s: float, search_s: float, sr: int = SAMPLE_RATE) -> list[int]: + """Sample offsets where to cut audio into chunks of at most chunk_s. + + Each cut lies at the quietest 100 ms window within the last search_s + seconds before the chunk limit. Returns the start offsets, beginning with 0. + """ + n = len(audio) + max_len = int(chunk_s * sr) + search = max(1, min(int(search_s * sr), max_len // 2)) + win = sr // 10 + starts = [0] + while n - starts[-1] > max_len: + lo = starts[-1] + max_len - search + region = audio[lo:starts[-1] + max_len] + k = len(region) // win + if k == 0: + cut = starts[-1] + max_len + else: + energy = (region[:k * win].reshape(k, win) ** 2).mean(axis=1) + cut = lo + int(np.argmin(energy)) * win + win // 2 + starts.append(cut) + return starts + + +def words_from_tokens(tokens: list[str], timestamps: list[float], logprobs: list[float] | None, + offset: float = 0.0) -> list[dict]: + """Group SentencePiece tokens into words ("▁" starts a word).""" + words: list[dict] = [] + cur = None + for i, tok in enumerate(tokens): + start = timestamps[i] + offset + lp = logprobs[i] if logprobs is not None else None + if cur is None or tok.startswith("▁") or tok.startswith(" "): + if cur is not None: + words.append(cur) + cur = {"word": tok.lstrip("▁ "), "start": start, "end": start + FRAME_S, "lps": []} + else: + cur["word"] += tok + cur["end"] = start + FRAME_S + if lp is not None: + cur["lps"].append(lp) + if cur is not None: + words.append(cur) + out = [] + for w in words: + if not w["word"]: + continue + item = {"word": w["word"], "start": round(w["start"], 2), "end": round(w["end"], 2)} + if w["lps"]: + item["confidence"] = round(math.exp(sum(w["lps"]) / len(w["lps"])), 3) + item["logprob"] = round(sum(w["lps"]) / len(w["lps"]), 4) + out.append(item) + return out + + +def segments_from_words(words: list[dict]) -> list[dict]: + """Group words into segments ending at sentence punctuation.""" + segments: list[dict] = [] + cur: list[dict] = [] + for w in words: + cur.append(w) + if SENTENCE_END.search(w["word"]): + segments.append(_segment(len(segments), cur)) + cur = [] + if cur: + segments.append(_segment(len(segments), cur)) + return segments + + +def _segment(idx: int, words: list[dict]) -> dict: + seg = {"id": idx, "start": words[0]["start"], "end": words[-1]["end"], + "text": " ".join(w["word"] for w in words)} + lps = [w["logprob"] for w in words if "logprob" in w] + if lps: + seg["avg_logprob"] = round(sum(lps) / len(lps), 4) + return seg + + +def transcribe(audio: np.ndarray) -> tuple[str, list[dict], int]: + """Transcribe decoded audio; returns (text, words, number of chunks).""" + starts = split_points(audio, CHUNK_S, CHUNK_SEARCH_S) + bounds = starts[1:] + [len(audio)] + texts: list[str] = [] + words: list[dict] = [] + for lo, hi in zip(starts, bounds): + res = _model.recognize(audio[lo:hi]) + text = (res.text or "").strip() + if text: + texts.append(text) + if res.tokens and res.timestamps: + words.extend(words_from_tokens(res.tokens, res.timestamps, res.logprobs, offset=lo / SAMPLE_RATE)) + return " ".join(texts), words, len(starts) + + +def _ts(seconds: float, sep: str) -> str: + ms = int(round(seconds * 1000)) + h, ms = divmod(ms, 3_600_000) + m, ms = divmod(ms, 60_000) + s, ms = divmod(ms, 1000) + return f"{h:02d}:{m:02d}:{s:02d}{sep}{ms:03d}" + + +def _log_request(**fields): + print("parakeet_request " + json.dumps(fields, separators=(",", ":")), flush=True) + + +def _fail(status: int, detail: str, t_start: float, size: int, error: str, headers: dict | None = None): + _log_request(status="error", error=error, http_status=status, file_bytes=size, + total_s=round(time.monotonic() - t_start, 3)) + raise HTTPException(status_code=status, detail=detail, headers=headers) + + +@app.post("/v1/audio/transcriptions") +async def transcriptions( + file: UploadFile = File(...), + model: str | None = Form(None), + language: str | None = Form(None), + prompt: str | None = Form(None), + response_format: str = Form("json"), + temperature: float | None = Form(None), +): + global _inflight + t_start = time.monotonic() + if _model is None or not _ready: + raise HTTPException(status_code=503, detail="model not loaded yet") + if response_format not in FORMATS: + raise HTTPException(status_code=400, detail=f"response_format must be one of {sorted(FORMATS)}") + if _inflight >= MAX_CONCURRENT + MAX_QUEUE: + _fail(429, "server busy, retry later", t_start, 0, "overloaded", {"Retry-After": RETRY_AFTER_S}) + + _inflight += 1 + try: + limit = MAX_UPLOAD_MB * 1024 * 1024 + size = 0 + with tempfile.NamedTemporaryFile(suffix=os.path.splitext(file.filename or "")[1] or ".audio") as tmp: + while chunk := await file.read(1024 * 1024): + size += len(chunk) + if size > limit: + _fail(413, f"file exceeds {MAX_UPLOAD_MB} MB", t_start, size, "upload_too_large") + tmp.write(chunk) + tmp.flush() + if size == 0: + _fail(400, "empty file", t_start, 0, "empty_file") + + t_queued = time.monotonic() + async with _sem: + t_run = time.monotonic() + try: + audio = await asyncio.to_thread(decode, tmp.name, MAX_AUDIO_S) + except AudioTooLong: + _fail(413, f"audio longer than {MAX_AUDIO_S:g} s; use a long-form transcription model", + t_start, size, "audio_too_long") + except Exception as exc: + _fail(400, "could not decode audio", t_start, size, type(exc).__name__) + t_dec = time.monotonic() + audio_s = len(audio) / SAMPLE_RATE + if audio_s < MIN_AUDIO_S: + _fail(400, "no audio in file", t_start, size, "no_audio") + try: + text, words, chunks = await asyncio.to_thread(transcribe, audio) + except Exception as exc: + _fail(500, "transcription failed", t_start, size, type(exc).__name__) + t_done = time.monotonic() + del audio + finally: + _inflight -= 1 + + _log_request( + status="ok", + model=MODEL_NAME, + cpu_threads=CPU_THREADS, + response_format=response_format, + prompt_ignored=bool((prompt or "").strip()), + file_bytes=size, + audio_s=round(audio_s, 2), + chunks=chunks, + words=len(words), + upload_s=round(t_queued - t_start, 3), + queue_s=round(t_run - t_queued, 3), + decode_s=round(t_dec - t_run, 3), + infer_s=round(t_done - t_dec, 3), + total_s=round(time.monotonic() - t_start, 3), + rtf=round((t_done - t_run) / audio_s, 3), + ) + + if response_format == "json": + return {"text": text} + if response_format == "text": + return PlainTextResponse(text + "\n") + segments = segments_from_words(words) + if response_format == "verbose_json": + return { + "task": "transcribe", + "language": (language or DEFAULT_LANGUAGE) or None, + "duration": round(audio_s, 2), + "text": text, + "segments": segments, + "words": words, + } + if response_format == "srt": + out = [f"{i}\n{_ts(s['start'], ',')} --> {_ts(s['end'], ',')}\n{s['text']}\n" + for i, s in enumerate(segments, 1)] + return PlainTextResponse("\n".join(out), media_type="application/x-subrip") + out = ["WEBVTT\n"] + [f"{_ts(s['start'], '.')} --> {_ts(s['end'], '.')}\n{s['text']}\n" for s in segments] + return PlainTextResponse("\n".join(out), media_type="text/vtt") + + +if __name__ == "__main__": + import uvicorn + + uvicorn.run(app, host="0.0.0.0", port=PORT) diff --git a/deploy/parakeet/tests/test_server.py b/deploy/parakeet/tests/test_server.py new file mode 100644 index 0000000..cd30b24 --- /dev/null +++ b/deploy/parakeet/tests/test_server.py @@ -0,0 +1,219 @@ +"""Tests for deploy/parakeet/server.py with a fake model (no model download). + +Decoding is real (PyAV), so the format tests exercise the same code as the image. +Run: pip install fastapi httpx python-multipart pytest numpy av && pytest deploy/parakeet +""" + +import asyncio +import io +import os +import sys +import wave +from types import SimpleNamespace + +import av +import numpy as np +import pytest +from fastapi.testclient import TestClient + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) +import server # noqa: E402 + +SECRET_TEXT = "Geheimer Inhalt." + +# Tokens as Parakeet emits them: "▁" starts a word. +TOKENS = ["▁Hallo", "▁Wel", "t", ".", "▁Zwei", "ter", "▁Satz", "."] +TIMES = [0.0, 0.4, 0.56, 0.64, 1.2, 1.36, 1.6, 1.84] +LOGPROBS = [-0.1, -0.2, -0.4, 0.0, -1.0, -1.0, -0.05, 0.0] + + +class FakeModel: + def __init__(self): + self.calls = [] + + def recognize(self, audio): + self.calls.append(len(audio)) + return SimpleNamespace(text=SECRET_TEXT, tokens=TOKENS, timestamps=TIMES, logprobs=LOGPROBS) + + +def wav_bytes(seconds: float, rate: int = 44100, channels: int = 2) -> bytes: + n = int(seconds * rate) + t = np.arange(n) / rate + tone = (0.3 * np.sin(2 * np.pi * 440 * t) * 32767).astype(np.int16) + data = np.repeat(tone[:, None], channels, axis=1).tobytes() + buf = io.BytesIO() + with wave.open(buf, "wb") as w: + w.setnchannels(channels) + w.setsampwidth(2) + w.setframerate(rate) + w.writeframes(data) + return buf.getvalue() + + +def encoded_bytes(container: str, codec: str, seconds: float = 1.0, rate: int = 48000) -> bytes: + """Encode a tone with PyAV, e.g. webm/opus as browsers record it.""" + buf = io.BytesIO() + with av.open(buf, mode="w", format=container) as out: + stream = out.add_stream(codec, rate=rate, layout="mono") + n = int(seconds * rate) + samples = (0.3 * np.sin(2 * np.pi * 440 * np.arange(n) / rate)).astype(np.float32) + step = 960 + for i in range(0, n, step): + frame = av.AudioFrame.from_ndarray(samples[None, i:i + step], format="flt", layout="mono") + frame.sample_rate = rate + for packet in stream.encode(frame): + out.mux(packet) + for packet in stream.encode(None): + out.mux(packet) + return buf.getvalue() + + +@pytest.fixture +def client(monkeypatch): + model = FakeModel() + monkeypatch.setattr(server, "_model", model) + monkeypatch.setattr(server, "_ready", True) + monkeypatch.setattr(server, "_sem", asyncio.Semaphore(1)) + monkeypatch.setattr(server, "_inflight", 0) + monkeypatch.setattr(server, "MAX_AUDIO_S", 120.0) + monkeypatch.setattr(server, "CHUNK_S", 30.0) + c = TestClient(server.app) + c.model = model + return c + + +def post(client, payload: bytes, name: str = "a.wav", **data): + return client.post("/v1/audio/transcriptions", files={"file": (name, io.BytesIO(payload), "application/octet-stream")}, + data=data) + + +def test_json_response(client): + r = post(client, wav_bytes(2.0)) + assert r.status_code == 200 + assert r.json() == {"text": SECRET_TEXT} + # 2 s of 44.1 kHz stereo arrive as 16 kHz mono. + assert client.model.calls == [32000] + + +@pytest.mark.parametrize("name,container,codec", [ + ("a.webm", "webm", "libopus"), + ("a.ogg", "ogg", "libopus"), + ("a.m4a", "mp4", "aac"), + ("a.mp3", "mp3", "libmp3lame"), +]) +def test_browser_formats_decode(client, name, container, codec): + if codec not in av.codecs_available: + pytest.skip(f"{codec} not in this PyAV build") + r = post(client, encoded_bytes(container, codec), name=name) + assert r.status_code == 200, r.text + # 1 s, give or take the codec's padding. + assert len(client.model.calls) == 1 + assert 15000 <= client.model.calls[0] <= 17500 + + +def test_verbose_json_words_segments(client): + r = post(client, wav_bytes(2.0), response_format="verbose_json", language="de") + assert r.status_code == 200 + body = r.json() + assert body["language"] == "de" + assert body["duration"] == 2.0 + assert body["words"] == [ + {"word": "Hallo", "start": 0.0, "end": 0.08, "confidence": 0.905, "logprob": -0.1}, + {"word": "Welt.", "start": 0.4, "end": 0.72, "confidence": 0.819, "logprob": -0.2}, + {"word": "Zweiter", "start": 1.2, "end": 1.44, "confidence": 0.368, "logprob": -1.0}, + {"word": "Satz.", "start": 1.6, "end": 1.92, "confidence": 0.975, "logprob": -0.025}, + ] + assert body["segments"] == [ + {"id": 0, "start": 0.0, "end": 0.72, "text": "Hallo Welt.", "avg_logprob": -0.15}, + {"id": 1, "start": 1.2, "end": 1.92, "text": "Zweiter Satz.", "avg_logprob": -0.5125}, + ] + + +def test_srt(client): + r = post(client, wav_bytes(2.0), response_format="srt") + assert r.text == ("1\n00:00:00,000 --> 00:00:00,720\nHallo Welt.\n\n" + "2\n00:00:01,200 --> 00:00:01,920\nZweiter Satz.\n") + + +def test_unknown_format(client): + assert post(client, wav_bytes(1.0), response_format="xml").status_code == 400 + + +def test_empty_file(client): + r = post(client, b"") + assert r.status_code == 400 + assert r.json()["detail"] == "empty file" + + +def test_corrupt_file(client): + r = post(client, b"this is not audio at all" * 100) + assert r.status_code == 400 + assert r.json()["detail"] == "could not decode audio" + assert client.model.calls == [] + + +def test_silence_too_short(client): + r = post(client, wav_bytes(0.05)) + assert r.status_code == 400 + assert r.json()["detail"] == "no audio in file" + + +def test_upload_too_large(client, monkeypatch): + monkeypatch.setattr(server, "MAX_UPLOAD_MB", 1) + r = post(client, b"\0" * (1024 * 1024 + 1)) + assert r.status_code == 413 + + +def test_audio_too_long(client, monkeypatch): + monkeypatch.setattr(server, "MAX_AUDIO_S", 3.0) + r = post(client, wav_bytes(4.0, rate=16000, channels=1)) + assert r.status_code == 413 + assert client.model.calls == [] + + +def test_long_audio_is_chunked(client, monkeypatch): + monkeypatch.setattr(server, "CHUNK_S", 2.0) + monkeypatch.setattr(server, "CHUNK_SEARCH_S", 0.5) + r = post(client, wav_bytes(5.0, rate=16000, channels=1), response_format="verbose_json") + assert r.status_code == 200 + assert len(client.model.calls) == 3 + assert sum(client.model.calls) == 80000 + # The second chunk's words are shifted by its start offset. + assert r.json()["words"][4]["start"] > 1.4 + + +def test_overload_returns_429(client, monkeypatch): + monkeypatch.setattr(server, "_inflight", server.MAX_CONCURRENT + server.MAX_QUEUE) + r = post(client, wav_bytes(1.0)) + assert r.status_code == 429 + assert r.headers["Retry-After"] == server.RETRY_AFTER_S + + +def test_health_and_models(client, monkeypatch): + assert client.get("/health").json() == {"status": "ok"} + assert client.get("/v1/models").json()["data"][0]["id"] == "parakeet-tdt-0.6b-v3" + monkeypatch.setattr(server, "_ready", False) + assert client.get("/health").status_code == 503 + + +def test_log_has_no_transcript(client, capsys): + post(client, wav_bytes(1.0), prompt="geheimes-glossar") + out = capsys.readouterr().out + assert "parakeet_request" in out + assert "Geheimer" not in out + assert "geheimes-glossar" not in out + assert '"prompt_ignored":true' in out + + +def test_split_points_cuts_in_silence(): + sr = 16000 + audio = np.ones(10 * sr, dtype=np.float32) + audio[int(3.5 * sr):int(3.7 * sr)] = 0.0 # pause inside the search window + starts = server.split_points(audio, chunk_s=4.0, search_s=1.0, sr=sr) + assert starts[0] == 0 + assert 3.5 * sr <= starts[1] <= 3.7 * sr + assert all(b - a <= 4 * sr for a, b in zip(starts, starts[1:] + [len(audio)])) + + +def test_split_points_short_audio(): + assert server.split_points(np.zeros(16000, dtype=np.float32), 30.0, 5.0) == [0] diff --git a/docs/configuration.md b/docs/configuration.md index 8c8968f..2b0c660 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -28,6 +28,16 @@ at startup with a config error. | `WHISPER_URL` | none | Base URL of the Whisper server | | `WHISPER_TIMEOUT` | `300s` | Per-request timeout | | `WHISPER_MAX_CONCURRENT` | `8` | Requests forwarded at once; more get `503` + `Retry-After` | +| `PARAKEET_ENABLED` | `false` | Enable the Parakeet backend (short-audio transcription) | +| `PARAKEET_URL` | none | Base URL of the Parakeet server | +| `PARAKEET_TIMEOUT` | `60s` | Per-request timeout | +| `PARAKEET_MAX_CONCURRENT` | `6` | Requests forwarded at once; more get `503` + `Retry-After` | + +`POST /v1/audio/transcriptions` goes to Parakeet only when Parakeet is enabled and the multipart `model` field +names `parakeet-tdt-0.6b-v3` (a provider prefix such as `gateway/parakeet-tdt-0.6b-v3` is accepted). Every other +request, including all translations, goes to Whisper as before. To read the field the router buffers the body up +to the `model` part, so clients should send `model` before `file` (the OpenAI SDKs do); otherwise the whole +upload is buffered, bounded by `ROUTER_MAX_REQUEST_SIZE`. A value of `0` or below for a `*_MAX_CONCURRENT` variable disables the bound for that backend. diff --git a/docs/tuning.md b/docs/tuning.md index 183d1f2..bde2421 100644 --- a/docs/tuning.md +++ b/docs/tuning.md @@ -109,6 +109,42 @@ RERANKER_MODEL_ID=`. If the model repository ships Optimum. Only XLM-RoBERTa-style sequence-classification models that TEI supports will work. +## Parakeet (Parakeet-TDT-0.6B-v3, int8 ONNX) + +A fast path for short audio such as dictation; Whisper stays the backend for +long recordings. Clients choose it with `model=parakeet-tdt-0.6b-v3`. + +Measured on CPU (AVX2, int8, model already loaded; median of 3 runs): + +| Audio | 4 threads | 2 threads | +| --- | --- | --- | +| 5 s | 0.45 s | | +| 10 s | 0.74 s | 1.5 s (12.7 s clip) | +| 30 s | 2.3 s | 3.9 s (32.9 s clip) | + +Through the HTTP server in the container (2 CPUs, 2 threads, verbose_json, +upload and decoding included): 1.5 s for a 12.7 s clip, 3.9 s for 32.9 s, +7.7 s for 66 s (three 30 s chunks); 1.6 GiB peak memory. On 4 CPUs the +server adds about 0.1 s per request to the bare model time (multipart, +decoding, JSON). + +For comparison, Whisper large-v3-turbo needs ~8 s for a 12.7 s clip on 4 +threads, because it always encodes a full 30 s window. + +- `parakeet.cpuThreads` must match the CPU limit. +- No `prompt` or hotwords: the model has no such input. Domain terms that it + gets wrong have to be fixed after transcription. +- `verbose_json` returns `segments` (split at sentence punctuation) and + `words` with `start`, `end` and `confidence` (exp of the mean token + log-probability; a relative score, not calibrated). +- Audio longer than `parakeet.chunkSeconds` (30) is cut at the quietest + 100 ms of the last 5 s before each limit and transcribed chunk by chunk. A + cut inside a word can garble that word; continuous speech without pauses is + the worst case. Longer than `parakeet.maxAudioSeconds` (120) is + rejected with `413`. +- `parakeet.maxConcurrent` transcriptions run at once, `parakeet.maxQueue` more + wait; further requests get `429` with `Retry-After`. + ## Whisper (faster-whisper + large-v3-turbo, int8) Measured on CPU: ~2.0 GiB RSS peak; roughly real-time speed on 2 threads (a diff --git a/internal/config/config.go b/internal/config/config.go index f0fa362..2b76b13 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -43,6 +43,10 @@ type Config struct { Embedding Backend Reranker Backend Whisper Backend + // Parakeet is a second transcription backend for short audio. It shares + // /v1/audio/transcriptions with Whisper; the router sends a request + // there only when its "model" field names one of Parakeet's models. + Parakeet Backend // Observability LogLevel string @@ -96,6 +100,17 @@ func Load() (*Config, error) { // a much lower concurrency bound is appropriate. MaxConcurrent: envInt("WHISPER_MAX_CONCURRENT", 8), }, + Parakeet: Backend{ + Name: "parakeet", + BaseURL: env("PARAKEET_URL", ""), + Models: []string{"parakeet-tdt-0.6b-v3"}, + Enabled: envBool("PARAKEET_ENABLED", false), + // Short dictation: a 60 s clip takes a few seconds on 2 CPUs. + Timeout: envDuration("PARAKEET_TIMEOUT", 60*time.Second), + // The server itself runs 1-2 at a time and queues a few more + // (429 beyond that); this bound only stops a pile-up in the router. + MaxConcurrent: envInt("PARAKEET_MAX_CONCURRENT", 6), + }, } if err := cfg.validate(); err != nil { @@ -115,6 +130,9 @@ func (c *Config) validate() error { if c.Whisper.Enabled && c.Whisper.BaseURL == "" { return fmt.Errorf("WHISPER_ENABLED=true but WHISPER_URL is not set") } + if c.Parakeet.Enabled && c.Parakeet.BaseURL == "" { + return fmt.Errorf("PARAKEET_ENABLED=true but PARAKEET_URL is not set") + } enabled := 0 for _, b := range c.ActiveBackends() { @@ -123,7 +141,7 @@ func (c *Config) validate() error { } } if enabled == 0 { - return fmt.Errorf("no backends enabled: set at least one of EMBEDDING_ENABLED, RERANKER_ENABLED, WHISPER_ENABLED") + return fmt.Errorf("no backends enabled: set at least one of EMBEDDING_ENABLED, RERANKER_ENABLED, WHISPER_ENABLED, PARAKEET_ENABLED") } return nil @@ -131,7 +149,7 @@ func (c *Config) validate() error { // ActiveBackends returns all configured backends (enabled or not). func (c *Config) ActiveBackends() []Backend { - backends := []Backend{c.Embedding, c.Reranker, c.Whisper} + backends := []Backend{c.Embedding, c.Reranker, c.Whisper, c.Parakeet} backends = append(backends, c.ExtraBackends...) return backends } diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index a60aa1d..c19fbb0 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -6,6 +6,8 @@ import ( "encoding/json" "fmt" "io" + "mime" + "mime/multipart" "net" "net/http" "net/http/httputil" @@ -133,7 +135,16 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { } r.dispatch(w, req, r.cfg.Reranker, "reranker") - case strings.HasPrefix(path, "/v1/audio/transcriptions") || strings.HasPrefix(path, "/v1/audio/translations"): + case strings.HasPrefix(path, "/v1/audio/transcriptions"): + // Whisper stays the default; Parakeet only gets requests that name + // one of its models. + if r.cfg.Parakeet.Enabled && servesModel(r.cfg.Parakeet, r.peekFormModel(req)) { + r.dispatch(w, req, r.cfg.Parakeet, "parakeet") + return + } + r.dispatch(w, req, r.cfg.Whisper, "whisper") + + case strings.HasPrefix(path, "/v1/audio/translations"): r.dispatch(w, req, r.cfg.Whisper, "whisper") default: @@ -314,6 +325,64 @@ func (r *Router) stripAdvertisedModel(req *http.Request, b config.Backend) { setBody(body) } +// maxModelField bounds the value read from a multipart "model" field. +const maxModelField = 256 + +// peekFormModel returns the "model" field of a multipart/form-data request +// and leaves the body intact for the proxy. It reads parts until it finds the +// field: when "model" comes before the file (the usual order) only the first +// few hundred bytes are buffered; otherwise the body is buffered up to +// MaxRequestSize. It returns "" for other content types, a missing field or a +// malformed body; the request then goes to the default backend, which reports +// any error itself. +func (r *Router) peekFormModel(req *http.Request) string { + if req.Body == nil || req.Method != http.MethodPost { + return "" + } + mediaType, params, err := mime.ParseMediaType(req.Header.Get("Content-Type")) + if err != nil || mediaType != "multipart/form-data" || params["boundary"] == "" { + return "" + } + limit := r.cfg.MaxRequestSize + if limit <= 0 { + limit = 100 << 20 + } + var consumed bytes.Buffer + body := req.Body + mr := multipart.NewReader(io.TeeReader(io.LimitReader(body, limit), &consumed), params["boundary"]) + model := "" + for { + part, err := mr.NextPart() + if err != nil { + break + } + if part.FormName() == "model" && part.FileName() == "" { + v, _ := io.ReadAll(io.LimitReader(part, maxModelField)) + model = strings.TrimSpace(string(v)) + break + } + } + req.Body = struct { + io.Reader + io.Closer + }{io.MultiReader(bytes.NewReader(consumed.Bytes()), body), body} + return model +} + +// servesModel reports whether model names one of the backend's models, with +// or without a provider prefix ("layer87/parakeet-tdt-0.6b-v3"). +func servesModel(b config.Backend, model string) bool { + if model == "" { + return false + } + for _, m := range b.Models { + if model == m || strings.HasSuffix(model, "/"+m) { + return true + } + } + return false +} + type modelsResp struct { Object string `json:"object"` Data []modelObj `json:"data"` diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 64554f9..fa52f06 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -708,3 +708,112 @@ func TestModels_EmbeddingLimits(t *testing.T) { t.Errorf("limits = %+v, want 4096/32/8192", l) } } + +// ── Parakeet: second transcription backend chosen by model id ───────────────── + +// asrBackends starts a Whisper and a Parakeet mock that each record the body +// they received and answer with their own name. +func asrBackends(t *testing.T) (cfg *config.Config, got map[string]string) { + t.Helper() + got = map[string]string{} + mk := func(name string) *httptest.Server { + return mockBackend(t, map[string]http.HandlerFunc{ + "/v1/audio/transcriptions": func(w http.ResponseWriter, r *http.Request) { + b, _ := io.ReadAll(r.Body) + got[name] = string(b) + jsonOK(`{"text":"` + name + `"}`)(w, r) + }, + "/v1/audio/translations": jsonOK(`{"text":"` + name + `"}`), + }) + } + whisper, parakeet := mk("whisper"), mk("parakeet") + cfg = buildConfig( + config.Backend{Name: "embedding"}, + config.Backend{Name: "reranker"}, + config.Backend{Name: "whisper", BaseURL: whisper.URL, Enabled: true, Timeout: 5 * time.Second, + Models: []string{"whisper-large-v3-turbo"}}, + ) + cfg.Parakeet = config.Backend{Name: "parakeet", BaseURL: parakeet.URL, Enabled: true, Timeout: 5 * time.Second, + Models: []string{"parakeet-tdt-0.6b-v3"}} + return cfg, got +} + +func multipartBody(fields ...[2]string) string { + var sb strings.Builder + for _, f := range fields { + if f[0] == "file" { + sb.WriteString("--b\r\nContent-Disposition: form-data; name=\"file\"; filename=\"a.webm\"\r\n\r\n" + f[1] + "\r\n") + continue + } + sb.WriteString("--b\r\nContent-Disposition: form-data; name=\"" + f[0] + "\"\r\n\r\n" + f[1] + "\r\n") + } + sb.WriteString("--b--\r\n") + return sb.String() +} + +func TestRouting_TranscriptionByModel(t *testing.T) { + audio := strings.Repeat("A", 64<<10) // larger than any read buffer + cases := []struct { + name string + body string + want string + }{ + {"parakeet id, model before file", multipartBody([2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "parakeet"}, + {"parakeet id, model after file", multipartBody([2]string{"file", audio}, [2]string{"model", "parakeet-tdt-0.6b-v3"}), "parakeet"}, + {"parakeet id with provider prefix", multipartBody([2]string{"model", "layer87/parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "parakeet"}, + {"whisper id", multipartBody([2]string{"model", "whisper-large-v3-turbo"}, [2]string{"file", audio}), "whisper"}, + {"no model field", multipartBody([2]string{"file", audio}), "whisper"}, + {"unknown model", multipartBody([2]string{"model", "parakeet-tdt-0.6b-v2"}, [2]string{"file", audio}), "whisper"}, + {"similar suffix is not a match", multipartBody([2]string{"model", "xparakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "whisper"}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + cfg, got := asrBackends(t) + router := buildRouter(t, cfg) + req := httptest.NewRequest(http.MethodPost, "/v1/audio/transcriptions", strings.NewReader(tc.body)) + req.Header.Set("Content-Type", "multipart/form-data; boundary=b") + w := httptest.NewRecorder() + router.ServeHTTP(w, req) + + if w.Code != http.StatusOK { + t.Fatalf("status = %d, want 200; body: %s", w.Code, w.Body.String()) + } + if w.Body.String() != `{"text":"`+tc.want+`"}` { + t.Errorf("answered by %s, want %s", w.Body.String(), tc.want) + } + if got[tc.want] != tc.body { + t.Errorf("%s received a body that differs from the client's (%d vs %d bytes)", tc.want, len(got[tc.want]), len(tc.body)) + } + }) + } +} + +// With Parakeet disabled, a request naming it still goes to Whisper unchanged: +// the default path is exactly the previous behaviour. +func TestRouting_ParakeetDisabledFallsBackToWhisper(t *testing.T) { + cfg, got := asrBackends(t) + cfg.Parakeet.Enabled = false + router := buildRouter(t, cfg) + body := multipartBody([2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"file", "RIFF"}) + req := httptest.NewRequest(http.MethodPost, "/v1/audio/transcriptions", strings.NewReader(body)) + req.Header.Set("Content-Type", "multipart/form-data; boundary=b") + w := httptest.NewRecorder() + router.ServeHTTP(w, req) + if w.Body.String() != `{"text":"whisper"}` || got["whisper"] != body { + t.Errorf("got %s, want whisper with the unchanged body", w.Body.String()) + } +} + +// Translations stay on Whisper even when they name the Parakeet model. +func TestRouting_TranslationsStayOnWhisper(t *testing.T) { + cfg, _ := asrBackends(t) + router := buildRouter(t, cfg) + body := multipartBody([2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"file", "RIFF"}) + req := httptest.NewRequest(http.MethodPost, "/v1/audio/translations", strings.NewReader(body)) + req.Header.Set("Content-Type", "multipart/form-data; boundary=b") + w := httptest.NewRecorder() + router.ServeHTTP(w, req) + if w.Body.String() != `{"text":"whisper"}` { + t.Errorf("got %s, want whisper", w.Body.String()) + } +} diff --git a/renovate.json b/renovate.json index ee23b1f..2d9478c 100644 --- a/renovate.json +++ b/renovate.json @@ -16,6 +16,7 @@ "description": "av must stay on 16.x: faster-whisper 1.2.1 breaks with newer PyAV majors", "matchPackageNames": ["av"], "matchManagers": ["pip_requirements"], + "matchFileNames": ["deploy/whisper/requirements.txt"], "enabled": false } ], diff --git a/scripts/test-chart.sh b/scripts/test-chart.sh new file mode 100755 index 0000000..0b3cbf4 --- /dev/null +++ b/scripts/test-chart.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Render the Helm chart and check the optional Parakeet backend: +# off by default (nothing rendered, router told it is disabled), and with +# parakeet.enabled=true a Deployment, Service, NetworkPolicy and the router's +# PARAKEET_URL. Needs helm. +set -euo pipefail +chart="$(dirname "$0")/../deploy/helm" +fail() { echo "FAIL: $*" >&2; exit 1; } + +off=$(helm template t "$chart") +grep -q 'name: t-inference-stack-parakeet' <<<"$off" && fail "parakeet rendered although disabled" +grep -A1 'name: PARAKEET_ENABLED' <<<"$off" | grep -q 'value: "false"' || fail "router lacks PARAKEET_ENABLED=false" + +on=$(helm template t "$chart" --set parakeet.enabled=true) +for kind in Deployment Service NetworkPolicy; do + grep -B3 'name: t-inference-stack-parakeet$' <<<"$on" | grep -q "kind: $kind" || fail "no parakeet $kind" +done +grep -q 'value: "http://t-inference-stack-parakeet:9000"' <<<"$on" || fail "router lacks PARAKEET_URL" +grep -q 'app.kubernetes.io/component: router' <<<"$(grep -A30 'kind: NetworkPolicy' <<<"$on")" || fail "networkpolicy does not select the router" + +nonp=$(helm template t "$chart" --set parakeet.enabled=true --set parakeet.networkPolicy.enabled=false) +grep -q 'kind: NetworkPolicy' <<<"$nonp" && fail "networkpolicy rendered although disabled" +echo "chart OK" From 02d6cca4da68910b31ce00b83b8a68b94b707dd1 Mon Sep 17 00:00:00 2001 From: Eike Haller <58111764+eksrha@users.noreply.github.com> Date: Sat, 14 Nov 2026 10:21:31 +0100 Subject: [PATCH 2/2] fix: bound router body peek and enforce parakeet limits before the upload is parsed - router: read at most 1 MiB to find the model field, then stream the rest; a later or missing field goes to Whisper - parakeet: admission middleware answers 429 and 413 before Starlette spools the upload; decode from the spooled file without a second copy; 504 after REQUEST_TIMEOUT_S; OpenAI-style error bodies - image: hash-pinned requirements installed with --require-hashes - chart: refuse to render when concurrent uploads can exceed the /tmp volume; request timeout; note on kubelet probes and the NetworkPolicy Refs #28 --- .github/workflows/ci.yml | 2 +- deploy/Containerfile.parakeet | 5 +- .../helm/templates/parakeet/deployment.yaml | 8 +- deploy/helm/values.yaml | 18 +- deploy/parakeet/requirements.in | 19 + deploy/parakeet/requirements.txt | 824 +++++++++++++++++- deploy/parakeet/server.py | 245 ++++-- deploy/parakeet/tests/test_server.py | 111 ++- docs/configuration.md | 7 +- internal/proxy/proxy.go | 35 +- internal/proxy/proxy_test.go | 6 +- scripts/test-chart.sh | 3 + 12 files changed, 1161 insertions(+), 122 deletions(-) create mode 100644 deploy/parakeet/requirements.in diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcfa725..5634947 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: - name: Install test dependencies run: | - grep -E '^(numpy|av|fastapi|python-multipart)==' deploy/parakeet/requirements.txt > /tmp/test-req.txt + grep -E '^(numpy|av|fastapi|python-multipart)==' deploy/parakeet/requirements.in > /tmp/test-req.txt pip install -r /tmp/test-req.txt httpx pytest - name: Test diff --git a/deploy/Containerfile.parakeet b/deploy/Containerfile.parakeet index 9611903..428546b 100644 --- a/deploy/Containerfile.parakeet +++ b/deploy/Containerfile.parakeet @@ -37,7 +37,7 @@ ARG PARAKEET_MODEL_REVISION=8f23f0c03c8761650bdb5b40aaf3e40d2c15f1ce RUN apk add --no-cache python-${PYTHON} py${PYTHON}-pip COPY deploy/parakeet/requirements.txt /tmp/requirements.txt RUN python${PYTHON} -m venv /venv && \ - /venv/bin/pip install --no-cache-dir -r /tmp/requirements.txt && \ + /venv/bin/pip install --no-cache-dir --require-hashes --only-binary=:all: -r /tmp/requirements.txt && \ rm /tmp/requirements.txt # Model files and their SHA-256 (int8 encoder and decoder; the NeMo @@ -66,8 +66,7 @@ EOF FROM ${BASE_IMAGE} ARG PYTHON -RUN apk add --no-cache python-${PYTHON} && \ - adduser -D -u 65532 -s /sbin/nologin nonroot 2>/dev/null || true +RUN apk add --no-cache python-${PYTHON} COPY --from=build /venv /venv COPY --from=build /opt/model /opt/model diff --git a/deploy/helm/templates/parakeet/deployment.yaml b/deploy/helm/templates/parakeet/deployment.yaml index eafe13d..497d9dd 100644 --- a/deploy/helm/templates/parakeet/deployment.yaml +++ b/deploy/helm/templates/parakeet/deployment.yaml @@ -1,4 +1,8 @@ {{- if .Values.parakeet.enabled }} +{{- $p := .Values.parakeet }} +{{- if ge (mul (add $p.maxConcurrent $p.maxQueue) $p.maxUploadMB) (int $p.tmpSizeMB) }} +{{- fail (printf "parakeet: (maxConcurrent + maxQueue) x maxUploadMB = %d MB must be below tmpSizeMB (%d)" (mul (add $p.maxConcurrent $p.maxQueue) $p.maxUploadMB) (int $p.tmpSizeMB)) }} +{{- end }} apiVersion: apps/v1 kind: Deployment metadata: @@ -62,6 +66,8 @@ spec: value: {{ .Values.parakeet.maxConcurrent | quote }} - name: MAX_QUEUE value: {{ .Values.parakeet.maxQueue | quote }} + - name: REQUEST_TIMEOUT_S + value: {{ .Values.parakeet.requestTimeoutSeconds | quote }} - name: PYTHONDONTWRITEBYTECODE value: "1" ports: @@ -102,7 +108,7 @@ spec: volumes: - name: tmp emptyDir: - sizeLimit: {{ .Values.parakeet.tmpSizeLimit }} + sizeLimit: {{ .Values.parakeet.tmpSizeMB }}Mi --- apiVersion: v1 kind: Service diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index 22e9b95..66fb05d 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -496,10 +496,15 @@ parakeet: chunkSeconds: 30 # Transcriptions running at once, and requests allowed to wait behind them; - # beyond that the server answers 429 with Retry-After. + # beyond that the server answers 429 with Retry-After before reading the + # upload. maxConcurrent: 1 maxQueue: 4 + # Decoding plus inference of one request stop with 504 after this many + # seconds. Keep it below the router's PARAKEET_TIMEOUT (default 60s). + requestTimeoutSeconds: 30 + service: port: 9000 @@ -530,8 +535,11 @@ parakeet: seccompProfile: type: RuntimeDefault - # Uploads are written to /tmp (emptyDir, the root filesystem is read-only). - tmpSizeLimit: 512Mi + # Uploads are spooled to /tmp (emptyDir, the root filesystem is read-only). + # At most maxConcurrent + maxQueue uploads of maxUploadMB each are in the + # pod at once; the chart refuses to render unless that fits into tmpSizeMB + # (default 5 x 25 MB = 125 MB < 512 MB), so a burst cannot evict the pod. + tmpSizeMB: 512 # Model load and warmup take a few seconds from local disk. startupProbe: @@ -540,6 +548,10 @@ parakeet: failureThreshold: 36 # Only the router may connect (and nothing else is reachable from the pod). + # The kubelet's HTTP probes come from the node, not from a pod; most CNIs + # always allow node traffic, but check yours (e.g. Cilium with + # policy-enforcement "always", or Calico without host endpoint rules) + # before enabling, or the probes fail. networkPolicy: enabled: true diff --git a/deploy/parakeet/requirements.in b/deploy/parakeet/requirements.in new file mode 100644 index 0000000..6e581e9 --- /dev/null +++ b/deploy/parakeet/requirements.in @@ -0,0 +1,19 @@ +# Direct dependencies of the parakeet image (deploy/Containerfile.parakeet). +# requirements.txt is generated from this file with hashes for every package, +# including the transitive ones; the image installs it with --require-hashes: +# pip-compile --generate-hashes --allow-unsafe --strip-extras -o requirements.txt requirements.in +# (Python 3.13, Linux x86_64). Bump here, regenerate, re-run the image smoke test. + +# Model runtime: onnx-asr only depends on numpy; ONNX Runtime does the work. +onnx-asr==0.12.0 +onnxruntime==1.32.0 +numpy==2.5.4 + +# Audio decoding and resampling (wav, mp3, ogg/opus, webm, mp4/m4a, flac). +# The wheel bundles the FFmpeg libraries, so no system ffmpeg is needed. +av==19.0.2 + +# HTTP server (deploy/parakeet/server.py). +fastapi==0.142.2 +uvicorn[standard]==0.54.0 +python-multipart==0.0.32 diff --git a/deploy/parakeet/requirements.txt b/deploy/parakeet/requirements.txt index 704ed1f..f46910b 100644 --- a/deploy/parakeet/requirements.txt +++ b/deploy/parakeet/requirements.txt @@ -1,18 +1,806 @@ -# Python dependencies of the parakeet image (deploy/Containerfile.parakeet). -# Everything the server imports is pinned; bump deliberately and re-run the -# image smoke test (start the container, POST a short clip to -# /v1/audio/transcriptions). - -# Model runtime: onnx-asr only depends on numpy; ONNX Runtime does the work. -onnx-asr==0.12.0 -onnxruntime==1.32.0 -numpy==2.5.4 - -# Audio decoding and resampling (wav, mp3, ogg/opus, webm, mp4/m4a, flac). -# The wheel bundles the FFmpeg libraries, so no system ffmpeg is needed. -av==19.0.2 - -# HTTP server (deploy/parakeet/server.py). -fastapi==0.142.2 -uvicorn[standard]==0.54.0 -python-multipart==0.0.32 +# +# This file is autogenerated by pip-compile with Python 3.13 +# by the following command: +# +# pip-compile --allow-unsafe --generate-hashes --no-emit-index-url --output-file=requirements.txt --strip-extras requirements.in +# +annotated-doc==0.0.6 \ + --hash=sha256:361ca0950cc7082f53fa69e9328409f40a62c61e57e0a47e1825a08078a58a53 \ + --hash=sha256:7969bb69912085b2285849c0dcac0b4b374fd180c13cf10a87f284ffcf347bbf + # via fastapi +annotated-types==0.8.0 \ + --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ + --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 + # via pydantic +anyio==4.16.0 \ + --hash=sha256:59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb \ + --hash=sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026 + # via + # starlette + # watchfiles +av==19.0.2 \ + --hash=sha256:04c8e412642c652cb2b1997a9cb2114546ee7d894600c631f4be8ceb26a0d0d2 \ + --hash=sha256:0e425d631510ca21e47c58f3837a9dceae0453c24e926408c8a12b95239cbbd6 \ + --hash=sha256:1e7cb7b66a832bce8996af5b94f1cf4014a05ff51e0005feac4cb2566d711020 \ + --hash=sha256:32a8d37bde9e24ad0cc855140cbeecde17a363d7dc7928dcfc71a34b5f3ed387 \ + --hash=sha256:3ce5a1d7b916d13c16ac58f1756f0fee4af2d53f02bc1403e18550b50d375a22 \ + --hash=sha256:44d3faae747cf04a33f39db8ae983ff3d93adc864ee663bc186b25b686803c3e \ + --hash=sha256:79a277b077e3768a0ea9f881ca0b3bc96d4135a8d3a7a579938adb58718d0dfd \ + --hash=sha256:8596fad2017d380708de35ddf9d34f808b8488c912cdc3f361691d866d9dc32d \ + --hash=sha256:91924f5c836b1cbf89fe1522c642f98e89a733124908561fd49dc7a70e9b6d10 \ + --hash=sha256:9c1da7aad0fa6c13b4a5c1e7985be0d13f8526a96284573acaf3d55ead6d3fe8 \ + --hash=sha256:9d4f9f78c0ce1f20deb72626fdb3c723757f61a8cd6fbb7dd44d9401884a91fd \ + --hash=sha256:9db27c2248112a8eed3edd3ca83cf4405f52a402cda2eb1956035e646e6b99c6 \ + --hash=sha256:ae4618eab172f8135596972252f39c7399291c921e661c1771ba26b9254b800f \ + --hash=sha256:b0dff6dfcc6ff9944fbbff15bc4ee2d90a2c1695d493bdea96e86f48823e9feb \ + --hash=sha256:b559ff381bd800c46fee6a17d7e22a3443708cdd58d0901ae91d27cf5dd0578c \ + --hash=sha256:b632e026f4375037438a6b2b5d6a489e55bc9504fad22078991ef96211bec2a9 \ + --hash=sha256:bebbc52598886480f4d861c575dc2b020785d6c04e1308680ddcc545e1b94c66 \ + --hash=sha256:dfe7af5aa8243afd5d4778f85ad1a7c948e37fad272869da1f8f93f8d57fa7ad \ + --hash=sha256:f5f7bcf987567cd3f9b01f1c375c59bf59d8a5b98c9c5c154aeda7a11e0c5dce + # via -r requirements.in +click==8.5.1 \ + --hash=sha256:8bb5376d2006950386f8c6427613334a2acadc5f559cb80e638d00b4df957e37 \ + --hash=sha256:9bbfada76703fd1d784b83eea012e3e8c6a001a876543ef104fa56aaaeb072b4 + # via uvicorn +fastapi==0.142.2 \ + --hash=sha256:06366626f2e70576367714d9ab2fe8472e6c8456dba69b399f9f797ab5e92570 \ + --hash=sha256:bd5f4d81f1e93a88bcd77caf4dfe3c2dbffc3805407a0007e9a114c18b3a670b + # via -r requirements.in +flatbuffers==25.12.19 \ + --hash=sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4 + # via onnxruntime +h11==0.16.0 \ + --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ + --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 + # via uvicorn +httptools==0.9.0 \ + --hash=sha256:02bc5b3dcb6394b9d825fd62a7bfa0b2943063a3c89abc4492ad45e334a20eb5 \ + --hash=sha256:050f7ab098121873c8f13e35857f97ab60a76185c8302bde9a384939bb7c3b96 \ + --hash=sha256:050f84b7ec46a6efe0e5f521cf8729e3397c1cef4384f62ed8d5d68ca0045776 \ + --hash=sha256:06bfe7fad972a417269d8a5fc53b87e4eca970354abf5e9e24336fd06d64292e \ + --hash=sha256:088de1738e1af624466a01c35d652dbe6fb825be887c76d68aa850621d81db88 \ + --hash=sha256:0adc974916efe1fbf89d0363a86dcb2c746727643e362ff398de1a4b50b6bc77 \ + --hash=sha256:0cc339a807c156d840b54f8bf050ba0fc265eb81692c24bca8535b52fbd797c6 \ + --hash=sha256:0fd73d0bbf700a30dd87e4412adf41cfa71542a533d6b390c7244bbb8a1152bb \ + --hash=sha256:130635fea6e611a6b2026120037965ddb88b3dafd11bb64e264b101a70a76630 \ + --hash=sha256:13873eb8aef5972fcfee614f63d47064312ad4efbfe65ade15b8a3b77f8c8659 \ + --hash=sha256:18d800aaa2d6bff7d889df810d1b19a5fde72b1f6c0ca96e8d9f28a692fe5460 \ + --hash=sha256:1a4050a651e1f2faf05eb028ce9f2168abbcee9e24b209f5c1f2eb96d8c569e4 \ + --hash=sha256:1a7f1df31829c258158be01bb04eb668c4fba7df1ddf2262131a972962e651b6 \ + --hash=sha256:1b01c0fcd6725a8d79a164ecdc4116866282479d68bb3d6d74a909bf994656c4 \ + --hash=sha256:1b95775f6292d72cb452c33e5c0f8b8551807c29a10e3c1671fef7f61361370a \ + --hash=sha256:1f6da814aeecbc6cb8872d6d3e85ed16e8ab1653f9557cea8658725ce212348a \ + --hash=sha256:2095207b75a83c9e947346da9c127fb7e4fb29f41589df2643764f06b750989c \ + --hash=sha256:22ab1b10b06d357f01092e60f5e6856a0d479ed79b0ec2166a339ea26c699be2 \ + --hash=sha256:2319858018eedd0c0b2f950a620413c0a9d1352607be4267eb28209eca8b1e3f \ + --hash=sha256:268d18601feb5367885c6ebf6f402c18fc25a324cee215784adafe0a1eef925f \ + --hash=sha256:26e1d9629f3bf70d23f0d22238152aec51c837a7c9e384cb74f356fdccad7eb3 \ + --hash=sha256:272db0c51e8b71e953c1f2ecbe63402b819680e4564be2ef285cfd4584ee8355 \ + --hash=sha256:289f213d2a3dde2e8312c415ffecec5a01698589ec6249ec4e8fb3b47c0444ba \ + --hash=sha256:29b0d823e3c1e7cd1093a5dc889245db693ef13ada624cd66e2262421ef38867 \ + --hash=sha256:310266a2db1377ffae3bdf6556ab4973f4f94508a8ce37b2f6bb096a89bcefa1 \ + --hash=sha256:3238e198429cb8909ec42951b82d6a33fe0fdfcf86371732f8f09311c5b8ac32 \ + --hash=sha256:34266cec8c1d4e3e91fcca7efe38971d6bdda64a7944f2a46ab576da15173680 \ + --hash=sha256:36fac804b8cfd6b935ae64f71349f833d2b6298404626d017a2c57bb942bc643 \ + --hash=sha256:3af4e45ff455fce5511fdf2653c1ce428ef09c56fe37a83eb4d924c2d474f31e \ + --hash=sha256:3e3201fe4d46e0d15d7ff9fafc94a605da9eb82d2c5b9837f0368acb325481f1 \ + --hash=sha256:45b3002392948dcf578029c89f6318e1289a993a1a5ec38a4161560fab60f811 \ + --hash=sha256:465bc1526debf53a3be92022a16ca0c38f891ea3b5c1587af4f52e44020f8a07 \ + --hash=sha256:48c705bd0b1afb6253ed71eca9f9ba7ac7d47838e5fed1ef7891d67f21ecd4de \ + --hash=sha256:4a4d8c2c7e73ba5967be74d7c3a5ff81fde815ee1b48d9c5c0f14de8463a847b \ + --hash=sha256:4a85401b0c3f893cf5695c1199e8679fbf673f7f78c2f6c11d6b1850f8c7e358 \ + --hash=sha256:4c58dc91aefb31adad500aa68054334f429b840b36dd29e34e834101044cb2ef \ + --hash=sha256:4efbee349138a3fee7a4cc3a95abd2d499fae70dd5bff9fed9138d6f570f4283 \ + --hash=sha256:4fb995082fe41ec410b33c48b54fb1d44abb8a6ee762c31e8c42519e8c3a30a9 \ + --hash=sha256:5042aa1c7e2b1a24c17dab31d8770b63a5101c9abc25f832c6aef6b201e1ca4f \ + --hash=sha256:52fe0176682a25b15370f23f5b0f1366a84771df89144fb0cd979cb72a94b5ca \ + --hash=sha256:5332a020a60bbe32ede4bda1a62b3d56c4831d309cdf0932842c0fca8ad6aaa3 \ + --hash=sha256:563e4568217dc907a91843f38c737be865222c0400a38cdcd0d26ce92b3db271 \ + --hash=sha256:581b27663c6e9f4df68068f32fe6d1cd7647b31fac90237221a66f8821c342eb \ + --hash=sha256:58a1b0ec4cbb930e69669f9771715b2c7898d3cdf064d9811f7a66afef96b544 \ + --hash=sha256:5cc5d3a29f9ec86ce406e5ec09c241dd8dc4d30e838f74f68d728b89131a3acf \ + --hash=sha256:63d38e9a9a10a20fb57593742e63c6b1e78dd7f6ef5472de8e0b1e4cf4f3db26 \ + --hash=sha256:6b1ac7f1bc6c0dbf90684b77571a51a21b2463909fd916ce0ac9bfc4d566dc75 \ + --hash=sha256:6b900073e7b8481ef1aaf4f6c1789d210a1db01a9da8789821578cfeb4c2d540 \ + --hash=sha256:6c12d0393a903b58bc5f5a7406d6c5290acfb8284290d68547ce620c06f7d133 \ + --hash=sha256:6e2780e33a58a93f27cc3bb74a55bae6f9a8278a1dbabdff392940d30d381671 \ + --hash=sha256:6ebd39ee26db460cfe5ab8b71a15d1149b289139a0d3981522757d6af620887e \ + --hash=sha256:6f8b41299b203ce8f627db670cfea82067d9638853dbeaf86dccd93878879b85 \ + --hash=sha256:6f9549ca354a1d6d6167c458a1f1b12147726b968f02dd64b6a5801dba91ae0f \ + --hash=sha256:6ff0145b34610e57c9fae20df4e133c8d54266447387de6fcc0bdabfe4db4569 \ + --hash=sha256:6ff5f0ed70783dcb9562dbd20edca51c3d4d277f128223709e3da6b75986d1d4 \ + --hash=sha256:714bf348f468532d86bed670837e7d5ddff3834dd7f5d3c08066da400c86f088 \ + --hash=sha256:757e3f79cb865a7db94e0db5f4d0ed3284a69e39d53568f433982ea13c60cac1 \ + --hash=sha256:7e32b83bd8c2f8b6fa726ef34e63e21c4d7eddc277d40d4ef7245ea3ed28e5b6 \ + --hash=sha256:805b0f2618e5d4c3e28f45b731eb1a0539691ae4a2f97b4ce014de0bf96a1ff5 \ + --hash=sha256:80eae881cfb69383303e9a4d7961a478025b89c24f38f2e69b30c516fa0d57f2 \ + --hash=sha256:813a32f94991b9627795528053c73a57d2ce3eb98ede89f0e1c7a31095938e81 \ + --hash=sha256:8463b34ebde3f000627e9dbd8a545f995ad49fbf7ff9dd5abc0cd507da98a603 \ + --hash=sha256:8a59c749a73fbdbc8e63b895a3079825fa085d752e75bc0a500042cb8a801e48 \ + --hash=sha256:8d90d10e9b6594c28f27896a68fab97fd784c43804e9fe419dab8e8dcfcf4b02 \ + --hash=sha256:8e1e037bb57dbc549c6fe20370b763ea74bdb09413cdcf857e4f14d9e4e2fb13 \ + --hash=sha256:931f45f84e15daafec5f82cc92e6710569e1f50933f3253d206eab4132bec678 \ + --hash=sha256:995b52f7c260ac7023640221f27472303968753cb6fc6fce1ddfb0e9db59a398 \ + --hash=sha256:9b4da5789d7cf576c7e81f0088c632f6ee3786d87d17f08e90e703c22ce15633 \ + --hash=sha256:a3ed60ea9a7c352c590182c67404599e6b5a0c901e75ae4cceee9a9fd6bfa455 \ + --hash=sha256:a4d1ecad62e83cc65b411ea0125972cf3af98821e8117129947fd1e3a113f8d2 \ + --hash=sha256:ae9bb62a7902e2ab65782447cd3eeb753510feace4e3ea03937a85489b01b16b \ + --hash=sha256:b2ab3aad55d75d0b8df8d8a1b5920baaec9b161112cd5e95984848b4d2cd3dfe \ + --hash=sha256:b2cc6991f16f6d666d48e4b57318104e7b29109e32e2f6b86e9d44c4e6a27f4e \ + --hash=sha256:b5a3f5f70967a1aa2bc47fec42a1e19d2fb38c61700e3ee62b63a4af4f4fd001 \ + --hash=sha256:b68fb053b37c258a473ab67f4965c3b439500dc160fe364667035a6833eaf50a \ + --hash=sha256:b6ee42112d785a913dd63ec0335435a3dddbea5040c151252db815b0095cf066 \ + --hash=sha256:b928ab0ecaa664e8caecc529dcb8bc881b6b35bb2b74bf9a39ae25f982ee8812 \ + --hash=sha256:b9430f65db521db7962ad951571d446171213686f96c998a54dc18ed574821e2 \ + --hash=sha256:b9cd15cb7cf0d5cc41f649fd789aae12c56c3b83eff593f8e095c1d4555ad5c3 \ + --hash=sha256:bb1533541c729ad422f870a780d8b4af924f9817d45b5f580390418cda72eaa2 \ + --hash=sha256:bbf7377fbd41b7c87d47820e25b9876724963681c2a1d6f6ff2adb4db46ac174 \ + --hash=sha256:bca180cbe84e4fba7807eb408a8655295f697928512324517e30a091ede522a8 \ + --hash=sha256:beb2c8a34cc90fb4d862b7284eafdb322030d6a8b2ee5eb6a744f84205beedc3 \ + --hash=sha256:bfdabac0c6d3d6a5be8c2a100a001c92c14a39bbafd5999545a675c493626e64 \ + --hash=sha256:c0e45def4d9ce7073e2226535572442d9d6efb4047c7a5fd8960807e877ce70a \ + --hash=sha256:c0f537e5e8152e8d9cae82804024790cb973061abd3b7ef8f66f46e2b5c7bb51 \ + --hash=sha256:c195a69df0ab2541252ab5b1d76e3c182e5688ac2a9b708e5e6f66aaeda91e9a \ + --hash=sha256:c271bfb832be5c5c020b4e2fcbc1e70a0b990adba6de874b0bba1184b89cdea3 \ + --hash=sha256:c42424213c28804f8d0e20f5692106cfb57bf72e1dbc4092b8481fb2f9e4c707 \ + --hash=sha256:c4fa57d3c31889722f64bfa785545a5e603a893b6f29ac1a41bfa830abeaefd5 \ + --hash=sha256:cb2bb3ac0af7fdab2311b895c9eb95442b45deb14cc949b9e65545e74aa0be69 \ + --hash=sha256:cb3e7a4fd0168e362673a980380bf4fd6ae3b1555150e60c5390b4b10d9c50c4 \ + --hash=sha256:cbbfcd5d15056fbd1edd5e725cf3feeb47c7cbccbe205927ebab422cc229f417 \ + --hash=sha256:cd3e55223a77d6e08d5730ebacb4930ecca5d2ce7c57e7ba10833be7e52903f1 \ + --hash=sha256:ce8e723b4637034b76f5382a30a6b725518c332273e8d62a6c7d46e90837c947 \ + --hash=sha256:d1e329a1866981efe0201d05a374617f6c6cf14434a501d78ab22793d1ab1fa6 \ + --hash=sha256:d20ba5c84cf0592afb2713336f07e2b6ced082e4ae803ceada153a85613efc9f \ + --hash=sha256:d2b095129b9a98eb46a271ee9631089529c4e40354576b4aa74e24de9d2bf2f7 \ + --hash=sha256:d3906b5c549ff2ad2473cb711e1fc65d76715c2726a402108fbf55eab6c6b49d \ + --hash=sha256:d484ebb7e3a3f3597b0f645fbd1b85633674ca808c1f5ba11c2caf7c66f5c8b6 \ + --hash=sha256:db735a23ecb0f0450d2b24e0a05fb00a8a35c9db172919c4d3e023e7c7ee4c9b \ + --hash=sha256:dbc9fd1521e573045d71b6afab7398439c5cc259e8cb9d416fe62d485c4899c6 \ + --hash=sha256:df3867518b205be3648e2fbd522bf380c851b5c2500588047505afdd786b6669 \ + --hash=sha256:e0acbd474d0af4afacc6e66c4273f8a19e25f8af4379fc816388095ea6b01371 \ + --hash=sha256:eacf0f45ca3ff84c01481c60c15da9ee56711f7292f66663df0f57af61e011c2 \ + --hash=sha256:ead1a40543a033a6732a9e1e515944979a19db3737ce77363fc0660e38554344 \ + --hash=sha256:eae4e9c7a0785a1a715de0a74fb822ab40084c060f444f18f075d05e322aa7ef \ + --hash=sha256:ecf7037e491c220cd73987838c1ac3958d787bb098c3be0bfaf7f04204a6162c \ + --hash=sha256:ecfeee649184ffd800955068be9a6b579a0f33fc3c98535d685d5779cb59347f \ + --hash=sha256:edd5aa045fa3cc57143db018dd32ce7962bd5b525d05230709015d7e570100aa \ + --hash=sha256:f0ef48ce353f6b6a52232ba23d0983d4c2c84c84a778899404e34b4718509bf2 \ + --hash=sha256:f1734bd6f588975ffc246211e8b96c11933344087ca280d2cbcbf35cf835d7a9 \ + --hash=sha256:f67db0ba2bedafec15b8e5330d40da1e1c7921559fa715af021252bfef81a6f8 \ + --hash=sha256:f6ac1414556b910a879c108d79736f77e797871f9919ed0d2c3cf8cf3ecca986 \ + --hash=sha256:f78f7ae1c2e5aabf29583fc0d302d8081a663776f84578025662eb6f5d63a921 \ + --hash=sha256:f9489c1d87160c126f73b004742fe8654fa1ce37ed89e9e01330a1c10aaecde4 \ + --hash=sha256:f9ccc9884241efceb4547a92955d128574c864681f11b7ea3ecbde295fafbe8b \ + --hash=sha256:fc1a4f9d18d32a6e0a0a0a382986a60a2126f5144dd08715be7adb8df18e8a46 + # via uvicorn +idna==3.20 \ + --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ + --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c + # via anyio +numpy==2.5.4 \ + --hash=sha256:067374eb538c34c745436365cf7b0112595c1d326f21ce4ff340f61230239fbb \ + --hash=sha256:0b4724a19de67bea8cfc4970798efa78bcbbe2ac2613cfac16721a42d44de2a5 \ + --hash=sha256:0f02a46e49cfb6c73bdb7aea1c0d3461dbae9aba613542b65f657cd3d17b9fab \ + --hash=sha256:1c2e71b04c6cad90026e544501bbe0ab9290fa8a4d845e7e8c0d124fb429c988 \ + --hash=sha256:1ef3aa6d7e29bb13677323114280b05acc57607fa2300e66432d665d5418a162 \ + --hash=sha256:2132418bf8dd124a427ca9e6a1daf9ee1a87185344c95119ceae868b99466da1 \ + --hash=sha256:2199ed071f460487c8db2c0e5c0b564494190edb4772fe80f9aad88b2604def5 \ + --hash=sha256:2377da2dd3ba2c1200956acbab2a358c83b8e1f8531191672d1cd6ad83250d53 \ + --hash=sha256:298eca75243f2cbbfdb460560b9fb2a1792a33cf2ab4286efd43d92e8d3df508 \ + --hash=sha256:2c2c4afffdeb7920e445028dd71eb932cac3e704792e964bc2a232426d4f1255 \ + --hash=sha256:2ca144f15135b6212a5c47b1e2aeca6e412f102f95a2d5d88d8aec77eb255de3 \ + --hash=sha256:2fa3328f784fc8277fc48026f6cad516f5c561c5d8e2e39b3c9e0c8f23223b34 \ + --hash=sha256:325518d4245b9e331387702aa58c2ce1dc4cdcbb41dfb4ccd5dcbc7e08db1266 \ + --hash=sha256:332f3378fe077dd850e677ec01bdcc4f22368fb5d50ef10b2c79230b1bf5a592 \ + --hash=sha256:3573cd22564692a5b899ec344e5d5b9cc4576f2985b96f22af3564ed54f2710f \ + --hash=sha256:381a7a3d2e65e64c0ec302795ab9dc12bb1e73f150904699c153716177eebdaf \ + --hash=sha256:38f47be9f74ab870d2633b5456ae519c43758a8d1fd05342f0ce4ecc034396ee \ + --hash=sha256:4054173604cd8658796053f1f3bc0befb68ec1c0762c57fdad61e199256a8617 \ + --hash=sha256:468397ba3c64427474706e5c9123fe266395496714dc684294eac75cd4930d1e \ + --hash=sha256:4e263278bfb5ee6409db8aedbc4cc32973b1b82bc1e8d3c668551d04d83a7e37 \ + --hash=sha256:5258bc06526964be5face2fc6f756857a3f24f21ec3e72ca131337a75b165d6c \ + --hash=sha256:56733449d2544178beaa4545cee357370440cf056c197f9c7bfb19dbfdd0e86d \ + --hash=sha256:5ec3753760c1a6d8bb91200666e545c3a9728e6269dfb5d6ce02340996698aa3 \ + --hash=sha256:5fbf7141bbfd63aea22f435c9062a032b9ea0082fe9845dad7f021d3f1234e71 \ + --hash=sha256:64d1c8ac28a4077cf987e0a71a7a0ef7e2df70722f07f0baa42dbb7eb6938647 \ + --hash=sha256:64f9c9878c1938476365e11ccfb6b770f3b9e5f045ccddc514235041e6959365 \ + --hash=sha256:6c109eac9cd439193678f69d70733c1108487546ca8eafc107b510ae10c1aecd \ + --hash=sha256:6d6a71b9d9a97c03633aa12565ef2825ffa036cc1d99cfd50dacf0f128af4fe2 \ + --hash=sha256:6ffa07666f8da0eef81d149934a626d0d95fbd6838432a33e66245423a9062c0 \ + --hash=sha256:7415db95818b39ec475a5eea54d9e3b6bc83e3912158e46da3438cdce399804d \ + --hash=sha256:77045a4b175bbf5316ec08003880804336c78f92281a1b72222b274ea85ec5ac \ + --hash=sha256:7a14a461d9340f1b46b8648578aed9cdb8b3b018a8fac6c1dde2c9192a01a87f \ + --hash=sha256:80d6ef6e8620eb2c2b4c4caad50b5935d6db3cde2d51581b55dcc79e14016d1d \ + --hash=sha256:81e3420b27048b65eb14c3acf0c174a8cb0e023277716110347d2dcb26026dad \ + --hash=sha256:823874a507a84af050493b622affde94b6f7c3a0dc22cb2801381bc03b871c00 \ + --hash=sha256:8b4d2fd2d34e5f8c9235ee787de5631a37a28402b15cb80814df973d2be54129 \ + --hash=sha256:8dddfbee2e68d26d0d7d7d9cb247b1fd4409241cce32d815a11d97ec2cfde179 \ + --hash=sha256:950ea81d57ef070665581b6e1b5f6a029306423cd1739c5b95fe78aa30db6b9d \ + --hash=sha256:956555e0603a4d38019ae6925711cb9dc43195c076a928accf7ea5d50bddfe53 \ + --hash=sha256:98b053943e5a0474ec0da309d2cb9d3f18ea57f8a2067c2ab7b5f763d1068380 \ + --hash=sha256:9968ab7e49b93ac6e1c3b2239732183152c9150f16308d30b66a372cffe3483c \ + --hash=sha256:9a94cf751c9ad8ebaa835bcd3d40dacf8534ad086b88c38029b65123c7999d2a \ + --hash=sha256:9cb18a327b49c5c337f972b03682f6a49855525faaf3c0d3e9c96cd0fd8880a8 \ + --hash=sha256:a7b1b6353e36a7e50de2973a38d705c88ee93adcf120673cee7f45a4a3fa223a \ + --hash=sha256:a813ed7719bf45463c51779e6a98d0385fe905e48447526938a4b8337333d551 \ + --hash=sha256:aa1cce2ff3f8d953de38b76bf44602caeb69f101430208f64a10067f7cb4b1d3 \ + --hash=sha256:ad62a416ddcf863bf44bba76fbf6b53366ab0692e294f51cae4b5fbe0d246788 \ + --hash=sha256:aec3fc4b32ff82421274f5d205c559c51c840c8df66a78efd7f3612dd005a26a \ + --hash=sha256:b1185012870173de7ae33d370bd45b1cf5baee747ea4b97036b65f4e93016877 \ + --hash=sha256:b11e8fda06a7d69f15ebf542660b74466c2e51094800c1fb794f47ad4faeef17 \ + --hash=sha256:b64a85f40e154983960a4167d4c1d57a50c7f109b3d3264a3a984154e90a8454 \ + --hash=sha256:b86966fbe4ad7de710422175572bcdc75fdedadfb54bc6fab7deabccddd7780b \ + --hash=sha256:b89d0aaae2fe498c648f4c4795c084db535af5bd98ef942b2a3681fb74ce8645 \ + --hash=sha256:bc39ac66a7a9a3fbd6134fda43136b60ffde99c8f4501e64e0d2b24da137babf \ + --hash=sha256:c05ede731b03fb1b7591faca9389ade3267d2bddf1ad8882bb3f2cc5e101694f \ + --hash=sha256:c6342f54c67093cae5c0227eb0eb772fdb79f2a2c37a6eb278b9909ee06aa356 \ + --hash=sha256:c668b2f0d651605b58892644b0e302c7157f7159544227758c896982ef384b18 \ + --hash=sha256:c9b80cdf5cedba0e90d93fa5f9a333c4d65bd545cd669b71bb97ce2b703c9d73 \ + --hash=sha256:cfd73180400042a7c532d30c5e287bdd03c59ff9ee1b4c0316af0539e29dfe23 \ + --hash=sha256:d4cccbbc78717966f764cd3af4fb70276fa01fc7a2688af11c78901fa5c04f05 \ + --hash=sha256:d549420b8858885cea8838a727842249218b9c1da24dd517e25c9c7a948310a3 \ + --hash=sha256:d8200f16437b289a5bb927c6e184eccc3e8389bc0070fea4cd5b9e13c1757959 \ + --hash=sha256:e94aef2c639da4a960ad0db8e06471208d8589974953d78b61d345b4eb99e394 \ + --hash=sha256:fbde6962867ee75b48b0ee29b2b9372ec5d617799dbaf38e82dc0596f2f7738a \ + --hash=sha256:fe4d21ab149f15e4e6043dfb0de87e6e5f34ac176cde83060e9802981fca2ac2 \ + --hash=sha256:ffa6ce09a1c6a08e9667dd9c97aa0b14184e8d18f2a14b78b2a2328c9147f076 + # via + # -r requirements.in + # onnx-asr + # onnxruntime +onnx-asr==0.12.0 \ + --hash=sha256:5e7ceca454609819ea7833f61e2302e0c8f6ece4f8a78b66c5daba53cb51de4a \ + --hash=sha256:c1fcacddbced392f9f769ed5c6223f4ce739a6e4549346de33b9b520d4ead713 + # via -r requirements.in +onnxruntime==1.32.0 \ + --hash=sha256:02ea12a28c069ea8510093d95a7f6ff8126bfd9fc5c0d3381c03b80fb2b424ba \ + --hash=sha256:2303372a85299b6757b0e11e1cbf13e410ddf7e10c37f4b37e99d1c90e7daf7c \ + --hash=sha256:23361cdf98afac352d10aa7d9e0a10ceaeb02d38430fb693c6eff370196db62d \ + --hash=sha256:27bf5dad46355a8a435c9c4e1556464d99ca834ea44e0f452909712068b8821b \ + --hash=sha256:29e4b0fdd3bea834ace358bd8c48641266ec327f730363ab0ab5d0ca574d38fe \ + --hash=sha256:2b08ee990d00ab2ee129c5e039f7339963335a4d76f5bd22bfb4f896ae1cec0a \ + --hash=sha256:2c4338c899144fd055a86c1d89424001db60e48a474e198c0fd0d1d577e4b663 \ + --hash=sha256:366b9e53d07812cc5c92822cecf7563b76a8a0f32ba3bb8dd232a206ac3bcb6c \ + --hash=sha256:4135431395c1f37de0811f452c20a8b774f51812fda6c49611ed9899bbdbeeb4 \ + --hash=sha256:48b878f9551d465aa79ee94ecaf49a1f6b5d27f2975efa775ded374db14d0af1 \ + --hash=sha256:54d02baff2df38777b4c3cc7af326406fe8b8a48f54720f4c446d2d327920a79 \ + --hash=sha256:5a34fc4dfeb5a7b4a74c95dcba1e773d722abda720b474edf1b0c419dc6d163d \ + --hash=sha256:64d394c69d561af3efd4d4f49dcac8f11d0ce135a20701c16d53b74056cd4cf8 \ + --hash=sha256:926b6a87ffdcef56805b213807c28b97ae53763a630795baee1dfb420c2a5b68 \ + --hash=sha256:99e1074c4b2197accd5073052a465361be17b89c093b8ffb6e6bd8f986c52df8 \ + --hash=sha256:ab327b736552324af8d2a38bef5a65ed773f67184a36ff642beec7f5b4e9b03f \ + --hash=sha256:b01314ab8aa8176919818b19b899cd1cd72b5e4fc33e1127396f043206b6ceed \ + --hash=sha256:b224d11cfaecc95b85bdbd69f1673a984c7879af5823bb3ff377b9cb90b176fc \ + --hash=sha256:b33d822c19d036944bd969491d20095fc8def8ad0f32a969f6376df7568c0344 \ + --hash=sha256:c7f9aa98036ba2a47aa041a4a8c6d0a1f7bfe1bde44c131dcd15ce334f2f148d \ + --hash=sha256:d52510bbbcc880c13b826f7d75cdf33ac5cf0bb864d960000fc29ce73f0cb83e \ + --hash=sha256:d7e0c45cc5f456ad7805e6dd256a7662736cda9c2fd17becae194eb3c2f6df72 \ + --hash=sha256:e36c187006e7a7c8b8d6d57f1a209dd63f52430dca6c282b177718ad6b841054 \ + --hash=sha256:efe7456952c243a05a53d5b8732953625144642c2f3989094277f6217f0c0c40 + # via -r requirements.in +opentelemetry-api==1.45.2 \ + --hash=sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34 \ + --hash=sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4 + # via fastapi +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via onnxruntime +protobuf==7.36.2 \ + --hash=sha256:497d0463ff3316681da6c0b9e8d06cb465d61abce00b613ab42226175644d1bb \ + --hash=sha256:89f23aa53c24553a2416fd4fd1ec06f74fa42b14b546d8883128813f775bbfd2 \ + --hash=sha256:912c1221170e16c08d1f086762f563dd61ff83c18b5fa6652952dfaded66f728 \ + --hash=sha256:a300819d441e078a5608c0d3c709796bb548136058fda017ae51d425b44fd353 \ + --hash=sha256:bdb3a345d48db958e6ce1f18e508beb0cc981d64f24088427549c866cd039f1e \ + --hash=sha256:cbc70b17ee27e28894c7fee8bb04be1abead49e936bc70eb60052531eee2079e \ + --hash=sha256:e11e1f0180583a2af89db6a2ecd9e8dc40aa6d2988ca175bfd0e6d12ea72d74e \ + --hash=sha256:f4fee11ec330d238b34a05c9b675f693c20415d1c5bd7d5320cc2f8a798eb9cf + # via onnxruntime +pydantic==2.14.3 \ + --hash=sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d \ + --hash=sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8 + # via fastapi +pydantic-core==2.50.4 \ + --hash=sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356 \ + --hash=sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444 \ + --hash=sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb \ + --hash=sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34 \ + --hash=sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8 \ + --hash=sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86 \ + --hash=sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80 \ + --hash=sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445 \ + --hash=sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016 \ + --hash=sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f \ + --hash=sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c \ + --hash=sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca \ + --hash=sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97 \ + --hash=sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783 \ + --hash=sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317 \ + --hash=sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344 \ + --hash=sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6 \ + --hash=sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755 \ + --hash=sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff \ + --hash=sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b \ + --hash=sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347 \ + --hash=sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7 \ + --hash=sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7 \ + --hash=sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372 \ + --hash=sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583 \ + --hash=sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2 \ + --hash=sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1 \ + --hash=sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b \ + --hash=sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6 \ + --hash=sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113 \ + --hash=sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865 \ + --hash=sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe \ + --hash=sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7 \ + --hash=sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882 \ + --hash=sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b \ + --hash=sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519 \ + --hash=sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf \ + --hash=sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3 \ + --hash=sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a \ + --hash=sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b \ + --hash=sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32 \ + --hash=sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500 \ + --hash=sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733 \ + --hash=sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc \ + --hash=sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20 \ + --hash=sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25 \ + --hash=sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69 \ + --hash=sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7 \ + --hash=sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d \ + --hash=sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d \ + --hash=sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5 \ + --hash=sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941 \ + --hash=sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18 \ + --hash=sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8 \ + --hash=sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2 \ + --hash=sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d \ + --hash=sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c \ + --hash=sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2 \ + --hash=sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1 \ + --hash=sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7 \ + --hash=sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8 \ + --hash=sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799 \ + --hash=sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806 \ + --hash=sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac \ + --hash=sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03 \ + --hash=sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1 \ + --hash=sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43 \ + --hash=sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c \ + --hash=sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c \ + --hash=sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3 \ + --hash=sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99 \ + --hash=sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c \ + --hash=sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09 \ + --hash=sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf \ + --hash=sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f \ + --hash=sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283 \ + --hash=sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2 \ + --hash=sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466 \ + --hash=sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049 \ + --hash=sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4 \ + --hash=sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859 \ + --hash=sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b \ + --hash=sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0 \ + --hash=sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b \ + --hash=sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f \ + --hash=sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80 \ + --hash=sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394 \ + --hash=sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104 \ + --hash=sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f \ + --hash=sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6 \ + --hash=sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100 \ + --hash=sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914 \ + --hash=sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387 \ + --hash=sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52 \ + --hash=sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20 \ + --hash=sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091 \ + --hash=sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949 \ + --hash=sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c \ + --hash=sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0 \ + --hash=sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0 \ + --hash=sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6 \ + --hash=sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296 \ + --hash=sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3 \ + --hash=sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1 \ + --hash=sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9 \ + --hash=sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969 \ + --hash=sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd \ + --hash=sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688 \ + --hash=sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2 \ + --hash=sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c \ + --hash=sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823 \ + --hash=sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601 \ + --hash=sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae \ + --hash=sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4 \ + --hash=sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe \ + --hash=sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c \ + --hash=sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f \ + --hash=sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b \ + --hash=sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7 \ + --hash=sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8 \ + --hash=sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9 \ + --hash=sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5 \ + --hash=sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee \ + --hash=sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a \ + --hash=sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753 \ + --hash=sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380 \ + --hash=sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924 \ + --hash=sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e \ + --hash=sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821 \ + --hash=sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8 \ + --hash=sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4 \ + --hash=sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641 \ + --hash=sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e \ + --hash=sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d \ + --hash=sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730 \ + --hash=sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f \ + --hash=sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4 \ + --hash=sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc \ + --hash=sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa \ + --hash=sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96 + # via pydantic +python-dotenv==1.2.4 \ + --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc \ + --hash=sha256:f0d53e69935a851c0dcc78f3ab7aaccd8cabef0b92382b576b824212902873c0 + # via uvicorn +python-multipart==0.0.32 \ + --hash=sha256:be54b7f3fa167bb83e4fcd936b887b708f4e57fe75911c02aebf53efaf8d938e \ + --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 + # via -r requirements.in +pyyaml==6.0.3 \ + --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ + --hash=sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a \ + --hash=sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3 \ + --hash=sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956 \ + --hash=sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6 \ + --hash=sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c \ + --hash=sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65 \ + --hash=sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a \ + --hash=sha256:1ebe39cb5fc479422b83de611d14e2c0d3bb2a18bbcb01f229ab3cfbd8fee7a0 \ + --hash=sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b \ + --hash=sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1 \ + --hash=sha256:22ba7cfcad58ef3ecddc7ed1db3409af68d023b7f940da23c6c2a1890976eda6 \ + --hash=sha256:27c0abcb4a5dac13684a37f76e701e054692a9b2d3064b70f5e4eb54810553d7 \ + --hash=sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e \ + --hash=sha256:2e71d11abed7344e42a8849600193d15b6def118602c4c176f748e4583246007 \ + --hash=sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310 \ + --hash=sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4 \ + --hash=sha256:3c5677e12444c15717b902a5798264fa7909e41153cdf9ef7ad571b704a63dd9 \ + --hash=sha256:3ff07ec89bae51176c0549bc4c63aa6202991da2d9a6129d7aef7f1407d3f295 \ + --hash=sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea \ + --hash=sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0 \ + --hash=sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e \ + --hash=sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac \ + --hash=sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9 \ + --hash=sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7 \ + --hash=sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35 \ + --hash=sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb \ + --hash=sha256:5cf4e27da7e3fbed4d6c3d8e797387aaad68102272f8f9752883bc32d61cb87b \ + --hash=sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69 \ + --hash=sha256:5ed875a24292240029e4483f9d4a4b8a1ae08843b9c54f43fcc11e404532a8a5 \ + --hash=sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b \ + --hash=sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c \ + --hash=sha256:6344df0d5755a2c9a276d4473ae6b90647e216ab4757f8426893b5dd2ac3f369 \ + --hash=sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd \ + --hash=sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824 \ + --hash=sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198 \ + --hash=sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065 \ + --hash=sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c \ + --hash=sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c \ + --hash=sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764 \ + --hash=sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196 \ + --hash=sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b \ + --hash=sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00 \ + --hash=sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac \ + --hash=sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8 \ + --hash=sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e \ + --hash=sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28 \ + --hash=sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3 \ + --hash=sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5 \ + --hash=sha256:9c57bb8c96f6d1808c030b1687b9b5fb476abaa47f0db9c0101f5e9f394e97f4 \ + --hash=sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b \ + --hash=sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf \ + --hash=sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5 \ + --hash=sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702 \ + --hash=sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8 \ + --hash=sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788 \ + --hash=sha256:b865addae83924361678b652338317d1bd7e79b1f4596f96b96c77a5a34b34da \ + --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d \ + --hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc \ + --hash=sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c \ + --hash=sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba \ + --hash=sha256:c2514fceb77bc5e7a2f7adfaa1feb2fb311607c9cb518dbc378688ec73d8292f \ + --hash=sha256:c3355370a2c156cffb25e876646f149d5d68f5e0a3ce86a5084dd0b64a994917 \ + --hash=sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5 \ + --hash=sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26 \ + --hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f \ + --hash=sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b \ + --hash=sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be \ + --hash=sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c \ + --hash=sha256:efd7b85f94a6f21e4932043973a7ba2613b059c4a000551892ac9f1d11f5baf3 \ + --hash=sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6 \ + --hash=sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926 \ + --hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0 + # via uvicorn +starlette==1.10.0 \ + --hash=sha256:478c0ab3b4ced6e82719849c118fa406f0278a3499c1a898cd15cd31bdc38ce4 \ + --hash=sha256:b8399098d4c1e3522734f7235dc79b1fc967f96cf139c81e0fa30479e0685f9b + # via fastapi +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # anyio + # fastapi + # opentelemetry-api + # pydantic + # pydantic-core + # typing-inspection +typing-inspection==0.4.5 \ + --hash=sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7 \ + --hash=sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39 + # via + # fastapi + # pydantic +uvicorn==0.54.0 \ + --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf \ + --hash=sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620 + # via -r requirements.in +uvloop==0.23.0 \ + --hash=sha256:0305871ac712f54b62af73f943dbf21ae3ce80a44bc0f0151424484affa85645 \ + --hash=sha256:090865d8ce7a03986755a3ce711b7dd0d4b44eb14ab74368b717f3fad1180208 \ + --hash=sha256:098a85e1393ef5202767b7e5fb41a32cd8bd81e6ee4af364c179801c4aa3f6d4 \ + --hash=sha256:0efdd55bddbd36bb2fcb842d64c0d5f6407c6958c68088cc25df8c09edc5b5fd \ + --hash=sha256:12634f15e6625f78b3f2922f91404c4d7173487eba11746764153f556e9852dc \ + --hash=sha256:1748321e3c59a14a75404b1ae8d5a8d81c4e201803ea0e14c1b6fd84421024b5 \ + --hash=sha256:19c64108b507cd0bc140e400e3396bacebd9d504956aa7726272bf6de7d9aabb \ + --hash=sha256:1e84575f11873c109cf3962ad0bdf679094466184125f4cadcc41a73febff41f \ + --hash=sha256:24c58ae4a83e93a04c504bcc678125e36a0bfc44af928ad69444880c60f187a5 \ + --hash=sha256:28d160f51ab4da3b187063652e643dea6831072add4adc1e6d62afbe73b6be27 \ + --hash=sha256:2dcff2d69be43e6559e5dad2c5a7a2dbfb60e05a77311b6c4b7a4a8123d86c65 \ + --hash=sha256:31e0cf90bc8fd88784f6802cdba968a51fb1aec1cc3feec74d862b2d371d1330 \ + --hash=sha256:378188efbb1524f2219d05246a3e1e5907217848d2882144dff59585f1b81d55 \ + --hash=sha256:42feced24b9b44b856c633eafb5cc5dec354972da55ce77598db6844c054bc7c \ + --hash=sha256:4448e9124537620f9c25d004c227bb5104440b58955c19bbd312d910af919a63 \ + --hash=sha256:4a08875543bbd4519faf30497506c9cda8a48470467ffdf967c7313c7a5981a8 \ + --hash=sha256:4b8e207c67d207a8608fec57e116511030af3495dc0109b8c333cf9cb412b16f \ + --hash=sha256:4bb7f5d0b62b5afaaaea2b7b60d508921c24b0fe39c22c1438bec1811ffe10ec \ + --hash=sha256:4f1798f56c6f4ba5ac11fa2869e5717926e4470d97a1dd42b4f59219d43b5027 \ + --hash=sha256:514698d3683189031dcbfdc31e87115992e5ce9e1b19fe5359941323f2df800c \ + --hash=sha256:53c2c5d7e2024e46776c2d90e6c637d01102126b61aaf5faa5edaf05f8b5722a \ + --hash=sha256:55d6f4135d914305929fe9e9c44d8b5383a9b3fa1bee3bfcf60ee97e01af07ea \ + --hash=sha256:5a2bbad3a63007f7e9524d4903ba04fee252557c2acd86f9a3d4f91786695254 \ + --hash=sha256:5a3e0f56ec19bfd9ad1605572878dd6ff7f01b325f4fc154812ae70d615c3aff \ + --hash=sha256:5bb9be71d9ee39b4359b832f9569518ec9bc08704194034e79e4958e6bc4d46d \ + --hash=sha256:60ec798c40a1810d282ee046f61ecac1c5675cb898763d9f08d97d53a5e00a81 \ + --hash=sha256:6b3cbc4f96ddfa1fb88a78a69dd851369825b7816d9702eee8c4461505ba172e \ + --hash=sha256:6c7ef4701a96553514b2688e342ef1bf2beae6cfd172d89a76c768292aabf405 \ + --hash=sha256:7337b06a9f9ed9ea3049f04b76f65819db9b19bb832ee598e97b388eadf25e5f \ + --hash=sha256:76345f51367fb1f23e08605c6efb18374f669be5b223658fbab6b17627950507 \ + --hash=sha256:7e35c9bc977760981693e1a7a51493b58ee5a501f9ebb1e547565ee40b6c6208 \ + --hash=sha256:80cac5cb90ed7b9b72a217a1d6982b15b829cdbd0ee6bc19b93e3a9e47fb0ac9 \ + --hash=sha256:8af88fe5c7dd68fe1fec6dea8155caa1a47155d219a750ff34049541cf536a5e \ + --hash=sha256:8fcd721113260ffb5e38bf14a8725b17d431f34209f7d1c7005b667946e630b3 \ + --hash=sha256:93087a845cdfb35753e539354ac9551bdd2ff528c202a98df0ae46e852bcf021 \ + --hash=sha256:93935ab27b6eaef4c3e5489aebc84284f0644592f7ab516df60ee1b27eaf5eb3 \ + --hash=sha256:9bf08e4b6362dd1c08623bbfa2d061e8bac0f1da8fc2007062cfe1dc360a49fa \ + --hash=sha256:a6ac96da66c35bf789bdcde78a88dc7d56b7907d8379648c54adc1c61594575d \ + --hash=sha256:ab17b3a8aa754be0de0e397f7b95f13b14e56f077a4c6ae295e3d4afd199b325 \ + --hash=sha256:b0d106d9314546d69b3df1b5352639aa628530ec3ecef8a98a21942d2a2a64f5 \ + --hash=sha256:b90397a50ad6332ed3e459c648ac20d182cce24a557354363ad85fc9ea4a17cd \ + --hash=sha256:bbbdb8fcd5e7062e546eec1ac78c28bb21ae7df54c18f8e4b06e15a18d661a49 \ + --hash=sha256:bd6f2f81c7b9da99d301c0b16b82044e76fe887086e42e1590ecf520b94dbdac \ + --hash=sha256:be53e1d5f83de43dc175c87612ecc128d444b38e5c56cb3f807f5a73d6887476 \ + --hash=sha256:c3f23f403a273900d57de6ee5ca0614c650f7f58563065dad1a4744498960e53 \ + --hash=sha256:cbe8d03d4efcccdb7fcedecbaa1e1fa02913eaf3a74cb933634a6bc6d2ea9e2a \ + --hash=sha256:ce17bc317d089f361b33521654c13e30eacfd3d2034fd34e613ca9c51c969686 \ + --hash=sha256:d918d6f304a309222a784bbd140b85ec5594d97e4dc0e79f590549d28970663a \ + --hash=sha256:dc61e4f9e37b507069dc7e659ae28bca7adcb04c993c3508214315d12c63f848 \ + --hash=sha256:e095f9e105af76593b4c183bb0bcbdae64bd913a59ec595732dc108b48730ab5 \ + --hash=sha256:e2cba180d6451822763eda8364f342435a873bcfb3849cbd82fdeca248ca65eb \ + --hash=sha256:e49eba8f1e28e7c03648b7a476e1ba05309e087ccdea859fc6dd659564aa8d7e \ + --hash=sha256:f1341c6abcee1c31277cfe28d34e46196f2143ec3d755e6efe7452126e1f626d \ + --hash=sha256:f3fbfe82829d8e381426a289b87e59e585278728361db9ce975b88b51f64f410 \ + --hash=sha256:f50b580fad005a092ed87c5a3a4683459b21d1620497d6a5bccad203bee4c071 \ + --hash=sha256:f5576e8ae1723ece60d8f93c6710abf784714e99388bcf023ba9ca800bc587f6 \ + --hash=sha256:f673d835bdb1a60229cc3609a113fd2c9ce3f4a3c75ad4eaed111180c00199d2 \ + --hash=sha256:f7548ede3ee908cfabc0d068106e303a9a2d811af959cdf6ab85676344cedcda \ + --hash=sha256:fa8ed556fcc87a4091cf61587ef172fa104323dc89ecc085a618ba7ff8629a8f \ + --hash=sha256:fefea5cf8cdda9053b962ca8a90216fb0b1d40907dcb6819382b42e483e6e9f6 \ + --hash=sha256:ff7144d8167e513fe39fbb46bffb4f6f192dfb1f4b0b4e9102e1fd4f212e4747 + # via uvicorn +watchfiles==1.3.0 \ + --hash=sha256:000b9688fc8133037a8b075c8ebf98f32844ff8964dda61e85c1db547dafc441 \ + --hash=sha256:025b108f2d5cc2799cb941f79380df3e8b22bfb589c218e801767fe78d598c95 \ + --hash=sha256:04c5500faa725d69a99b0f63750e80795e455bb951849e9c98a811b4324997c4 \ + --hash=sha256:1acabde19b67e673274e89a04d613b7fb1f122e2c4b8ec9a581e59c149264b61 \ + --hash=sha256:26b81bc515a0f03f66a69a6fea86eea54c8eca4173c46dd7222569f79dd2f977 \ + --hash=sha256:380f513d26cc2e598266b88d66456e07d67ef4be8f0f435a1154d9c44b43d509 \ + --hash=sha256:45726c6b5a8d67c8087eb2933c4398948546d04206ef40f629dc4881d65d23d1 \ + --hash=sha256:4af9c464d410e8c44b58ddf1cbec7c3a02c1cb2c6c80df9c74659ba2fbda0ab5 \ + --hash=sha256:509d9f74d2bec5c1f4cd868ddcfe0c9601f7ea53066dfcb19d8ede742c4de661 \ + --hash=sha256:591de392458bca26f6130fea4e667c06b657e873ad334ea06fad5a79f5086cef \ + --hash=sha256:5ec46a1ff4c1d81405a5fc645abdbff5e4e9388f7c9a6cdb392316a7c29b884f \ + --hash=sha256:6398d250994baff581147ccba846223076fe6492ca93c0d1b3588fcf5355eb5c \ + --hash=sha256:7398930a2b76b9dc67a4e6b8bfc7baf30946892a86f417a3920c07bdd6febc30 \ + --hash=sha256:7c1125e99f84934a92996ae343501285617373acd66f16b59fd5654b27ad8d80 \ + --hash=sha256:81c989d7267bfb7b676cd32c83bec97914e396870983cbf493e29415037bff5e \ + --hash=sha256:99aee4a07847c06820765fd7b1b49ceac4f3f711ccb7d104655a33231de1c207 \ + --hash=sha256:a5b631db08fd3032db57ec6a92d1777cd60f88803287e4e941a4858c53aab1e0 \ + --hash=sha256:a85e243c87109d9f48a2e0d10d6abdee8768cc114848b32281ec83d7f81d86ef \ + --hash=sha256:b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1 \ + --hash=sha256:bbc1198edfdc90fda0600f825aa94150f428dfcbf8138746f55998e0e660d64c \ + --hash=sha256:be9ef3cd403d756a304a0a08a112163c63da7ec72c8c9d083c98818291ff8f29 \ + --hash=sha256:ca39661934749df580d89f3dde266f2af7c6968f4c21c72ce2dc387d299e6aa7 \ + --hash=sha256:d36c72fcdc08f143d87316a4c4c3b064e340da2c7383d39803950740ed418935 \ + --hash=sha256:d4593392e87669836670f87d62fc754059eaeb0e6157af44060a46558cebe5a3 \ + --hash=sha256:d754e049006e81a9be49dc78ba7802081cee426e968cbc63ee19e164fa2d0e39 \ + --hash=sha256:d978cc1dd7ba44f5590d7de74f7a9c8be7262d9e469c2c0efb8bbfc2574321dc \ + --hash=sha256:da213822ec9082b62cadf3008e07a8c690ec7a3c89f6dc5e55a8cf07b56a1b26 \ + --hash=sha256:dd538c71766c59c732e2c5cedc39323c99c11897b99f93eac773438e54af206a \ + --hash=sha256:e0204f90677b7fb8d3a824279a71a01166bea9f6e53923b8056592d87b33b0b6 \ + --hash=sha256:e5871d4a7f788a9f64fb06f5793389d29d171e5c32d37c3ebfd520b017cc7694 \ + --hash=sha256:eb94e40b9a0db19636b5e3fed0a9803452ecc7381df13b385272abb779ee83ca \ + --hash=sha256:ec3cd4bb181a7b6329134204c2277c7144ab5f62cce9c5335d6f901ee7ce8d6a \ + --hash=sha256:f0c9865240e065a2247f4b5248528ae3d01e0e8ae071462c250c884dc16e3ee3 + # via uvicorn +websockets==17.4 \ + --hash=sha256:00ad98e4bb0df7a6711c645eec16d5a9fdf99f0692bd4f5b6cb85a68677ba8df \ + --hash=sha256:0132e3cbd3f5cfc1ec77588961b302d72a02e2603b82c2c23fd5fb59dc4fa206 \ + --hash=sha256:023dc13bdc42a55e152acc81c39c90ec6cc4159ed17d23c6d73460fa2a73ab16 \ + --hash=sha256:02f380df26de14999ecace203fe1396ac14d1c6132afc7924eb6f8c8b646c69d \ + --hash=sha256:03ddf4eb76ced8725dcbb000ff60b0fb8d7330ed011f6dc725a1925c5fe02051 \ + --hash=sha256:043945a43873c7c11a3f75238d475c95f902e967de329eb8763704546cfaa6b6 \ + --hash=sha256:046ed16d3d83d64594e4a40655fef061ccf36059d8c30a01feca8a9481fe13b8 \ + --hash=sha256:06ea46717553cdd10f2682126cf7a66e91c8ed17b6969f4a95e94b4e01d06188 \ + --hash=sha256:09d3939b70df0c8ad2da145ebd50978bccaee1d565e838b0e7921a34d38571eb \ + --hash=sha256:0a57b99f2e28922b5a2434317580fd23fdf118caff4c5b752f5452836426205a \ + --hash=sha256:0c22a9c6b2349204f56123dd0ca7779e989d68e336d0dc02ad823485d44925de \ + --hash=sha256:0dcce83837328e6795225ead920d3aa8d867cc9d6922aa558b0e9111599fdbb9 \ + --hash=sha256:0e51546a3bedadd80dfa5c2efaed840ac51b8632d8db7f9f502175f5349382a9 \ + --hash=sha256:156221ad7638b5abccefd6f798916bf3f8ffd6ac51480eb4ba5b05df914ccbf3 \ + --hash=sha256:16550e24ac22c27e0a728100d8de196b5f054bab6748ef9f0b168fb8b3c32e35 \ + --hash=sha256:18d3710becc612ec6f0229425bd6495133dfcbf30f7b6569585acc8ed2f1b452 \ + --hash=sha256:1962f3bfde085af18878f1bb1aafb300c9a6ac33da886d0b0d97e33c9ce7a222 \ + --hash=sha256:203e42eb77e06f85778a908b34c5ad032f34e98a68ef33920d6685c1e65a9420 \ + --hash=sha256:2103982762460a764a7ef0021443bb471f46d45ecc6858276e4fe699ebac6b94 \ + --hash=sha256:25eb661d8ba7e2b85ebb4e7a1bb9f6a3280910ed10b84330a7abfb5ed32d2764 \ + --hash=sha256:29b615c2d5dd883f89c107a782681b73a7aa8b2bd894130310e45eb09b143913 \ + --hash=sha256:2a9cb5bbfc33b4ebd3c8d3714d6e09805437f60a14977774e4bd11b5ace46c23 \ + --hash=sha256:2b23dacf7a8a88afe92f77bcdbf4cf043a84692bac2f2da02f4011c687e19b48 \ + --hash=sha256:2fd562372d4afaf18d1c7f1c68e39bd32818bb16d5f57f778a4a4ed88eedcaae \ + --hash=sha256:32110d954d9d0e51f36edb0396673bf4d35193a0a80ba7013bf7f7d58a33ca07 \ + --hash=sha256:332b88022d0acd47c44158bcd43f47f14eaddcd979247f242b1a33291c45cdd1 \ + --hash=sha256:361f9a21a33191d5287e7a75f508fc3b9bf47aaffb0241198d6b7be3384f294e \ + --hash=sha256:37ed7782972545e67d97ef9a172e9499d25459b1e32cb99d1c2a30c572f2441b \ + --hash=sha256:3acc45494c08a4d27375a2c28474537f68910219f42624a08011221b04623d04 \ + --hash=sha256:3b76837cd051d8875913f3934b27205f7a592f78b8a4f4a1f3abc36a2420c5bc \ + --hash=sha256:3b78b39377630a70aa2198e5f03be416e690364a046b1d8af80a9263733083d0 \ + --hash=sha256:3d27153a0413696767b98b5d96173a2a7e27cbfca02000a6069cea7b977765a7 \ + --hash=sha256:3d512e3a6c528c42ce220ed9c3caff83c6fdcd98a1b98249f08ccfc66ad111b1 \ + --hash=sha256:4073ab7cefe5a2e7dc368c1f01eb27716dc8ea8f1c69e9b7725ebce05aa53cf7 \ + --hash=sha256:42d7a6e818214336cf7af9a3aae5c6923f94f09fa07ac5aab98268ba2a98a6d5 \ + --hash=sha256:4441d655a53185ef1b01b1d42ad9b3a96b905110a9219043e3fdaec855ba3b6e \ + --hash=sha256:47beedf07a706140b50786457e082497ee6b5970c41e49bcd1572ee3f4c73f80 \ + --hash=sha256:48c83103f82fce36191a9e3a8a80731d4340e2da544eae8c5aaaf6a45280e7d0 \ + --hash=sha256:4b79ea31cf277c72d2307c6cb8bd32a2c151959e80a2f24fa85df620c5f2860c \ + --hash=sha256:4c792e6cce24d08f92199d907785c9e64f74c357deeed3dbaf7d699ed5930b64 \ + --hash=sha256:4d2636a5b61c69e32db0e74b57073dd4a66f1ad195e9398c5f01bba41090deea \ + --hash=sha256:4fb2db1f649b6464711846b5bb9c1611bd906ce939d9460cbd1fa419552cd6c3 \ + --hash=sha256:506623128d7a55b726a5a46e4c9a8eae4c9dd0f04ff60b041fe7df85b9d034fe \ + --hash=sha256:51adfc30f467077293a6695d8149bcef501c0728386f3a491054f835dadb60b2 \ + --hash=sha256:52c31d123f5adf14dec694c2a4036bf42c523df7cefc641d31cd05653de56e49 \ + --hash=sha256:5830f94a7190a33e55d06d89242ea951ee2009c3a27fc31538f3ac9386b27edd \ + --hash=sha256:5cec3e7fbc911ff4fcf43b24aaf1b96906381ad36030f42897def3ff4b78729e \ + --hash=sha256:5da7f7f1ecf866186f195f7ecc374c915e1838496b86f2f3b41da27c798a25c3 \ + --hash=sha256:5ec906bb21b35e66cfdcc2ea0133f249f52b7d89e3e45ec8d2bd2d84a0255d7d \ + --hash=sha256:5f772007dfba8941873dbd276b6a6845428cc740888b5c6c37bf483b1ea34b42 \ + --hash=sha256:648adde345cfd13335342e23cfe94871c7f7f55a43fb254f3b95acb071072968 \ + --hash=sha256:6531540aa63e6864cb0615a3a5da70ae03191334507852a5385320bb7916df3f \ + --hash=sha256:6597a1f7413189b4bc58437babcdf39b79da416e5c477ae98323a88ecc108188 \ + --hash=sha256:6686d29eaafddeeab9e48af92103dc0d26161035faa4be083b8b488f1ab47219 \ + --hash=sha256:679eef0123861ca381dd8fd9bdc1920e87636ac55eae6cff875c53dcb05fbcf8 \ + --hash=sha256:6afc32a7a1a40b071070419537df3559d26907086556769683fa97b7b6e90fd5 \ + --hash=sha256:6b061ea7ca94966af7cd7a87cb189ff15972c103244611a2b1e8408c04f1dbe6 \ + --hash=sha256:6cf4c002268da5c11cae9083aec71ac943bce9d95e0f83c8bf9a95a3ce421fbb \ + --hash=sha256:6e6558efbb256b532c9f06a21ba42bcac729718e365c505819f181f25e5c0eca \ + --hash=sha256:6fd8cac4907fec8302726d49e6969acfffaf720bc39b1cee23f473b81f4dce01 \ + --hash=sha256:70293c25d79d1f084fdd665894481547575e429d2a75e8d72caec2f6b6b07af8 \ + --hash=sha256:71f76bb8e59be847330b8a8d3753f85397677e128f9f9692c215f8cf721cefc7 \ + --hash=sha256:725be1aff55f1c873a79cea0f612df9dff21a9d2c2e05783665b824b8aa7c24e \ + --hash=sha256:72d0a731eccf482d5661c6711abfcd5921f3dbfbbb0789061e1918ef4bc89c70 \ + --hash=sha256:7390e060f830b3d132f484b21ac2783a2d227b682ef62bb8146e1c1b4ca0e45a \ + --hash=sha256:73b00645316121105274fd266ed54a20e6514650126d399cdea39876ab1e7b04 \ + --hash=sha256:74e46409666c358b93fce0d8c6f4cb107d8dd7cba1302a38d49adf6fa8193c7e \ + --hash=sha256:75b32cf33ea40f945f226f97bc1d43151e1a5adff21f420b5e63c468b1a28114 \ + --hash=sha256:769e4f7b090e10cae4c082e3e39b9458ec2444505df84953c16c0468b16539c4 \ + --hash=sha256:7849a096d6fdba3f2bdf849eb89f2d233a24400c92faa3efb25fa8dc615b706c \ + --hash=sha256:799c5a23126c9589cb10b6c6b54f9087246940dad20cd74bf3f06fc9ae3bbab5 \ + --hash=sha256:7a7e9321822ca59ba56fa8744c3e3f01ef74d547aafe0d383d000d7a4d11eb79 \ + --hash=sha256:7b23db4b469d9e051ac74d96db9bf61e27c9054de64f8263fefa32bf72867ba1 \ + --hash=sha256:7b4ee34acefa9ba1333f02b817982f1e4127f6f9b975017a707c4e738d7f9fb9 \ + --hash=sha256:829bcaa90be8737c132d9515d6a466e8528e3b3d050d3f3466f36ea94d3beb48 \ + --hash=sha256:8588edf317fbe4f16a949bc5a6ccdd22b6e6fd5b4745d128bc40bccf31024ce5 \ + --hash=sha256:868744c68e9342768888c7326604da2228c19bb6946aa46b5f9e1ac32ea8d40b \ + --hash=sha256:88ba8a439b2bad97bb69c38db5bf0ec16a061ee834cf0f244089186ee803e899 \ + --hash=sha256:8b45d40f07081b377f0b837ddbfba4a9ab4a89a7b569d3c095436564e767a27b \ + --hash=sha256:8c00c5c49f80a588a2c4f99d519d2abed4ce26cdca11273041bc8b7e60af60de \ + --hash=sha256:8c51ac7b31578a7275650f580aac985940985b6d2e57247ac6d5e07f2c936cd6 \ + --hash=sha256:8d148b4b295224d3a19e7bd9f02ebe7344de254b3b2c4d0628ce42ade0bca119 \ + --hash=sha256:8f32a6cb0b101170abc2d8053af1473a2a29ef2a06d7130994ee8455a50f5dbf \ + --hash=sha256:8fd30d217a4275107667fe1d4f601e2d50c797d0727148cfbb384536d65f04d3 \ + --hash=sha256:927d602fb8fb595a69e6b1ae998a6ec19851d0fb9391759456e6425090996647 \ + --hash=sha256:94622cf24e80d03054ceb69a06a86c950e12fe993ed06b933f7895232cacbc3e \ + --hash=sha256:954d43574f72be244b65f0fa61e2f814214b024f2ec849f487aa2f553f7c6e71 \ + --hash=sha256:98f16db5e79f2605194c0f899d0532005bb12269e698bf96f62a5635bcf33010 \ + --hash=sha256:9a4e95d56994a45ac76541853796720436ffe462957d0b1b89e87ff3d3b1627e \ + --hash=sha256:9ae1429ee9e52b139167ed0169757806a27ed7307e942e8c62037a9184e9843b \ + --hash=sha256:9e282f35ece8895b9fa5af406fc6a4cb42f01e1009525cf46641de584781c83b \ + --hash=sha256:9ff89e36451a19775e7556d95ebfa4a0b24b84cc87565d6b5d0ec8ea82bf3f2c \ + --hash=sha256:a0457561e8a87a6a3b509e21c35084d7d207ced262139de3f738e9676a476bbd \ + --hash=sha256:a50bd9b44dd9b7b845802030b4d88610c01c7f95571b4cbd3a1aeec17a34c9fd \ + --hash=sha256:a703f23ca15a51251fc94f1774683f5aa511588a7ad6bbb83960cdb2a4dcd978 \ + --hash=sha256:a920e99155d75d1b1c08172da8aaa7200e7b30871fb628d1631d7891a333e30e \ + --hash=sha256:a9b0026538719f7a532998d84640ab2e91ca1a051ce4b8d924fdcb607307e921 \ + --hash=sha256:ab9e4bd60796866c578e3afa0a17c98636887827a39c2e238a61989c18fd8e7b \ + --hash=sha256:accb5e9492b9bc9c9aeec5b72ea8f2ddcbefc6143d1c626fba960ecbdc89807e \ + --hash=sha256:ad2e9e152bec6c4f7e4cdb4adcea6b708400090eec04bfe5ee5b30d368ffd721 \ + --hash=sha256:adc30e5d064c9e33049e825408fa4e952f4e8a0cf4c329dc2ded72e1bb5bae08 \ + --hash=sha256:b529ad6c81ad21db2f4e3d6e33db78ce3b9f272066b438b5d673361f9282898d \ + --hash=sha256:b6c7f91520c29420639925fd1cecceac9ca07366b50c09ea24eac1cd116b4866 \ + --hash=sha256:b7ea61af293a153f2d67430038cf0efc10140caa623f2bdf5a9f5a457ff20f57 \ + --hash=sha256:b8451f31ae24620cc9372acd2728d87922f2bb0cae3fa57aed68b152844cdf08 \ + --hash=sha256:bbb6bed49f083e2ec8ae0bb21c00c7c5171ab8e08a8b008c61a43fc6c944fdac \ + --hash=sha256:bc581579885728bb54ef15000295c20e6a64a200b1b73d5cfca71879a3eb3e1f \ + --hash=sha256:bcad49104711f88b2b7c3ba166de172857d837248205e541b044a552558fecc3 \ + --hash=sha256:bfc86dff091104eec770c29ea1831dbe191968a70aa2d8ae8eda3240d863970a \ + --hash=sha256:c00f0c45851a2c61efffd03dde8fb4d594026b5cc18196c94e15460f1225f2ed \ + --hash=sha256:c0cc2cb47face4dae64bd70a9268dbebddb3e48c1b48cf6d7b6ac1471609fd88 \ + --hash=sha256:c2db7b9e2d726f7e051bedb67abcf460b84b11437b2f9fdacda7e6931dace85b \ + --hash=sha256:c44776f82b04e623eb9e1b81fcd17ac6e9808ae1ba5cdf8edce1f7c869a95a9b \ + --hash=sha256:c564d1e6531611bf87078c28780456ecc75459dcca189629fff2fe7c020d8e67 \ + --hash=sha256:c568e72f5425a74616daeb824afe28da460cbeea036432f41c6af5380b83300d \ + --hash=sha256:c5e970d3996c597186c9dbb6e77a8048737a834ac03cb13186a54999e0e1c31e \ + --hash=sha256:c634053459278cf31fb404ddb5ecd38124e4609e8b609166da621edc2d5796db \ + --hash=sha256:c63c0d7832956d5f3bb77888b93c854569d13f806289ff75c43926d25c6e5fd2 \ + --hash=sha256:c6bd2c9781915592b209160d0f017d4c7c82ad53075e6b0c24d2a89299e7f9e9 \ + --hash=sha256:c74954409ea5789f7a60daa5f94580c00ad0b60b20751c47b35c4784877b5057 \ + --hash=sha256:c7a56140fcbf4662cb263754a754c651a16fe2196cae1fd232d18f89acd30c83 \ + --hash=sha256:c7b996c02de5e032cb63dc65482b73693b7ecaa586654126be2749ddea239c40 \ + --hash=sha256:c7f66a53e9b7ec831abb15e3d9b6cee8f52d6a24cd0a374786bf46c3ec218bc6 \ + --hash=sha256:c8052c3058c402d53602583da5ddcf1a15a63ab1efe0222f47c7be59944e6463 \ + --hash=sha256:c9f8fdb7bbefc4907c2bb3593f810f2b67a2d5329e1d38724a1aa3d763cf63eb \ + --hash=sha256:cbdf4b42f4514422051889424fd03bc269be8c5d751bf39ec29ad761590bd10d \ + --hash=sha256:cc0cd4065a65ac98f3e2742ee9f314da9d224db49b07dc17d3a20cef0d79658d \ + --hash=sha256:cebad8f4796248b91fc2168515e507e5cb6b663a32befd09f3b1e7920acdcb1a \ + --hash=sha256:cf99debb17227a50620aee16647bb33a0387f5fa5418d628666c0f05745e0d2a \ + --hash=sha256:cfbbba4597f19ad717f79fd3f2a67ae7efae647bd6a61e14554e1b5ad242a5bf \ + --hash=sha256:d0acd8191c0e5a61d1c27bfa33b6ec8431982299f5d71c02129aa4f16f182ad0 \ + --hash=sha256:d0b6a9bd86f865ebc9d847a1eb0a655a0e2b447cbcde743dda97c4298415cc0b \ + --hash=sha256:d0f943b53bb1d7389d72a5380078670e5fcc34a1328142148b72d20fd82031c7 \ + --hash=sha256:d48795c7d64ca1c42e3d61fcc6478cb15a19b6ad3f9c882bc8d8dee49d4a420f \ + --hash=sha256:d8255971f6789cf0cb365e3e22b9b166eba978548a26241eaa5b7af0440d885a \ + --hash=sha256:ddab54dc0ec46ed09ef9ac131252cb5740ed21fbe6fc145f3c6fed0b575a8f15 \ + --hash=sha256:dde9cd67f18803949ebf96de8aba12b8ec5ee3115e34c75a2db85a3b0a6c20d5 \ + --hash=sha256:de29795f23833cdfb68ba45c8a5cc0ec49778ea5deb670188f4465bba5930d25 \ + --hash=sha256:e0feb03a338f8f5e819ae23a73aabb7b46fd3b73f15f7df782dd12d99e2b02ad \ + --hash=sha256:e30550965c78223439815dbdf40c93eb8931dfbf12427110dcfcaeebef76feb6 \ + --hash=sha256:e3e80cad85ba68c07c1e8d4ccc9cf51e63bf6a73d6bf631640be947bd72b6b63 \ + --hash=sha256:e4beaef2f4796558e738e15ca0b8802e35f419a9fa374a978e41706f43c48b26 \ + --hash=sha256:e6d2a185ec4ff0478089305abd833da3a9fda8803eb77325b89ebeae5585a3b7 \ + --hash=sha256:ed7fe197b8bb66eef4f62c052e33752d456d2fdda74805469d4bd954950ab339 \ + --hash=sha256:ee48728a07566c32e097d267f4d4d01b85123c9ae748a42da02185b908cbedc4 \ + --hash=sha256:ee6c4e0085bff5f6621bf9c53452584dcb91ebd993ce841e1f4061ac12b6b556 \ + --hash=sha256:ef03fb4b3685df0ed9dc6a074a090f030345cad2c23c61818da3e08e693a9caa \ + --hash=sha256:f01a680d4b66fd15cc7513fae55c673cc8cc340d41340305b7f9a782abdbefed \ + --hash=sha256:f0494d3d97502e270282cc6a1f8648cd7335b4fe8d5c452006e5b7f9d62b8892 \ + --hash=sha256:f24bed98595b9d854da8d6debaf82754abf3e8fe63ec90505ef560566814df7e \ + --hash=sha256:f42671900e0b602d05a074c52fd3d757c2f8e5c4f73f771794dae1aa4aea5f0e \ + --hash=sha256:f5b1d315a615cec81a79e2ce3a94221dc5c23e7fd4012897085d3b5e5a5638d0 \ + --hash=sha256:f5f06f59e19aa0770aaf651ce91c196fa620b35aed49a7e6c36e7335f3f83db7 \ + --hash=sha256:fcac44d917672ad6257ad64b80b5168306f168a78cab5c0612e4c699caed18cf + # via uvicorn diff --git a/deploy/parakeet/server.py b/deploy/parakeet/server.py index 328204d..5d3ed3e 100644 --- a/deploy/parakeet/server.py +++ b/deploy/parakeet/server.py @@ -30,9 +30,17 @@ and the chunks are transcribed one after another. Audio longer than MAX_AUDIO_S is rejected with 413: this backend is the short-dictation path. -Inference runs in a worker thread, at most MAX_CONCURRENT at a time. Up to -MAX_QUEUE further requests wait; beyond that the server answers 429 with -Retry-After at once instead of queuing without bound. +Admission happens before the upload is read: an ASGI middleware answers 429 +(with Retry-After) when MAX_CONCURRENT + MAX_QUEUE requests are already in +the server, and 413 when the body exceeds MAX_UPLOAD_MB, by Content-Length or +by counting the bytes as they arrive. So at most MAX_CONCURRENT + MAX_QUEUE +uploads are ever spooled to /tmp, each at most MAX_UPLOAD_MB, and the upload +is decoded from that single spool file without a second copy. Inference runs +in a worker thread, at most MAX_CONCURRENT at a time. Decoding and inference +stop with 504 after REQUEST_TIMEOUT_S (checked while decoding and between +chunks). + +Errors use the OpenAI shape: {"error": {"message", "type", "code"}}. Every request writes one JSON log line ("parakeet_request {...}") with sizes, timings and real-time factor. Audio and transcript are never logged. @@ -47,12 +55,12 @@ import math import os import re -import tempfile import time from contextlib import asynccontextmanager import numpy as np from fastapi import FastAPI, File, Form, HTTPException, UploadFile +from fastapi.exceptions import RequestValidationError from fastapi.responses import JSONResponse, PlainTextResponse MODEL_PATH = os.environ.get("MODEL_PATH", "/opt/model") @@ -69,6 +77,7 @@ MAX_CONCURRENT = int(os.environ.get("MAX_CONCURRENT", "1")) MAX_QUEUE = int(os.environ.get("MAX_QUEUE", "4")) RETRY_AFTER_S = os.environ.get("RETRY_AFTER_S", "2") +REQUEST_TIMEOUT_S = float(os.environ.get("REQUEST_TIMEOUT_S", "60")) WARMUP = os.environ.get("PARAKEET_WARMUP", "true").lower() == "true" PORT = int(os.environ.get("PORT", "9000")) @@ -79,18 +88,38 @@ # token timestamps and the end of the last token. FRAME_S = 0.08 FORMATS = {"json", "text", "verbose_json", "srt", "vtt"} +TRANSCRIBE_PATH = "/v1/audio/transcriptions" +# Room for the multipart framing and the small form fields next to the file. +MULTIPART_SLACK = 64 * 1024 SENTENCE_END = re.compile(r"[.!?…]$") _model = None _ready = False _sem: asyncio.Semaphore | None = None -_inflight = 0 # admitted requests: running plus waiting for the semaphore +_inflight = 0 # admitted requests: uploading, waiting or running class AudioTooLong(Exception): pass +class Deadline(Exception): + pass + + +class ApiError(Exception): + """An error answered in the OpenAI error shape.""" + + def __init__(self, status: int, message: str, code: str, headers: dict | None = None): + super().__init__(message) + self.status, self.message, self.code, self.headers = status, message, code, headers + + +def error_body(status: int, message: str, code: str) -> dict: + kind = "server_error" if status >= 500 else ("rate_limit_error" if status == 429 else "invalid_request_error") + return {"error": {"message": message, "type": kind, "code": code}} + + def _load_model(): import onnx_asr import onnxruntime as ort @@ -139,6 +168,106 @@ async def lifespan(app: FastAPI): app = FastAPI(title="parakeet", lifespan=lifespan) +@app.exception_handler(ApiError) +async def _api_error(request, exc: ApiError): + return JSONResponse(error_body(exc.status, exc.message, exc.code), status_code=exc.status, headers=exc.headers) + + +@app.exception_handler(HTTPException) +async def _http_error(request, exc: HTTPException): + return JSONResponse(error_body(exc.status_code, str(exc.detail), "http_error"), status_code=exc.status_code, + headers=getattr(exc, "headers", None)) + + +@app.exception_handler(RequestValidationError) +async def _validation_error(request, exc: RequestValidationError): + return JSONResponse(error_body(400, "invalid request: missing or malformed form fields", "invalid_request"), + status_code=400) + + +class AdmissionMiddleware: + """Admit or reject transcription requests before their body is parsed. + + Starlette spools a multipart upload to disk before the endpoint runs, so + the endpoint is too late to protect /tmp. This middleware counts requests + in the server (429 beyond MAX_CONCURRENT + MAX_QUEUE) and caps the body + (413 by Content-Length, or once the bytes received exceed the limit). + """ + + def __init__(self, app): + self.app = app + + async def __call__(self, scope, receive, send): + global _inflight + if scope["type"] != "http" or scope["method"] != "POST" or scope["path"] != TRANSCRIBE_PATH: + await self.app(scope, receive, send) + return + limit = MAX_UPLOAD_MB * 1024 * 1024 + MULTIPART_SLACK + headers = dict(scope.get("headers") or []) + if _inflight >= MAX_CONCURRENT + MAX_QUEUE: + _log_request(status="error", error="overloaded", http_status=429) + await _send_json(send, 429, error_body(429, "server busy, retry later", "overloaded"), + [(b"retry-after", RETRY_AFTER_S.encode())]) + return + try: + declared = int(headers.get(b"content-length", b"-1")) + except ValueError: + declared = -1 + if declared > limit: + await self._too_large(send, declared) + return + + received = 0 + too_large = False + + async def limited_receive(): + nonlocal received, too_large + if too_large: + return {"type": "http.request", "body": b"", "more_body": False} + message = await receive() + if message["type"] == "http.request": + received += len(message.get("body", b"")) + if received > limit: + too_large = True + return {"type": "http.request", "body": b"", "more_body": False} + return message + + started = False + + async def guarded_send(message): + # Once the body was cut off, whatever the app answers (a parse + # error) is replaced by the 413. + nonlocal started + if too_large: + if not started: + started = True + await self._too_large(send, received) + return + await send(message) + + _inflight += 1 + try: + await self.app(scope, limited_receive, guarded_send) + finally: + _inflight -= 1 + + @staticmethod + async def _too_large(send, size: int): + _log_request(status="error", error="upload_too_large", http_status=413, file_bytes=size) + await _send_json(send, 413, error_body(413, f"file exceeds {MAX_UPLOAD_MB} MB", "upload_too_large")) + + +async def _send_json(send, status: int, body: dict, extra: list | None = None): + data = json.dumps(body).encode() + await send({"type": "http.response.start", "status": status, + "headers": [(b"content-type", b"application/json"), (b"content-length", str(len(data)).encode())] + + (extra or [])}) + await send({"type": "http.response.body", "body": data}) + + +app.add_middleware(AdmissionMiddleware) + + @app.get("/health") async def health(): if _model is None or not _ready: @@ -154,11 +283,12 @@ async def models(): } -def decode(path: str, max_s: float) -> np.ndarray: - """Decode any FFmpeg-readable file to 16 kHz mono float32. +def decode(source, max_s: float, deadline: float | None = None) -> np.ndarray: + """Decode any FFmpeg-readable file (path or file object) to 16 kHz mono float32. Raises AudioTooLong as soon as more than max_s seconds are decoded, so an - over-long upload is not decoded to the end. + over-long upload is not decoded to the end, and Deadline once + time.monotonic() passes deadline. """ import av @@ -166,7 +296,7 @@ def decode(path: str, max_s: float) -> np.ndarray: parts: list[np.ndarray] = [] total = 0 resampler = av.AudioResampler(format="flt", layout="mono", rate=SAMPLE_RATE) - with av.open(path, mode="r") as container: + with av.open(source, mode="r") as container: stream = next((s for s in container.streams if s.type == "audio"), None) if stream is None: raise ValueError("no audio stream") @@ -177,6 +307,8 @@ def decode(path: str, max_s: float) -> np.ndarray: total += out.samples if total > limit: raise AudioTooLong() + if deadline is not None and time.monotonic() > deadline: + raise Deadline() for out in resampler.resample(None): parts.append(out.to_ndarray().reshape(-1)) total += out.samples @@ -265,13 +397,18 @@ def _segment(idx: int, words: list[dict]) -> dict: return seg -def transcribe(audio: np.ndarray) -> tuple[str, list[dict], int]: - """Transcribe decoded audio; returns (text, words, number of chunks).""" +def transcribe(audio: np.ndarray, deadline: float | None = None) -> tuple[str, list[dict], int]: + """Transcribe decoded audio; returns (text, words, number of chunks). + + Raises Deadline before a chunk when time.monotonic() has passed deadline. + """ starts = split_points(audio, CHUNK_S, CHUNK_SEARCH_S) bounds = starts[1:] + [len(audio)] texts: list[str] = [] words: list[dict] = [] for lo, hi in zip(starts, bounds): + if deadline is not None and time.monotonic() > deadline: + raise Deadline() res = _model.recognize(audio[lo:hi]) text = (res.text or "").strip() if text: @@ -293,13 +430,13 @@ def _log_request(**fields): print("parakeet_request " + json.dumps(fields, separators=(",", ":")), flush=True) -def _fail(status: int, detail: str, t_start: float, size: int, error: str, headers: dict | None = None): - _log_request(status="error", error=error, http_status=status, file_bytes=size, +def _fail(status: int, message: str, t_start: float, size: int, code: str, headers: dict | None = None): + _log_request(status="error", error=code, http_status=status, file_bytes=size, total_s=round(time.monotonic() - t_start, 3)) - raise HTTPException(status_code=status, detail=detail, headers=headers) + raise ApiError(status, message, code, headers) -@app.post("/v1/audio/transcriptions") +@app.post(TRANSCRIBE_PATH) async def transcriptions( file: UploadFile = File(...), model: str | None = Form(None), @@ -308,51 +445,42 @@ async def transcriptions( response_format: str = Form("json"), temperature: float | None = Form(None), ): - global _inflight + # The upload is already spooled (and size-checked by AdmissionMiddleware). t_start = time.monotonic() if _model is None or not _ready: - raise HTTPException(status_code=503, detail="model not loaded yet") + _fail(503, "model not loaded yet", t_start, 0, "not_ready") if response_format not in FORMATS: - raise HTTPException(status_code=400, detail=f"response_format must be one of {sorted(FORMATS)}") - if _inflight >= MAX_CONCURRENT + MAX_QUEUE: - _fail(429, "server busy, retry later", t_start, 0, "overloaded", {"Retry-After": RETRY_AFTER_S}) - - _inflight += 1 - try: - limit = MAX_UPLOAD_MB * 1024 * 1024 - size = 0 - with tempfile.NamedTemporaryFile(suffix=os.path.splitext(file.filename or "")[1] or ".audio") as tmp: - while chunk := await file.read(1024 * 1024): - size += len(chunk) - if size > limit: - _fail(413, f"file exceeds {MAX_UPLOAD_MB} MB", t_start, size, "upload_too_large") - tmp.write(chunk) - tmp.flush() - if size == 0: - _fail(400, "empty file", t_start, 0, "empty_file") - - t_queued = time.monotonic() - async with _sem: - t_run = time.monotonic() - try: - audio = await asyncio.to_thread(decode, tmp.name, MAX_AUDIO_S) - except AudioTooLong: - _fail(413, f"audio longer than {MAX_AUDIO_S:g} s; use a long-form transcription model", - t_start, size, "audio_too_long") - except Exception as exc: - _fail(400, "could not decode audio", t_start, size, type(exc).__name__) - t_dec = time.monotonic() - audio_s = len(audio) / SAMPLE_RATE - if audio_s < MIN_AUDIO_S: - _fail(400, "no audio in file", t_start, size, "no_audio") - try: - text, words, chunks = await asyncio.to_thread(transcribe, audio) - except Exception as exc: - _fail(500, "transcription failed", t_start, size, type(exc).__name__) - t_done = time.monotonic() - del audio - finally: - _inflight -= 1 + _fail(400, f"response_format must be one of {sorted(FORMATS)}", t_start, 0, "invalid_response_format") + size = file.size or 0 + if size == 0: + _fail(400, "empty file", t_start, 0, "empty_file") + + async with _sem: + t_run = time.monotonic() + deadline = t_run + REQUEST_TIMEOUT_S + try: + file.file.seek(0) + # Decode straight from the spooled upload: no second copy on disk. + audio = await asyncio.to_thread(decode, file.file, MAX_AUDIO_S, deadline) + except AudioTooLong: + _fail(413, f"audio longer than {MAX_AUDIO_S:g} s; use a long-form transcription model", + t_start, size, "audio_too_long") + except Deadline: + _fail(504, f"decoding took longer than {REQUEST_TIMEOUT_S:g} s", t_start, size, "timeout") + except Exception as exc: + _fail(400, "could not decode audio", t_start, size, "invalid_audio:" + type(exc).__name__) + t_dec = time.monotonic() + audio_s = len(audio) / SAMPLE_RATE + if audio_s < MIN_AUDIO_S: + _fail(400, "no audio in file", t_start, size, "no_audio") + try: + text, words, chunks = await asyncio.to_thread(transcribe, audio, deadline) + except Deadline: + _fail(504, f"transcription took longer than {REQUEST_TIMEOUT_S:g} s", t_start, size, "timeout") + except Exception as exc: + _fail(500, "transcription failed", t_start, size, "inference_error:" + type(exc).__name__) + t_done = time.monotonic() + del audio _log_request( status="ok", @@ -364,8 +492,7 @@ async def transcriptions( audio_s=round(audio_s, 2), chunks=chunks, words=len(words), - upload_s=round(t_queued - t_start, 3), - queue_s=round(t_run - t_queued, 3), + queue_s=round(t_run - t_start, 3), decode_s=round(t_dec - t_run, 3), infer_s=round(t_done - t_dec, 3), total_s=round(time.monotonic() - t_start, 3), diff --git a/deploy/parakeet/tests/test_server.py b/deploy/parakeet/tests/test_server.py index cd30b24..a85f1b7 100644 --- a/deploy/parakeet/tests/test_server.py +++ b/deploy/parakeet/tests/test_server.py @@ -4,10 +4,11 @@ Run: pip install fastapi httpx python-multipart pytest numpy av && pytest deploy/parakeet """ -import asyncio import io import os import sys +import threading +import time import wave from types import SimpleNamespace @@ -30,9 +31,14 @@ class FakeModel: def __init__(self): self.calls = [] + self.gate = None # threading.Event: block recognize() until set + self.delay = 0.0 def recognize(self, audio): self.calls.append(len(audio)) + if self.gate is not None: + self.gate.wait(10) + time.sleep(self.delay) return SimpleNamespace(text=SECRET_TEXT, tokens=TOKENS, timestamps=TIMES, logprobs=LOGPROBS) @@ -71,15 +77,23 @@ def encoded_bytes(container: str, codec: str, seconds: float = 1.0, rate: int = @pytest.fixture def client(monkeypatch): model = FakeModel() - monkeypatch.setattr(server, "_model", model) - monkeypatch.setattr(server, "_ready", True) - monkeypatch.setattr(server, "_sem", asyncio.Semaphore(1)) + monkeypatch.setattr(server, "_load_model", lambda: model) + monkeypatch.setattr(server, "WARMUP", False) monkeypatch.setattr(server, "_inflight", 0) + monkeypatch.setattr(server, "MAX_CONCURRENT", 1) + monkeypatch.setattr(server, "MAX_QUEUE", 1) monkeypatch.setattr(server, "MAX_AUDIO_S", 120.0) monkeypatch.setattr(server, "CHUNK_S", 30.0) - c = TestClient(server.app) - c.model = model - return c + monkeypatch.setattr(server, "REQUEST_TIMEOUT_S", 60.0) + # The context manager runs the lifespan (fake model, semaphore) and keeps + # one event loop for all requests, so concurrent requests really queue. + with TestClient(server.app) as c: + c.model = model + yield c + + +def err(r): + return r.json()["error"] def post(client, payload: bytes, name: str = "a.wav", **data): @@ -136,32 +150,62 @@ def test_srt(client): def test_unknown_format(client): - assert post(client, wav_bytes(1.0), response_format="xml").status_code == 400 + r = post(client, wav_bytes(1.0), response_format="xml") + assert r.status_code == 400 + assert err(r)["code"] == "invalid_response_format" + + +def test_missing_file_field(client): + r = client.post("/v1/audio/transcriptions", data={"model": "x"}) + assert r.status_code == 400 + assert err(r) == {"message": "invalid request: missing or malformed form fields", + "type": "invalid_request_error", "code": "invalid_request"} def test_empty_file(client): r = post(client, b"") assert r.status_code == 400 - assert r.json()["detail"] == "empty file" + assert err(r) == {"message": "empty file", "type": "invalid_request_error", "code": "empty_file"} def test_corrupt_file(client): r = post(client, b"this is not audio at all" * 100) assert r.status_code == 400 - assert r.json()["detail"] == "could not decode audio" + assert err(r)["message"] == "could not decode audio" assert client.model.calls == [] def test_silence_too_short(client): r = post(client, wav_bytes(0.05)) assert r.status_code == 400 - assert r.json()["detail"] == "no audio in file" + assert err(r)["code"] == "no_audio" + + +def test_upload_too_large_by_content_length(client, monkeypatch): + monkeypatch.setattr(server, "MAX_UPLOAD_MB", 1) + r = post(client, b"\0" * (2 * 1024 * 1024)) + assert r.status_code == 413 + assert err(r) == {"message": "file exceeds 1 MB", "type": "invalid_request_error", "code": "upload_too_large"} + assert client.model.calls == [] -def test_upload_too_large(client, monkeypatch): +def test_upload_too_large_without_content_length(client, monkeypatch): + """Chunked upload: the limit is enforced while the bytes arrive.""" monkeypatch.setattr(server, "MAX_UPLOAD_MB", 1) - r = post(client, b"\0" * (1024 * 1024 + 1)) + sent = [] + + def body(): + yield b"--b\r\nContent-Disposition: form-data; name=\"file\"; filename=\"a.wav\"\r\n\r\n" + for _ in range(64): # 4 MiB in 64 KiB pieces + sent.append(1) + yield b"\0" * 65536 + yield b"\r\n--b--\r\n" + + r = client.post("/v1/audio/transcriptions", content=body(), + headers={"Content-Type": "multipart/form-data; boundary=b"}) assert r.status_code == 413 + assert err(r)["code"] == "upload_too_large" + assert client.model.calls == [] def test_audio_too_long(client, monkeypatch): @@ -182,16 +226,49 @@ def test_long_audio_is_chunked(client, monkeypatch): assert r.json()["words"][4]["start"] > 1.4 -def test_overload_returns_429(client, monkeypatch): - monkeypatch.setattr(server, "_inflight", server.MAX_CONCURRENT + server.MAX_QUEUE) - r = post(client, wav_bytes(1.0)) +def test_backpressure_returns_429(client): + """One request runs, one waits (MAX_CONCURRENT 1, MAX_QUEUE 1), the third is rejected.""" + client.model.gate = threading.Event() + payload = wav_bytes(1.0, rate=16000, channels=1) + results = [] + threads = [threading.Thread(target=lambda: results.append(post(client, payload).status_code)) for _ in range(2)] + for t in threads: + t.start() + for _ in range(100): # until both are admitted + if server._inflight == 2: + break + time.sleep(0.02) + assert server._inflight == 2 + r = post(client, payload) assert r.status_code == 429 assert r.headers["Retry-After"] == server.RETRY_AFTER_S + assert err(r)["type"] == "rate_limit_error" + client.model.gate.set() + for t in threads: + t.join(10) + assert sorted(results) == [200, 200] + assert server._inflight == 0 + # Capacity is free again. + assert post(client, payload).status_code == 200 + + +def test_timeout_between_chunks_releases_slot(client, monkeypatch): + monkeypatch.setattr(server, "CHUNK_S", 1.0) + monkeypatch.setattr(server, "CHUNK_SEARCH_S", 0.2) + monkeypatch.setattr(server, "REQUEST_TIMEOUT_S", 0.2) + client.model.delay = 0.3 + r = post(client, wav_bytes(5.0, rate=16000, channels=1)) + assert r.status_code == 504 + assert err(r)["code"] == "timeout" + assert len(client.model.calls) == 1 # stopped after the first chunk + client.model.delay = 0.0 + monkeypatch.setattr(server, "REQUEST_TIMEOUT_S", 60.0) + assert post(client, wav_bytes(1.0)).status_code == 200 def test_health_and_models(client, monkeypatch): assert client.get("/health").json() == {"status": "ok"} - assert client.get("/v1/models").json()["data"][0]["id"] == "parakeet-tdt-0.6b-v3" + assert client.get("/v1/models").json()["data"][0]["id"] == server.MODEL_NAME monkeypatch.setattr(server, "_ready", False) assert client.get("/health").status_code == 503 diff --git a/docs/configuration.md b/docs/configuration.md index 2b0c660..2ca245b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -35,9 +35,10 @@ at startup with a config error. `POST /v1/audio/transcriptions` goes to Parakeet only when Parakeet is enabled and the multipart `model` field names `parakeet-tdt-0.6b-v3` (a provider prefix such as `gateway/parakeet-tdt-0.6b-v3` is accepted). Every other -request, including all translations, goes to Whisper as before. To read the field the router buffers the body up -to the `model` part, so clients should send `model` before `file` (the OpenAI SDKs do); otherwise the whole -upload is buffered, bounded by `ROUTER_MAX_REQUEST_SIZE`. +request, including all translations, goes to Whisper as before. To read the field the router looks at most at the +first 1 MiB of the body and then streams the rest unchanged. Send `model` before `file` (the OpenAI SDKs do): +a `model` field behind a larger file is not seen, and the request goes to Whisper. With Parakeet disabled the +router does not look into the body at all. A value of `0` or below for a `*_MAX_CONCURRENT` variable disables the bound for that backend. diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index c19fbb0..6b91586 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -325,16 +325,23 @@ func (r *Router) stripAdvertisedModel(req *http.Request, b config.Backend) { setBody(body) } -// maxModelField bounds the value read from a multipart "model" field. -const maxModelField = 256 - -// peekFormModel returns the "model" field of a multipart/form-data request -// and leaves the body intact for the proxy. It reads parts until it finds the -// field: when "model" comes before the file (the usual order) only the first -// few hundred bytes are buffered; otherwise the body is buffered up to -// MaxRequestSize. It returns "" for other content types, a missing field or a -// malformed body; the request then goes to the default backend, which reports -// any error itself. +const ( + // maxModelField bounds the value read from a multipart "model" field. + maxModelField = 256 + // peekLimit bounds how much of a transcription body the router reads to + // find the "model" field. A field further in is not seen and the request + // goes to the default backend (Whisper). + peekLimit = 1 << 20 +) + +// peekFormModel returns the first "model" field of a multipart/form-data +// request and leaves the body intact for the proxy. It reads at most +// peekLimit bytes: when "model" comes before the file (the usual order) only +// the first few hundred bytes are held; otherwise at most 1 MiB, after which +// it gives up. The bytes read are replayed in front of the rest of the body, +// which keeps streaming. It returns "" for other content types, a missing or +// late field or a malformed body; the request then goes to the default +// backend, which reports any error itself. func (r *Router) peekFormModel(req *http.Request) string { if req.Body == nil || req.Method != http.MethodPost { return "" @@ -343,13 +350,9 @@ func (r *Router) peekFormModel(req *http.Request) string { if err != nil || mediaType != "multipart/form-data" || params["boundary"] == "" { return "" } - limit := r.cfg.MaxRequestSize - if limit <= 0 { - limit = 100 << 20 - } var consumed bytes.Buffer body := req.Body - mr := multipart.NewReader(io.TeeReader(io.LimitReader(body, limit), &consumed), params["boundary"]) + mr := multipart.NewReader(io.TeeReader(io.LimitReader(body, peekLimit), &consumed), params["boundary"]) model := "" for { part, err := mr.NextPart() @@ -370,7 +373,7 @@ func (r *Router) peekFormModel(req *http.Request) string { } // servesModel reports whether model names one of the backend's models, with -// or without a provider prefix ("layer87/parakeet-tdt-0.6b-v3"). +// or without a provider prefix ("gateway/parakeet-tdt-0.6b-v3"). func servesModel(b config.Backend, model string) bool { if model == "" { return false diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index fa52f06..14c8787 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -760,10 +760,14 @@ func TestRouting_TranscriptionByModel(t *testing.T) { }{ {"parakeet id, model before file", multipartBody([2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "parakeet"}, {"parakeet id, model after file", multipartBody([2]string{"file", audio}, [2]string{"model", "parakeet-tdt-0.6b-v3"}), "parakeet"}, - {"parakeet id with provider prefix", multipartBody([2]string{"model", "layer87/parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "parakeet"}, + {"parakeet id with provider prefix", multipartBody([2]string{"model", "gateway/parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "parakeet"}, {"whisper id", multipartBody([2]string{"model", "whisper-large-v3-turbo"}, [2]string{"file", audio}), "whisper"}, {"no model field", multipartBody([2]string{"file", audio}), "whisper"}, {"unknown model", multipartBody([2]string{"model", "parakeet-tdt-0.6b-v2"}, [2]string{"file", audio}), "whisper"}, + {"first of several model fields wins", multipartBody([2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"model", "whisper-large-v3-turbo"}, [2]string{"file", audio}), "parakeet"}, + {"first of several model fields wins (whisper)", multipartBody([2]string{"model", "whisper-large-v3-turbo"}, [2]string{"model", "parakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "whisper"}, + {"model after a file larger than the peek limit", multipartBody([2]string{"file", strings.Repeat("A", 2<<20)}, [2]string{"model", "parakeet-tdt-0.6b-v3"}), "whisper"}, + {"no model field, large body", multipartBody([2]string{"file", strings.Repeat("A", 3<<20)}), "whisper"}, {"similar suffix is not a match", multipartBody([2]string{"model", "xparakeet-tdt-0.6b-v3"}, [2]string{"file", audio}), "whisper"}, } for _, tc := range cases { diff --git a/scripts/test-chart.sh b/scripts/test-chart.sh index 0b3cbf4..6dd74de 100755 --- a/scripts/test-chart.sh +++ b/scripts/test-chart.sh @@ -20,4 +20,7 @@ grep -q 'app.kubernetes.io/component: router' <<<"$(grep -A30 'kind: NetworkPoli nonp=$(helm template t "$chart" --set parakeet.enabled=true --set parakeet.networkPolicy.enabled=false) grep -q 'kind: NetworkPolicy' <<<"$nonp" && fail "networkpolicy rendered although disabled" +helm template t "$chart" --set parakeet.enabled=true --set parakeet.maxQueue=30 >/dev/null 2>&1 \ + && fail "chart rendered although uploads can exceed the /tmp volume" +grep -q 'sizeLimit: 512Mi' <<<"$on" || fail "tmp volume size not rendered" echo "chart OK"