Skip to main content

High-level ASR wrapper for MERaLiON-3-3B-ASR with transformers and vLLM backends.

Project description

MERaLiON-3-ASR

A high-level ASR wrapper around MERaLiON/MERaLiON-3-3B-ASR.

The package wraps the model with a vLLM backend and pre-wires the transcription prompt, decoding configuration, and 30 s audio chunking on both the offline path and the served path. Callers only provide audio.

Install

pip install "meralion-3-asr[vllm] @ git+https://github.com/YingxuH/MERaLiON-3-ASR.git"

Requires Python 3.10+ and a CUDA GPU. The [vllm] extra installs vLLM and the FastAPI sidecar dependencies. A transformers-only backend is included for debugging and is currently experimental; vLLM is the only fully supported backend.

Quick start

from meralion_3_asr import Meralion3ASR

model = Meralion3ASR.from_pretrained("MERaLiON/MERaLiON-3-3B-ASR", backend="vllm")

text = model.transcribe("audio.wav")                          # str
texts = model.transcribe_batch(["a.wav", "b.wav", "c.wav"])   # List[str]

Inputs may be local file paths, https:// URLs, base64 data URLs, or (numpy_array, sample_rate) tuples. Audio is automatically resampled to mono 16 kHz; long audio is split into 30 s non-overlapping chunks and the per-chunk transcripts are concatenated.

Serving (OpenAI-compatible HTTP)

meralion-3-asr serve starts a FastAPI sidecar in front of a private vllm serve process and exposes a single OpenAI-compatible route, POST /v1/audio/transcriptions.

meralion-3-asr serve --model MERaLiON/MERaLiON-3-3B-ASR --port 8000

Common flags:

Flag Default Description
--model MERaLiON/MERaLiON-3-3B-ASR HF repo id or local path.
--host 0.0.0.0 Sidecar bind host.
--port 8000 Sidecar (user-facing) port.
--tensor-parallel-size 1 Number of GPUs for the internal vLLM.

Any unknown --key value pairs are forwarded to the internal vllm serve.

Call it with the OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
with open("audio.wav", "rb") as f:
    resp = client.audio.transcriptions.create(
        model="MERaLiON/MERaLiON-3-3B-ASR",
        file=f,
    )
print(resp.text)

or raw HTTP:

curl -F file=@audio.wav -F model=MERaLiON/MERaLiON-3-3B-ASR \
    http://localhost:8000/v1/audio/transcriptions

Development

pip install -e ".[dev,vllm]"
pytest -q

License

MERaLiON-Public-Licence-v3

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

meralion_3_asr-0.0.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

meralion_3_asr-0.0.1-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file meralion_3_asr-0.0.1.tar.gz.

File metadata

  • Download URL: meralion_3_asr-0.0.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meralion_3_asr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 29b1a28ada41cc617877da0b650bb39d9d1c73686d0e9ec1ceba7f453fa344a2
MD5 eae9713d2e943fc67d69548af9a520a2
BLAKE2b-256 fa1f14a100cb90aa76cdcbe3cc5865a6adf4a45b5417a4241e594ce2e0196a4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for meralion_3_asr-0.0.1.tar.gz:

Publisher: publish.yml on YingxuH/MERaLiON-3-ASR

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meralion_3_asr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: meralion_3_asr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meralion_3_asr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2264362c57acac873ec2c5dd3b7b594fd63dc98dc894102077dbfe6a88b8e91
MD5 285d6b6478a30c3f8786f219625dc8e8
BLAKE2b-256 a61068ca5c22d8a7b43b7025781a2927fd68b7eb63c3670cdec533d7b7bb7005

See more details on using hashes here.

Provenance

The following attestation bundles were made for meralion_3_asr-0.0.1-py3-none-any.whl:

Publisher: publish.yml on YingxuH/MERaLiON-3-ASR

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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