Skip to main content

MERaLiON-3-ASR

CodeQL Security (Bandit) Dependency Audit Pylint OpenSSF Scorecard

These checks run on every push: CodeQL static analysis, Bandit security SAST, pip-audit dependency CVE scanning, and Pylint; plus OpenSSF Scorecard supply-chain analysis.

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

Requires Python 3.10+ and a CUDA GPU. vLLM and the FastAPI sidecar dependencies are installed automatically. vLLM is the recommended backend. A pure transformers backend is also available (see Transformers backend below).

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.

Transformers backend

vLLM is the recommended backend. A pure transformers backend is also available — it loads the model in-process with AutoModelForSpeechSeq2Seq, which is handy for debugging or environments without vLLM:

from meralion_3_asr import Meralion3ASR

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

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

The same prompt, decoding configuration, and 30 s chunking are applied on both backends. See docs/backends.md for a vLLM-vs-transformers comparison.

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]"
pytest -q

License

MERaLiON-3-Public-Licence

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.1.0.tar.gz (32.9 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.1.0-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: meralion_3_asr-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 1871733b5aa7eeed00abc3ad7228088a29f39b5737a0b57074a5f08429b32b58
MD5 b1d0ff1bf2d7258c8df5a902f7852438
BLAKE2b-256 f884420f0802488f81fface91c5ced6843b12f9109f48c86877d798d1acb1a19

See more details on using hashes here.

Provenance

The following attestation bundles were made for meralion_3_asr-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: meralion_3_asr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 939911f3d5856a307adf723d042eac21842afc40a008e94e5f74245af5455b9a
MD5 d5dcceeb984cef490c5c391720cc5e6c
BLAKE2b-256 68664d87805c2048191b4e1b0ae86fa1a88294405423e107122623850b24e920

See more details on using hashes here.

Provenance

The following attestation bundles were made for meralion_3_asr-0.1.0-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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

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