Skip to main content

FASR: Fast Automatic Speech Recognition Pipeline

Project description

fasr logo

fasr

fasr is a production-ready Python speech inference framework designed for building composable and extensible speech processing systems.

It is built around AudioPipeline, which lets you freely compose VAD, ASR, punctuation restoration, language identification, and custom components for offline transcription, batch jobs, and online services.

📖 Chinese README: README_ZH.md

Key Features

  • Plugin-based model ecosystem: install model plugins on demand and combine them as needed.
  • Engineering-friendly pipeline: unified data structures and component interfaces for easier maintenance.
  • High-performance inference: asynchronous component execution to better leverage CPU/GPU resources.
  • Production-oriented design: supports batch, streaming, and service deployment patterns.

Pipeline Components

  • loader: loads local/remote audio and builds an Audio object.
  • detector: VAD endpoint detection, splitting audio into speech segments.
  • recognizer: ASR transcription for each detected segment.
  • sentencizer: punctuation restoration and sentence segmentation.
  • identifier: optional language identification (LID) for multilingual use cases.
  • custom: custom components via add_pipe() for additional pre/post-processing.

Quick Start

fasr model capabilities are provided by plugin packages. Install the plugins you need first:

pip install fasr-vad-marblenet fasr-asr-qwen3
import fasr
from fasr import AudioPipeline

# Build pipeline (model weights are downloaded automatically on first run)
asr = (
    AudioPipeline()
    .add_pipe("detector", model="marblenet")
    .add_pipe("recognizer", model="qwen3_0_6b")
)

# Single-audio inference
audio = asr("example.wav")
for channel in audio.channels:
    print(channel.text)

# Batch inference
audios = asr.run(["1.wav", "2.wav", "3.wav"])
for audio in audios:
    for channel in audio.channels:
        print(channel.text)

# Streaming output for large batches (yield one by one)
for audio in asr.stream(["1.wav", "2.wav", "3.wav"]):
    for channel in audio.channels:
        print(channel.text)

Model Plugins

Install task-specific plugins and compose your own pipeline:

Task Plugin package Typical model IDs
VAD fasr-vad-marblenet / fasr-vad-fsmn / fasr-vad-firered marblenet / fsmn / firered
ASR fasr-asr-qwen3 / fasr-asr-paraformer / fasr-asr-firered / fasr-asr-fun qwen3_0_6b / paraformer / firered_aed / fun_asr_nano
Punc fasr-punc-ct-transformer ct_transformer
LID fasr-lid-firered firered

How to Build a Model Plugin

The plugin mechanism is based on catalogue

  • Python entry points, with install-time registration and lazy loading at runtime.
  1. Inherit the task base class and register with registry:
# my_fasr_vad/models/vad.py
from fasr.config import registry
from fasr.data import AudioSpan
from fasr.model import VADModel


@registry.vad_models.register("my_vad")
class MyVADModel(VADModel):
    def load_checkpoint(self, checkpoint_dir=None): ...
    def detect(self, audio: AudioSpan): ...

VADModel now mirrors ASRModel: a single base class can expose offline VAD via detect() and streaming VAD via push_chunk(). A streaming-capable model may therefore implement:

from typing import Iterable

from fasr.data import AudioChunk


def push_chunk(self, chunk: AudioChunk) -> Iterable[AudioChunk]:
    ...

The streaming path emits VAD events (segment_start / segment_mid / segment_end) as AudioChunk objects so downstream streaming ASR can start, continue, and flush recognition at the correct boundaries.

  1. Declare the entry point in pyproject.toml. Use underscore-style group names that match catalogue namespaces:
[project.entry-points."fasr_vad_models"]
my_vad = "my_fasr_vad.models.vad:MyVADModel"

Task to entry point group mapping:

Task Entry point group
ASR fasr_asr_models
Streaming ASR fasr_stream_asr_models
VAD fasr_vad_models
Streaming VAD fasr_stream_vad_models
Punc fasr_punc_models
LID fasr_lid_models

Do not use dot-style groups such as fasr.vad_models. catalogue resolves entry points by underscore naming, and dot-style names will not be discovered by registry.resolve(cfg). fasr_stream_vad_models is still kept as a compatibility entry point for streaming-only VAD plugins, but the runtime interface is unified on VADModel.push_chunk(...). If a registration name contains dots (for example stream_fsmn.onnx), quote it in TOML: "stream_fsmn.onnx" = "...".

  1. Install your plugin package (pip install -e . or uv pip install -e .). Then @vad_models = "my_vad" in config will be discovered automatically by fasr.load(cfg) without manual imports. Heavy dependencies from other plugins (for example torch, vllm) are not loaded unless those plugins are selected.

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

fasr-0.5.1.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

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

fasr-0.5.1-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file fasr-0.5.1.tar.gz.

File metadata

  • Download URL: fasr-0.5.1.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr-0.5.1.tar.gz
Algorithm Hash digest
SHA256 5ca89d15e36d1d493609c8a42d24c704b359162590c0eebb3bc24711c513ef7c
MD5 a50d5f98b7dc35a3a50d584073ecfcbc
BLAKE2b-256 f231ff1fa7135f8811b2c945e0262902a2fe9cd21a223454f5637687e4134405

See more details on using hashes here.

File details

Details for the file fasr-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: fasr-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c335c90ef276df4c12239e389980a29c50203fc2b7308b48411d22646882512a
MD5 d959b124f6979dfaea55fd7618f49161
BLAKE2b-256 cde2114eed261e22adacd3eec5d3c5138a6badb7a24a6a08e7c5428d03e1f33c

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