Skip to main content

Black Bolt

Word-level speech transcription with a choice of ASR backend:

--provider Who transcribes the words Word times
sarvam Sarvam saaras (Indic + English) wav2vec2 alignment (Sarvam REST has no word timestamps)
deepgram Deepgram Listen native words, optionally re-aligned
openai OpenAI whisper-1 / gpt-4o-transcribe native words on whisper-1, otherwise alignment
opensource local faster-whisper (the original WhisperX ASR) wav2vec2 alignment

The rest of the pipeline is the same for every provider:

  1. Load audio as 16 kHz mono
  2. Voice-activity detection, then merge speech into ≤30 s chunks (Sarvam REST max). Speech longer than that is cut at the nearest pause before 30 s, not mid-word
  3. Send each chunk to the chosen provider (Sarvam retries rate limits and 5xx with backoff)
  4. Force-align each chunk's transcript onto the waveform with wav2vec2 → per-word start / end. For Hindi, maths and Latin text is aligned as it is spoken (a² → ए स्क्वायर, θ → थीटा) while the output keeps the original words

Alignment, VAD (pyannote/silero), and the local Whisper path are adapted from WhisperX.

Install

Cloud providers only (energy VAD, no GPU stack):

pip install -e .

Word alignment (required for Sarvam and opensource word times):

pip install -e '.[align]'

Pyannote VAD (same detector WhisperX uses):

pip install -e '.[vad]'

Local Whisper + alignment + pyannote:

pip install -e '.[opensource]'

ffmpeg must be on PATH.

CLI

export SARVAM_API_KEY=...
black-bolt talk.wav --provider sarvam --language hi

export DEEPGRAM_API_KEY=...
black-bolt talk.wav --provider deepgram --model nova-3

export OPENAI_API_KEY=...
black-bolt talk.wav --provider openai --model whisper-1

black-bolt talk.wav --provider opensource --model large-v2 --device cuda

Useful flags:

  • --no_align — skip wav2vec2; Deepgram / OpenAI whisper-1 still emit native word times
  • --vad_method auto|energy|pyannote|silero|fixed
  • --chunk_size 30 — hard-capped at 30 s
  • --mode transcribe|translate|verbatim|translit|codemix — Sarvam only
  • -f json|srt|vtt|txt|tsv|all

Python

from black_bolt import transcribe

result = transcribe(
    "talk.wav",
    provider="sarvam",
    language="hi",
    model="saaras:v4",
    timestamps=True,        # word-level; Hermes uses no_align=not timestamps
    api_key="...",          # or SARVAM_API_KEY
)
for word in result["word_segments"]:
    print(f"{word['start']:.2f}-{word['end']:.2f} {word['word']}")

result["segments"] is utterance-level after alignment. Each segment has a words list (word, start, end, score) — the shape Hermes reads for timestamps=true.

Environment

Provider Env var
Sarvam SARVAM_API_KEY
Deepgram DEEPGRAM_API_KEY
OpenAI OPENAI_API_KEY
pyannote VAD / diarization HF_TOKEN (or --hf_token)

Publish to PyPI

Pushes to main run .github/workflows/publish.yml: tests, then python -m build, then upload to pypi.org. The same version is not uploaded twice (skip-existing).

Auth (pick one):

  1. Trusted publishing (recommended). On pypi.org → Publishing, add a GitHub pending publisher:
    • PyPI project name: black_boltx
    • Owner / repo: your GitHub org and black_bolt
    • Workflow: publish.yml
    • Environment: pypi
  2. API token. Create a PyPI token and add it to the repo as the PYPI_API_TOKEN secret. The workflow already reads that secret.

Bump version in pyproject.toml before a release, or PyPI will skip the upload.

Notes

  • Sarvam REST does not return word timestamps (only phrase spans). Black Bolt always runs wav2vec2 after Sarvam to get word times.
  • Translated text (--mode translate on Sarvam, or English translation in general) cannot be force-aligned to the original audio. Use --no_align.
  • Overlapping speakers are still a weak point, same as WhisperX.

Metadata

Release files for black-boltx 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for black-boltx 1.0.4
File Size Uploaded Provenance Actions
black_boltx-1.0.4.tar.gz 16.5 MB Without provenance Details for black_boltx-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for black-boltx 1.0.4
File Interpreter ABI Platform Actions
black_boltx-1.0.4-py3-none-any.whl Python 3 none any Details for black_boltx-1.0.4-py3-none-any.whl

Total release size: 33.0 MB

Release files / black_boltx-1.0.4.tar.gz

Download URL black_boltx-1.0.4.tar.gz
Size 16.5 MB
Tags Source
SHA-256 checksum
How to use checksums
0b1f404cfe775e8512358e7e720ade8997d19a45716fa1eff67505af35e78a6c
BLAKE2b-256 checksum
How to use checksums
46b8783c79882a90bc1b8a36e39dc4d57cb09abaa752f06a8938c575ca50ee2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / black_boltx-1.0.4-py3-none-any.whl

Download URL black_boltx-1.0.4-py3-none-any.whl
Size 16.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a4d4a74b3a8c25a479c70cfcbeeddd6aa25f0ce2d20a3fa957d1e74448622b08
BLAKE2b-256 checksum
How to use checksums
73cebfe61568d0094c389bffa414a3c1334d45ad0b3a7e6ede7ed2c5ad498391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for black-boltx 1.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page