pyctcdecode
CTC beam search decoder for speech recognition.
Decision gist · record as of 2026-08-14
Yes, if you have an existing CTC-based speech model and need to integrate a language model or extract frame-level timing. The low install friction and permissive license make it straightforward to add. However, be aware the package is abandoned—no updates since early 2023—so use it only in stable production contexts where you can maintain it yourself if needed. For new projects, verify whether active alternatives exist.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a kenlm language model file (.arpa or .bin) for best results; decoding works without one but will be less accurate.
- Hyperparameters (alpha, beta, beam width) strongly influence error rate and runtime and require tuning on your data.
- Low install friction with a pure-Python wheel and minimal runtime dependencies.
License · maintenance · safety
permissive license (permissive) — Apache License 2.0 (permissive) allows commercial and derivative use with attribution and liability disclaimers. No restrictions on modification or redistribution.
last release 2023-01-20 (1302 days) · last repo commit 2023-07-13 · 468 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 143,734 downloads/mo, #11,168 on PyPI
Alternatives
Verify before relying
pip install pyctcdecode
from pyctcdecode import build_ctcdecoder
labels = [" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
decoder = build_ctcdecoder(labels, kenlm_model_path="model.arpa", alpha=0.5, beta=1.0)
text = decoder.decode(logits)- Whether kenlm is an optional or required dependency (not listed in runtime deps but featured prominently in examples)
- Performance comparison details with C++ decoders at different beam widths mentioned in description
- Compatibility with models beyond Conformer-CTC and Wav2Vec2 (tutorials mention these but generality is unclear)
What it is and what it does
pyctcdecode is a Python-based CTC beam search decoder for converting raw logits from speech recognition models into text. It implements shallow fusion with n-gram language models (via kenlm), allowing you to improve transcription accuracy by integrating domain-specific language constraints during decoding rather than retraining the model. The package handles both standard character-based and byte-pair-encoded (BPE) vocabularies automatically, and supports features like hotword boosting (promoting specific phrases during inference) and real-time stateful decoding for streaming applications.
The decoder is designed as a middle ground between C++ performance and Python flexibility. It includes batch processing via multiprocessing, returns detailed beam search results with frame-level timing information, and integrates with pretrained models from Nvidia NeMo and Hugging Face Wav2Vec2. Runtime is comparable to C++ implementations at beam widths of 10 or greater. However, the package is no longer maintained—the last release was in January 2023 and the repository shows no commits since July 2023.
Use it for
- Improve accuracy of Conformer-CTC or Wav2Vec2 models by integrating a domain-specific language model during inference without retraining.
- Boost recognition of important domain terms (product names, technical jargon) by adding hotwords during decoding.
- Extract word-level timing and confidence scores from CTC models natively through the decoding process.
- Process speech recognition logits in batch with multiprocessing for production inference pipelines.
- Decode byte-pair-encoded vocabularies automatically without manual token merging logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you have an existing CTC-based speech model and need to integrate a language model or extract frame-level timing.
The low install friction and permissive license make it straightforward to add. However, be aware the package is abandoned—no updates since early 2023—so use it only in stable production contexts where you can maintain it yourself if needed. For new projects, verify whether active alternatives exist.
Install
pyctcdecode on PyPI
Before you install
Low install friction with a pure-Python wheel and minimal runtime dependencies. However, the package is abandoned—last release was 2023-01-20 and the last commit 2023-07-13—so expect no bug fixes or maintenance going forward.
Requires a kenlm language model file (.arpa or .bin) for best results; decoding works without one but will be less accurate. Hyperparameters (alpha, beta, beam width) strongly influence error rate and runtime and require tuning on your data.
License in practice
Apache License 2.0 (permissive) allows commercial and derivative use with attribution and liability disclaimers. No restrictions on modification or redistribution.
Quickstart
pip install pyctcdecode
from pyctcdecode import build_ctcdecoder
labels = [" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
decoder = build_ctcdecoder(labels, kenlm_model_path="model.arpa", alpha=0.5, beta=1.0)
text = decoder.decode(logits)
Verify before relying
- Whether kenlm is an optional or required dependency (not listed in runtime deps but featured prominently in examples)
- Performance comparison details with C++ decoders at different beam widths mentioned in description
- Compatibility with models beyond Conformer-CTC and Wav2Vec2 (tutorials mention these but generality is unclear)
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesnumpypygtriehypothesisimportlib-metadata |
| Maintenance | Abandoned 1,302 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 143,734 / month, #11,168 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: pyctcdecode-0.5.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ctc beam search decoder”
- pyctcdecodeDecodes CTC (Connectionist Temporal Classification) logits from…
- beam-nuggetsProvides Apache Beam transforms for reading and writing relational…
- apache-airflow-providers-apache-beamIntegrates Apache Beam data processing pipelines into Apache Airflow…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also speechbrain · nemo-toolkit · cut-cross-entropy · nemo-text-processing · torchcrepe · faster-whisper · s3tokenizer · sherpa-onnx-core · whisper-timestamped · vosk