Transcribe.cpp

Transcribe.cpp

transcribe.cpp Apr 2026 - now

I’m super excited to share transcribe.cpp today. transcribe.cpp is a ggml based transcription library which supports all the latest transcription models. Every model published under the handy-computer HF org has been numerically validated and WER tested to match the reference implementation. It’s accelerated everywhere. I’m the author and maintainer of Handy. This library grew from the pains of distributing a cross-platform speech-to-text application to many people. This is a v0.1.0 library which means that there are some rough edges which I cannot discover alone! Please report them, and let’s fix them together!

今天我非常激动地向大家介绍 transcribe.cpp。transcribe.cpp 是一个基于 ggml 的转录库,支持所有最新的转录模型。在 handy-computer Hugging Face 组织下发布的每一个模型都经过了数值验证和 WER(词错误率)测试,以确保与参考实现一致。它在各种环境下都能实现加速。我是 Handy 的作者和维护者。这个库诞生于我在向广大用户分发跨平台语音转文字应用时所遇到的痛点。这是一个 v0.1.0 版本的库,意味着它还有一些我无法独自发现的瑕疵!请报告这些问题,让我们一起修复它们!

Motivation

Let me say this. I think distributing a cross-platform application with the current ASR inference stack is terrible. You’ve basically got whisper.cpp and ONNX. That’s it. You could roll MLX in for Apple devices, but now you’ve to support two different engines and port models to each. I’ve been a fan of ONNX for getting model support into Handy quickly, but so much performance is left on the table with CPU only. There are a few random libraries out there which claim to support a lot of models, but they have unknown authors, and unknown testing, as far as I’ve seen. They leave me with more questions than answers. When will they stop maintaining this library? Has the creator thought about bindings so you can actually use it in a real desktop or mobile app? Is this effectively demo code? Have they benchmarked it? Is it faster than ONNX? And this is what led to transcribe.cpp.

动机

我想说,我认为使用当前的 ASR(自动语音识别)推理栈来分发跨平台应用简直是一场灾难。你基本上只有 whisper.cpp 和 ONNX 可选,仅此而已。你可以在苹果设备上引入 MLX,但现在你必须支持两个不同的引擎,并分别为它们移植模型。我曾是 ONNX 的拥趸,因为它能让 Handy 快速获得模型支持,但仅靠 CPU 运行会浪费大量性能。市面上有一些零散的库声称支持很多模型,但据我所见,它们的作者不明,测试情况也不透明。它们留给我的疑问多于答案:他们什么时候会停止维护这个库?作者是否考虑过绑定(bindings),以便在真实的桌面或移动应用中使用它?这实际上只是演示代码吗?他们做过基准测试吗?它比 ONNX 快吗?这些问题促成了 transcribe.cpp 的诞生。

As Handy’s maintainer I needed a library I could trust. Where I could download a file and run inference on it. Where I can know that the inference coming from the model in the engine is as good as the reference implementation. The inference should run on the GPU for the best performance. It should be trivially embeddable in Handy, it cannot be a huge pytorch lib. It must be something that works on Mac, Windows, and Linux. And ggml seemed like by far the best way forward. It has a strong community, and a great distribution story.

作为 Handy 的维护者,我需要一个值得信赖的库。我希望下载一个文件就能运行推理,并且确信引擎中模型输出的推理结果与参考实现一样好。为了获得最佳性能,推理应该在 GPU 上运行。它必须能轻松嵌入到 Handy 中,不能是一个庞大的 PyTorch 库。它必须能在 Mac、Windows 和 Linux 上运行。而 ggml 看起来是目前最好的选择,它拥有强大的社区和出色的分发机制。

So what do you get?

You get a fast and accurate inference engine with wide ranging model support.

  • Support for 16 ASR Families (60+ models) with more coming
  • Acceleration via Vulkan, Metal, CUDA, and TinyBLAS
  • Every model has been numerically verified and WER tested
  • Support for Streaming Transcription
  • Support for Batch Transcription
  • More or less drop in whisper.cpp replacement
  • Maintainer supported bindings in 4 Languages: Python, Javascript/Typescript, Rust, ObjC/Swift

你能得到什么?

你将获得一个快速、准确且支持广泛模型的推理引擎。

  • 支持 16 个 ASR 系列(60+ 模型),且未来会支持更多
  • 通过 Vulkan、Metal、CUDA 和 TinyBLAS 进行加速
  • 每个模型都经过数值验证和 WER 测试
  • 支持流式转录
  • 支持批量转录
  • 基本可以作为 whisper.cpp 的直接替代品
  • 维护者支持 4 种语言的绑定:Python、Javascript/Typescript、Rust、ObjC/Swift

Wide Model Support

We intend to support as many state-of-the-art transcription models as possible. As of today, we support most of the modern transcription models that are publicly available. There are a few missing still, but they will be added soon.

广泛的模型支持

我们旨在支持尽可能多的最先进转录模型。截至今日,我们支持大多数公开可用的现代转录模型。虽然还有少数缺失,但很快就会补上。

Acceleration Support

