Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Echo

An audio transcription API powered by Faster Whisper and Starlette.


📖 About

Echo is a lightweight, asynchronous API service designed for fast and efficient audio transcription. Built on top of Starlette and Faster Whisper, it provides a simple interface to transcribe audio files into text with high accuracy.

✨ Features

  • Fast Transcription: Utilizes CTranslate2-powered Whisper models for up to 4x faster inference than original OpenAI Whisper.
  • Async API: Built with Starlette for high-performance, asynchronous request handling.
  • Configurable: Easily switch model sizes (tiny, base, small, medium, large-v2, etc.) and compute types via environment variables.
  • Docker Ready: Includes a Dockerfile for easy containerization and deployment.
  • Detailed Output: Returns full transcripts along with segment-level timestamps and language detection probabilities.

🚀 Getting Started

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip

Installation

  1. Clone the repository:

    git clone https://github.com/benpoppy/echo.git
    cd echo
  2. Install dependencies:

    uv sync
    # OR using pip
    pip install .

Running Locally

Start the server using Uvicorn:

uvicorn main:app --host 0.0.0.0 --port 8000

The server will start at http://localhost:8000.

Running with Docker

Build and run the container:

docker build -t echo .
docker run -p 8000:8000 echo

⚙️ Configuration

You can configure the service using the following environment variables:

Variable Default Description
MODEL_SIZE tiny.en The Whisper model size to use (e.g., tiny, base, small, medium, large-v2).
DEVICE cpu Device to run inference on (cpu or cuda).
COMPUTE_TYPE int8 Quantization type (int8, float16, int8_float16).
BEAM_SIZE 5 Beam size for decoding.

🔌 API Reference

Health Check

Request: GET /health

Response:

ok

Transcribe Audio

Request: POST /transcribe

  • Content-Type: multipart/form-data
  • Body:
    • file: The audio file to transcribe.

Example using cURL:

curl -X POST -F "file=@/path/to/audio.mp3" http://localhost:8000/transcribe

Response:

{
  "language": "en",
  "language_probability": 0.98,
  "transcript": "Hello world, this is a test transcription.",
  "segments": [
    {
      "start": 0.0,
      "end": 2.5,
      "text": "Hello world, this is a test transcription."
    }
  ]
}

👏 Credits

This project relies heavily on these amazing open-source projects:

  • Faster Whisper - Faster Whisper transcription with CTranslate2.
  • Starlette - The little ASGI framework that shines.

About

A lightweight, async audio transcription API powered by Faster Whisper and Starlette.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages