---
title: "Deploying Speech-to-Speech on Hugging Face"
description: "Hugging Face's Speech-to-Speech pipeline (VAD, speech-to-text, LLM, text-to-speech) can be deployed to Inference Endpoints by forking the huggingface-inference-toolkit into a custom Docker image."
url: "https://swe.quest/articles/deploying-speech-to-speech-on-hugging-face-f49accac75643214"
canonical: "https://huggingface.co/blog/s2s_endpoint"
source: "Hugging Face"
published: "2024-10-22"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["inference","speech-audio","containers","realtime","python"]
---

# Deploying Speech-to-Speech on Hugging Face

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-10-22, 10 min read, How-to. Original: [https://huggingface.co/blog/s2s\_endpoint](https://huggingface.co/blog/s2s_endpoint)

## Summary

Hugging Face's Speech-to-Speech pipeline (VAD, speech-to-text, LLM, text-to-speech) can be deployed to Inference Endpoints by forking the huggingface-inference-toolkit into a custom Docker image. Code and data ship as git submodules and requirements are installed at build time, which cuts endpoint startup time. The endpoint runs on an AWS L4 GPU at about $0.80/hour and is configured through either the GUI or the huggingface\_hub API, with container port 80 and an HF\_TOKEN secret for gated models. A small Starlette WebSocket webservice keeps latency low, and a Python client records audio, streams it to the server and plays back the queued responses.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Speech & audio](https://swe.quest/tags/speech-audio.md) (AI & ML)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Docker basics ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- Python ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- WebSockets ([easy posts on Real-time systems](https://swe.quest/tags/realtime.md?difficulty=easy))

## Keywords

Hugging Face Inference Endpoints, Speech-to-Speech, huggingface-inference-toolkit, Docker, Starlette, Llama 3.1, NVIDIA L4

## Related posts

- [Blazingly fast whisper transcriptions with Inference Endpoints](https://swe.quest/articles/blazingly-fast-whisper-transcriptions-with-inference-endpoints-d93b7d262c3a1210.md): Hugging Face · 2025-05-13 · Easy · 6 min read · Inference & serving, Speech & audio, Performance engineering
  Hugging Face Inference Endpoints now offers a Whisper deployment built on vLLM that delivers up to roughly 8x higher real-time factor (RTFx) than the Transformers implementation, with comparable word error rate.
- [Why we’re switching to Hugging Face Inference Endpoints, and maybe you should too](https://swe.quest/articles/why-we-re-switching-to-hugging-face-inference-endpoints-and-maybe-you-should-too-bfdcddeceab350fa.md): Hugging Face · 2023-02-15 · Medium · 6 min read · Inference & serving, ML platforms, Cost optimization, Cloud platforms
  A team moved CPU-based transformer inference off a self-built FastAPI + Docker + AWS ECS/Fargate stack onto Hugging Face Inference Endpoints, collapsing deployment to train, push to Hub, deploy.
- [Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints](https://swe.quest/articles/powerful-asr-diarization-speculative-decoding-with-hugging-face-inference-ed388c1f3bfe4f4b.md): Hugging Face · 2024-05-01 · Medium · 7 min read · Speech & audio, Inference & serving, Python
  A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint.
- [Deploy MusicGen in no time with Inference Endpoints](https://swe.quest/articles/deploy-musicgen-in-no-time-with-inference-endpoints-bd09aae14ffb65dc.md): Hugging Face · 2023-08-04 · Medium · 4 min read · Inference & serving, Speech & audio, Python, Machine learning
  MusicGen, which has no transformers pipeline, can be served on Hugging Face Inference Endpoints by writing a custom handler.
- [Deploy LLMs with Hugging Face Inference Endpoints](https://swe.quest/articles/deploy-llms-with-hugging-face-inference-endpoints-3facefc244b0efa0.md): Hugging Face · 2023-07-04 · Medium · 6 min read · Inference & serving, LLMs, Python, JavaScript
  Falcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
