Skip to main content

REST API for audio transcription using parakeet-mlx

Project description

Paratran

REST API for audio transcription on Apple Silicon, powered by parakeet-mlx.

Parakeet is #1 on the Open ASR Leaderboard and runs ~30x faster than Whisper on Apple Silicon via MLX.

Requirements

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Python 3.11+
  • ~2 GB memory for the default model

Quick Start

git clone https://github.com/briansunter/paratran.git
cd paratran
./run.sh

This creates a virtual environment, installs dependencies, downloads the model, and starts the server at http://localhost:8000.

Install

pip install paratran
paratran

Or from source:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .
paratran

Usage

# Default settings
paratran

# Custom model cache location
paratran --model-dir /Volumes/Storage/models

# Custom host and port
paratran --host 127.0.0.1 --port 9000

# Different model
paratran --model mlx-community/parakeet-tdt-1.1b-v2

All options can also be set via environment variables:

CLI Flag Env Var Default
--model PARATRAN_MODEL mlx-community/parakeet-tdt-0.6b-v3
--model-dir PARATRAN_MODEL_DIR HuggingFace default (~/.cache/huggingface)
--host 0.0.0.0
--port 8000

API

GET /health

curl http://localhost:8000/health
{
  "status": "ok",
  "model": "mlx-community/parakeet-tdt-0.6b-v3",
  "model_dir": "/Volumes/Storage/models"
}

POST /transcribe

Upload an audio file (wav, mp3, flac, m4a, ogg, webm):

curl -X POST http://localhost:8000/transcribe -F "file=@recording.m4a"
{
  "text": "Hello world, this is a test.",
  "duration": 3.52,
  "processing_time": 0.176,
  "sentences": [
    {
      "text": "Hello world, this is a test.",
      "start": 0.0,
      "end": 3.52,
      "tokens": [
        { "text": "Hello", "start": 0.0, "end": 0.48 },
        { "text": " world", "start": 0.48, "end": 0.8 }
      ]
    }
  ]
}

Interactive API docs are available at http://localhost:8000/docs.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paratran-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paratran-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file paratran-0.1.0.tar.gz.

File metadata

  • Download URL: paratran-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for paratran-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dee570fce48023ef996794ba65eec7c3aa16469d6c25443c7a544e5627161cce
MD5 b54985f3649fab8821760438fb9b189a
BLAKE2b-256 615dc073cc18b2feae17b32ad05e36c816454156112feb5b00e1e6f5199e52f8

See more details on using hashes here.

File details

Details for the file paratran-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: paratran-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for paratran-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 088c00fa1c6adc0ab892d455ac16a1d87f9e5d7ecbf1f885d39d9a9e09088747
MD5 413726a98a92ea09cc96fa1616ba9d57
BLAKE2b-256 8d17449fafa8b6facd1c593784d1e7d3ab7ee0b1ba6523c612afbd7a89d684a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page