Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
docs: add Compose setup for OpenAI API example
zhifu gaoc4deec393c90
diff --git a/examples/openai_api/.env.example b/examples/openai_api/.env.examplenew file mode 100644index 000000000..9d37eec12--- /dev/null+++ b/examples/openai_api/.env.example@@ -0,0 +1,8 @@+# Host port exposed by Docker Compose.+FUNASR_HOST_PORT=8000++# The example Docker image defaults to CPU so the container can start on machines+# without NVIDIA Container Toolkit. Keep CPU mode unless the image has CUDA-capable PyTorch.+FUNASR_DEVICE=cpu+# Set FUNASR_DEVICE=cuda only after using a CUDA-capable PyTorch image.+FUNASR_MODEL=sensevoicediff --git a/examples/openai_api/README.md b/examples/openai_api/README.mdindex ded4a0969..08077f504 100644--- a/examples/openai_api/README.md+++ b/examples/openai_api/README.md@@ -111,6 +111,14 @@ Build the example image from this directory. The default image starts in CPU mod```bashcd examples/openai_api+cp .env.example .env++docker compose up --build+```++Equivalent one-off `docker run` command:++```bashdocker build -t funasr-api .docker run --rm -p 8000:8000 \@@ -119,7 +127,7 @@ docker run --rm -p 8000:8000 \funasr-api```-For GPU hosts, use NVIDIA Container Toolkit and a CUDA-capable PyTorch/FunASR environment, then run the same server with `FUNASR_DEVICE=cuda`:+For GPU hosts, use NVIDIA Container Toolkit and a CUDA-capable PyTorch/FunASR image. After adapting the image dependencies for CUDA, run the same server with `FUNASR_DEVICE=cuda`:```bashdocker run --rm --gpus all -p 8000:8000 \diff --git a/examples/openai_api/docker-compose.yml b/examples/openai_api/docker-compose.ymlnew file mode 100644index 000000000..5e337b79e--- /dev/null+++ b/examples/openai_api/docker-compose.yml@@ -0,0 +1,17 @@+services:+ funasr-api:+ build:+ context: .+ image: funasr-api:local+ ports:+ - "${FUNASR_HOST_PORT:-8000}:8000"+ environment:+ FUNASR_PORT: "8000"+ FUNASR_DEVICE: "${FUNASR_DEVICE:-cpu}"+ FUNASR_MODEL: "${FUNASR_MODEL:-sensevoice}"+ volumes:+ - funasr-cache:/root/.cache+ shm_size: "2gb"++volumes:+ funasr-cache: