cstr/CrispASR
0
1---2title: CrispASR3sdk: docker4app_port: 78605pinned: false6---7 8# CrispASR Space9 10Gradio wrapper around the [CrispASR](https://github.com/CrispStrobe/CrispASR)11HTTP server, packaged for Hugging Face Docker Spaces. One container runs the12C++ inference engine on `:8080` and the Gradio UI on `:7860`.13 14## What's exposed15 16| Tab | Backend(s) | Endpoint hit | Approx. footprint |17|---|---|---|---|18| **Transcribe (ASR)** | whisper, parakeet, moonshine, moonshine-de, wav2vec2 (EN+DE), parakeet-ctc-0.6b, cohere, qwen3 | `POST /v1/audio/transcriptions` | 37 MB – 550 MB per model |19| **Speak (TTS)** | kokoro (82M, multilingual) | `POST /v1/audio/speech`, `GET /v1/voices` | ~85 MB |20| **Detect language (text)** | CLD3, GlotLID-V3, LID-176 | `crispasr-lid` subprocess | 440 KB – 250 MB |21| **About & backends** | static capability table | `GET /backends` + `/health` | — |22 23Models hot-swap through `POST /load` — only one model is resident at a time,24so switching backends triggers a download (first use) and a load (every use).25The first cold download for each backend lives in `/cache`.26 27The larger speech-LLM backends in CrispASR (Voxtral 2.5 GB, MiMo-ASR 4.5 GB,28Granite-4.1 3 GB, omniasr-llm) are deliberately omitted from this demo —29they exceed the free-tier (16 GB) RAM ceiling once Gradio + Python + KV30cache overhead is accounted for. To run them, build the image locally.31 32## Environment variables33 34- `CRISPASR_MODEL=/models/model.gguf` (overridden by `/load` requests)35- `CRISPASR_BACKEND=whisper` (initial backend; UI swaps later)36- `CRISPASR_LANGUAGE=auto` (default language for transcription)37- `CRISPASR_AUTO_DOWNLOAD=1` (1 → resolve `-m auto` from the registry)38- `CRISPASR_CACHE_DIR=/cache` (auto-download landing zone)39- `CRISPASR_SAMPLES_DIR=/space/samples` (bundled `jfk.wav` etc.)40- `CRISPASR_API_KEYS=` (optional comma-separated keys; protects every `/v1/*`)41- `CRISPASR_EXTRA_ARGS=` (extra CLI flags forwarded verbatim, e.g. `--vad --punc-model auto`)42 43## Local build / run44 45```bash46docker build -f hf-space/Dockerfile -t crispasr-hf-space .47 48docker run --rm -p 7860:7860 -p 8080:8080 \49 -e CRISPASR_BACKEND=whisper \50 -e CRISPASR_AUTO_DOWNLOAD=1 \51 crispasr-hf-space52```53 54Persist the model cache between runs:55 56```bash57docker volume create crispasr-cache58docker run --rm -p 7860:7860 -p 8080:8080 \59 -e CRISPASR_AUTO_DOWNLOAD=1 \60 -v crispasr-cache:/cache \61 crispasr-hf-space62```63 64Adjust build parallelism with `--build-arg CRISPASR_BUILD_JOBS=8`.65The Dockerfile compiles two binaries from the CrispASR repo: `crispasr`66(server + ASR/TTS) and `crispasr-lid` (text language ID).67 68## Workflow notes69 70- **First transcription** of a chosen backend triggers an HF download into71 `/cache`. Whisper-base (~147 MB) and Moonshine-tiny (~37 MB) feel72 instant; Cohere (~550 MB) and Qwen3-ASR (~500 MB) take a minute.73- **Swap order matters**. Loading a TTS backend evicts the ASR backend and74 vice versa. Use the Transcribe tab's *Load model* button to swap back.75- **Voices**: Kokoro's built-in voicepacks (`af_heart`, `af_bella`,76 `am_michael`, `df_victoria`, …) are baked into the auto-downloaded GGUF.77 Drop extra `*.gguf` / `*.wav` files into `$VOICE_DIR` if you want78 `GET /v1/voices` to list them; the Space doesn't ship a voice dir by79 default.80- **Long audio**: enable VAD chunking with `CRISPASR_EXTRA_ARGS=--vad` so81 every backend processes minute-long files without truncation.82- **Word timestamps** on LLM-style backends (qwen3, cohere) need an83 external CTC aligner — outside the scope of this free-tier demo, see84 `docs/cli.md` in the main repo.85 