One of my top goals was to run any ASR model I wanted on Vulkan. In my opinion this is the floor for any application shipping local inference. For every model we support, there is a corresponding benchmark run from a Ryzen 4750U (CPU + Vulkan) on Fedora as well as on my M4 Max.

加速支持

我的首要目标之一是在 Vulkan 上运行我想要的任何 ASR 模型。在我看来,这是任何提供本地推理的应用的底线。对于我们支持的每一个模型,都有在 Fedora 系统上的 Ryzen 4750U(CPU + Vulkan)以及我的 M4 Max 上运行的相应基准测试数据。

Numerically Verified

I also wanted to make sure that inference in transcribe.cpp is accurate and as close to the reference implementation as possible. This largely came from a huge degree of uncertainty of inference accuracy when using .onnx models I found on Hugging Face. In order to ensure the inference we do is correct we numerically validate every model versus the reference. On top of numerical validation, we run full WER sweeps to make sure that whatever the reference is outputting, we output the same thing. That means every model has run through thousands of utterances and is very close or same as the reference. And the results of this data are published in the transcribe.cpp repo as well as with each model on Hugging Face.

数值验证

我还想确保 transcribe.cpp 的推理准确,并尽可能接近参考实现。这很大程度上是因为我在 Hugging Face 上找到的 .onnx 模型在推理准确性方面存在极大的不确定性。为了确保我们的推理是正确的,我们针对参考实现对每个模型进行了数值验证。除了数值验证,我们还运行了完整的 WER 扫描,以确保参考实现输出什么,我们就输出什么。这意味着每个模型都经过了数千条语音的测试,结果与参考实现非常接近或完全一致。这些数据结果已发布在 transcribe.cpp 仓库以及 Hugging Face 的每个模型页面中。

Drop In whisper.cpp replacement

transcribe.cpp is more or less a drop in support for whisper.cpp. The main reason for this is: Handy used whisper.cpp and I needed to ship an update with transcribe.cpp which would replace it. I needed to keep some compatibility with the very popular .bin files which run in whisper.cpp and shipped with Handy. transcribe.cpp can run them. There are some flags and features in whisper.cpp which we do not support yet. But I think for the vast majority of use cases our whisper implementation is solid and can replace whisper.cpp while having about equal performance.

whisper.cpp 的直接替代品

transcribe.cpp 基本可以作为 whisper.cpp 的直接替代品。主要原因是:Handy 原本使用 whisper.cpp,我需要发布一个包含 transcribe.cpp 的更新来替换它。我需要保持与 whisper.cpp 中运行且随 Handy 分发的流行 .bin 文件的兼容性,而 transcribe.cpp 可以运行它们。虽然 whisper.cpp 中的某些标志和功能我们尚未支持,但我认为对于绝大多数用例,我们的 whisper 实现非常稳健,可以在性能相当的情况下替代 whisper.cpp。

Real Distribution

Language bindings were on my mind to begin with. While this library is written in C/C++, I needed bindings in Rust. And I also knew that in order for us to distribute local transcription as widely as possible, it requires at minimum decent first-party support of bindings. I’ve chosen 4 languages that I think are fairly representative of where people will use the library. I welcome others to contribute bindings directly to the project as well, assuming that they are willing to take on the maintenance burden of doing so.

真正的分发

从一开始,我就考虑了语言绑定。虽然这个库是用 C/C++ 编写的,但我需要 Rust 绑定。我也知道,为了尽可能广泛地分发本地转录功能,至少需要体面的官方绑定支持。我选择了 4 种我认为最具代表性的语言,人们可能会在这些语言中使用该库。我也欢迎其他人直接为项目贡献绑定,前提是他们愿意承担相应的维护负担。

And of course, at the end of the day, a lot of the decisions were driven by Handy. As a result of Handy being popular, I intend to maintain this library, just as I’ve done my best to maintain Handy. I intend to be someone who continues to maintain open source projects and contribute to the ecosystem where I can. This library never would have existed without Handy because I wouldn’t have had the problem of trying to support a bunch of different ASR models. I would have never learned all the use cases that people have for ASR. I’ve done my best to cover the ones that I hear about the most. Certainly, there are cases in the library that are not currently handled. If there are things that I missed, you are free to contribute to the library!

当然,归根结底,许多决策都是由 Handy 驱动的。由于 Handy 很受欢迎,我打算像维护 Handy 一样维护这个库。我希望成为一个持续维护开源项目并尽我所能为生态系统做出贡献的人。如果没有 Handy,这个库就不会存在,因为我就不会遇到需要支持多种不同 ASR 模型的问题,也不会了解到人们对 ASR 的所有使用场景。我已经尽力覆盖了最常听到的需求。当然,库中肯定还有目前未处理的情况。如果你发现我遗漏了什么,欢迎为该库做出贡献!

Making Local Speech to Text More Accessible

transcribe.cpp is aimed squarely at making locally run ASR easier. We know that transcription can run extremely accurately on most devices, and there should be no need to send your voice to a cloud service. An RK3566 can run mode…

让本地语音转文字更易用

transcribe.cpp 的目标明确,就是让本地运行 ASR 变得更容易。我们知道,转录在大多数设备上都能极其准确地运行,完全没有必要将你的语音发送到云服务。RK3566 芯片就能运行模式……