groq-whisper-cli
Groq Whisper 多 Key 并发语音转写 CLI 工具。
功能
- silero-vad 本地 VAD 智能切片
- 多 API Key 配额感知负载均衡
- 429 自动退避 + Key 切换
- 异步并发协程池
- 输出 SRT 字幕 + TXT 文本
安装
# 直接通过 uvx 运行(无需安装)
uvx run groq-whisper-cli -i audio.mp3
# 或安装到本地
uv tool install groq-whisper-cli
groq-whisper-cli -i audio.mp3
前置要求
- Python 3.12+
- ffmpeg(用于音频提取)
API Key 配置
按优先级查找:
--key-file/-k参数指定文件(每行一个 key)- 当前目录下的
key.txt - 环境变量
GROQ_API_KEY(多个 key 用逗号分隔)
# 方式一:环境变量
export GROQ_API_KEY="gsk_xxx,gsk_yyy"
# 方式二:key 文件
echo "gsk_xxx" > key.txt
echo "gsk_yyy" >> key.txt
# 方式三:命令行参数
groq-whisper-cli -i audio.mp3 -k /path/to/key.txt
用法
# 基本用法
groq-whisper-cli -i audio.mp3
# 指定语言和输出目录
groq-whisper-cli -i video.mp4 -l en -o ./output
# 多文件处理
groq-whisper-cli -i *.mp4 -w 8
# 完整参数
groq-whisper-cli -i audio.mp3 \
-k key.txt \
-o ./transcript \
-w 4 \
--chunk-sec 120 \
-l zh \
--retries 8
参数
| 参数 | 缩写 | 默认值 | 说明 |
|---|---|---|---|
input |
- | 必填 | 输入文件路径,支持通配符 |
--key-file |
-k |
- | API Key 文件路径 |
--out |
-o |
./transcript |
输出目录 |
--workers |
-w |
4 |
并发 worker 数 |
--chunk-sec |
- | 120 |
VAD 切片最大时长(秒) |
--lang |
-l |
zh |
ISO-639-1 语言代码 |
--retries |
- | 8 |
每个分片最大重试次数 |
Rate Limits
Groq API rate limits per key (as of 2026-05-29):
| Model | RPM | RPD | Audio Sec/Hour | Audio Sec/Day |
|---|---|---|---|---|
| whisper-large-v3 | 20 | 2,000 | 7,200 | 28,800 |
| whisper-large-v3-turbo | 20 | 2,000 | 7,200 | 28,800 |
This tool uses sliding window rate limiting (20 req/60s per key) to stay within RPM limits. Each API key gets its own dedicated worker to avoid contention.
作为库使用
from groq_whisper import GroqKeyManager, AudioSplitter, GroqTranscriber
key_manager = GroqKeyManager(["gsk_xxx", "gsk_yyy"])
splitter = AudioSplitter(max_chunk_sec=120)
chunks = splitter.split("audio.mp3")
transcriber = GroqTranscriber(key_manager=key_manager, language="zh")
results = asyncio.run(transcriber.transcribe_all(chunks))
License
MIT
Metadata
Release files for groq-whisper-cli 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| groq_whisper_cli-0.2.1.tar.gz | 28.3 kB | Without provenance | Details for groq_whisper_cli-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| groq_whisper_cli-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for groq_whisper_cli-0.2.1-py3-none-any.whl |
Total release size: 42.5 kB
Release files / groq_whisper_cli-0.2.1.tar.gz
| Download URL | groq_whisper_cli-0.2.1.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
163dc31dbd22108cf56b945a5892cd0858015e6d672424a7a5fa4d6c8b2c950a
|
|
BLAKE2b-256 checksum How to use checksums |
70dcedd7a5facdc4095c2d6296486610f7086fca472a1bdc9040d760fef864d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / groq_whisper_cli-0.2.1-py3-none-any.whl
| Download URL | groq_whisper_cli-0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31debbc9e4ef7239f13ffe1f2b1f59fc36006931ffea84f74359719d21410224
|
|
BLAKE2b-256 checksum How to use checksums |
22e210d06b9aba79e493529f9ff89f65d68710ef26f057773735c007f4700d41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for groq-whisper-cli 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.