Spaces:
Runtime error
Runtime error
Peter Michael Gits Claude commited on
Commit Β·
16b78bc
1
Parent(s): 03b8c7c
Initial commit: STT GPU Service Python v4 with WebSocket streaming
Browse files- FastAPI app with WebSocket streaming at /ws/stream for 80ms chunks
- REST API at /transcribe for testing
- Pre-cached kyutai/stt-1b-en_fr model in Docker
- T4 Small GPU configuration with 30min auto-sleep
- Real-time STT processing faster than real-time
- Max 2 concurrent WebSocket connections
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- LinkedInPost-1.md +57 -0
LinkedInPost-1.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ποΈ Real-Time Speech-to-Text Service with Kyutai Moshi
|
| 2 |
+
|
| 3 |
+
Just built a production-ready STT service using Kyutai's Moshi model for ultra-low latency speech recognition!
|
| 4 |
+
|
| 5 |
+
## System Architecture
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 9 |
+
β stt-gpu-service-python-v4 β
|
| 10 |
+
β (Nvidia T4 Small) β
|
| 11 |
+
β β
|
| 12 |
+
β βββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
|
| 13 |
+
β β Moshi Model β β API Interfaces β β
|
| 14 |
+
β β kyutai/stt-1b β β β β
|
| 15 |
+
β β (Cached) β β π WebSocket /ws/stream β β
|
| 16 |
+
β β β β β 80ms audio chunks β β
|
| 17 |
+
β β β’ 0.5s delay ββββββ€ β Real-time transcription β β
|
| 18 |
+
β β β’ EN/FR β β β β
|
| 19 |
+
β β β’ 1B params β β π‘ REST /transcribe β β
|
| 20 |
+
β β β β β Audio file upload β β
|
| 21 |
+
β βββββββββββββββββββ β β JSON transcription β β
|
| 22 |
+
β β β β
|
| 23 |
+
β β π GET /health β β
|
| 24 |
+
β β β Service status check β β
|
| 25 |
+
β βββββββββββββββββββββββββββββββββββ β
|
| 26 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 27 |
+
β
|
| 28 |
+
ββββββββββββββββΌβββββββββββββββ
|
| 29 |
+
β β β
|
| 30 |
+
βββββββββΌββββββ βββββββΌββββββ βββββββΌββββββ
|
| 31 |
+
β Client 1 β β Client 2 β β Test β
|
| 32 |
+
β (Streaming) β β(Streaming)β β (Upload) β
|
| 33 |
+
βββββββββββββββ βββββββββββββ βββββββββββββ
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## API Interface Details
|
| 37 |
+
|
| 38 |
+
### π **WebSocket Streaming** `/ws/stream`
|
| 39 |
+
Primary interface for real-time speech recognition with 80ms audio chunks. Achieves ~200ms end-to-end latency with bidirectional communication for live conversations.
|
| 40 |
+
|
| 41 |
+
### π‘ **REST Upload** `/transcribe`
|
| 42 |
+
Secondary testing endpoint for complete audio file processing. Simple POST request with audio file returns full transcription with word-level timestamps.
|
| 43 |
+
|
| 44 |
+
### π **Health Check** `/health`
|
| 45 |
+
Basic service monitoring endpoint for deployment status verification. Returns model readiness and GPU resource availability.
|
| 46 |
+
|
| 47 |
+
## Technical Highlights
|
| 48 |
+
|
| 49 |
+
- **Ultra-Low Latency**: 80ms frame processing with Moshi's native streaming
|
| 50 |
+
- **Model Optimization**: Pre-cached in Docker image for instant startup
|
| 51 |
+
- **Cost Efficient**: T4 Small GPU with 30-minute auto-sleep
|
| 52 |
+
- **Production Ready**: Supports 2 concurrent streaming connections
|
| 53 |
+
- **Multi-Language**: English and French recognition support
|
| 54 |
+
|
| 55 |
+
Perfect for real-time voice applications, live transcription services, and conversational AI systems!
|
| 56 |
+
|
| 57 |
+
#AI #SpeechRecognition #RealTime #MachineLearning #HuggingFace #Python #Docker
|