feat: implement full-platform STT API (v2.3 consensus plan)
Batch+realtime transcription API: faster-whisper engine w/ EngineOwner (single GPU owner, OOM downgrade chain, persisted attempted_profiles), hardware-adaptive device manager (T0-T3 VRAM tiers), Redis/in-proc job queue w/ leases + crash recovery, postprocess (glossary/rules/LLM w/ egress guard), privacy-first result store (UUID keys, source deleted after transcribe), retention sweeper, API-key auth (HMAC digests, scopes, job ownership), WebSocket realtime lane (LocalAgreement), CLI (detect/transcribe/bench/serve/key), Docker, benchmark runner. 127 mock-based tests pass; ruff clean. Includes verification checklist and autoplan review notes.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# luke_scribe CPU 이미지
|
||||
FROM python:3.12-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml README.md ./
|
||||
COPY src/ ./src/
|
||||
|
||||
RUN pip install --no-cache-dir -e ".[engine,api]" \
|
||||
&& pip install --no-cache-dir "faster-whisper>=1.0.3"
|
||||
|
||||
ENV LUKESCRIBE_DEVICE=cpu \
|
||||
LUKESCRIBE_QUEUE_BACKEND=redis \
|
||||
LUKESCRIBE_HOST=0.0.0.0 \
|
||||
LUKESCRIBE_PORT=8000
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["python", "-m", "luke_scribe.cli", "serve"]
|
||||
@@ -0,0 +1,26 @@
|
||||
# luke_scribe GPU 이미지 — CUDA 12 + cuDNN 9 + faster-whisper
|
||||
# 기준: NVIDIA CUDA 12 런타임, cc>=7.0 GPU (T4 이상 권장)
|
||||
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
python3.11 python3-pip python3-venv ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml README.md ./
|
||||
COPY src/ ./src/
|
||||
|
||||
RUN python3.11 -m venv /opt/venv \
|
||||
&& . /opt/venv/bin/activate \
|
||||
&& pip install --no-cache-dir -e ".[engine,gpu,api]" \
|
||||
&& pip install --no-cache-dir "faster-whisper>=1.0.3"
|
||||
|
||||
ENV PATH="/opt/venv/bin:$PATH" \
|
||||
LUKESCRIBE_DEVICE=auto \
|
||||
LUKESCRIBE_QUEUE_BACKEND=redis \
|
||||
LUKESCRIBE_HOST=0.0.0.0 \
|
||||
LUKESCRIBE_PORT=8000 \
|
||||
NVIDIA_VISIBLE_DEVICES=all
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["python", "-m", "luke_scribe.cli", "serve"]
|
||||
@@ -0,0 +1,70 @@
|
||||
# luke_scribe 프로덕션 compose — API + Redis + 워커 + 공유 스토어
|
||||
# 사용법: docker compose --profile gpu up -d (또는 --profile cpu)
|
||||
services:
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
api:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.cpu
|
||||
profiles: ["cpu"]
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
LUKESCRIBE_QUEUE_BACKEND: redis
|
||||
LUKESCRIBE_REDIS_URL: redis://redis:6379/0
|
||||
LUKESCRIBE_API_KEYS: ${LUKESCRIBE_API_KEYS:?API 키 필요}
|
||||
volumes:
|
||||
- luke-store:/data/luke-scribe
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
api-gpu:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.gpu
|
||||
profiles: ["gpu"]
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
LUKESCRIBE_QUEUE_BACKEND: redis
|
||||
LUKESCRIBE_REDIS_URL: redis://redis:6379/0
|
||||
LUKESCRIBE_API_KEYS: ${LUKESCRIBE_API_KEYS:?API 키 필요}
|
||||
volumes:
|
||||
- luke-store:/data/luke-scribe
|
||||
ports:
|
||||
- "8000:8000"
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [gpu]
|
||||
|
||||
worker:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.cpu
|
||||
profiles: ["cpu"]
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
LUKESCRIBE_QUEUE_BACKEND: redis
|
||||
LUKESCRIBE_REDIS_URL: redis://redis:6379/0
|
||||
command: ["python", "-m", "luke_scribe.cli", "serve"]
|
||||
volumes:
|
||||
- luke-store:/data/luke-scribe
|
||||
|
||||
volumes:
|
||||
luke-store:
|
||||
Reference in New Issue
Block a user