Skip to content

Add Python bindings and PyPI wheels - #28

Merged
praveenperera merged 6 commits into
masterfrom
python-wheels
Oct 30, 2026
Merged

praveenperera merged 6 commits into
masterfrom
python-wheels

Conversation

@praveenperera

@praveenperera praveenperera commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Adds a scriptrs Python package. It is built with PyO3 and maturin as one abi3 wheel per platform: Core ML on macOS arm64, and CUDA on Linux x86_64 (manylinux_2_28). The CUDA wheel gets cuBLAS from the nvidia-cublas-cu12 wheel.

import scriptrs

pipeline = scriptrs.Pipeline.from_pretrained("parakeet/v2")  # or "parakeet/v3"
print(pipeline.transcribe_file("meeting.mp3").text)
  • Models are named "<family>/<version>" so other model families can be added later. The default is parakeet/v2, the same as the Rust crate. scriptrs.Model.PARAKEET_V2 and scriptrs.Model.PARAKEET_V3 also work, and so do NVIDIA's ids (nvidia/parakeet-tdt-0.6b-v3).
  • transcribe, transcribe_file, and transcribe_many release the GIL. transcribe_many runs short clips through the batching queue on the model that is already loaded.
  • The scriptrs transcribe command prints the bare transcript for one file. For several files it prints a ==> file <== header before each transcript, like head. --json prints one object per file.
  • Model downloads now use rustls instead of OpenSSL, so the wheels bundle no libssl. This also removes reqwest and tokio from the crate's dependency tree.
  • python.yml builds the wheels and the sdist, then tests them. On a tag it publishes to TestPyPI, installs from there, and then publishes to PyPI through trusted publishing.

Before the first release, trusted publishers for scriptrs must be set up on PyPI and TestPyPI, using python.yml with the environments pypi and testpypi.

  • Core ML downloads no longer ask for metadata.json. The published v3 encoder has none, so every parakeet/v3 Core ML download got a 404. Core ML never reads the file.

Tested on Linux with an RTX 5090 and on an M-series Mac mini from an empty model cache. On each machine, 19 tests passed and 1 was skipped (the Linux no-driver check), across both models. The wheels are 3.7 MB on Linux and 2.6 MB on macOS, and the Linux wheel bundles no libssl.

The online feature now uses hf-hub's ureq client with ureq's default
rustls, so builds no longer link the system OpenSSL. Python wheels then
need no libssl bundled, and reqwest and tokio drop out of the tree.
The scriptrs package wraps the long-form pipeline with PyO3: one abi3
wheel per platform, Core ML on macOS arm64 and CUDA on Linux x86_64,
with cuBLAS from the nvidia-cublas-cu12 wheel. Models are picked at
load time as "parakeet/v2" (the default, as in the crate) or
"parakeet/v3", so later model families fit the same naming.

It also adds a scriptrs command line, pytest suite, and a workflow
that builds wheels and the sdist, tests them, and publishes tags to
TestPyPI and then PyPI through trusted publishing.

The long-form pipeline exposes its base pipeline and config so
transcribe_many can queue short clips on the already loaded model.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cfe0a51e-77f8-45fe-829c-cbd51cf7a15a
Commits

Reviewing files that changed from the base of the PR and between c16d3af and fe4fa5d.

Files ignored due to path filters: 3
  • Cargo.lock is excluded by !**/*.lock
  • crates/scriptrs-python/Cargo.lock is excluded by !**/*.lock
  • crates/scriptrs-python/tests/data/librispeech-1089-134686-0007.wav is excluded by !**/*.wav
Files selected for processing: 23
  • .github/workflows/python.yml
  • Cargo.toml
  • README.md
  • crates/scriptrs-python/Cargo.toml
  • crates/scriptrs-python/LICENSE
  • crates/scriptrs-python/README.md
  • crates/scriptrs-python/pyproject.toml
  • crates/scriptrs-python/python/scriptrs/__init__.py
  • crates/scriptrs-python/python/scriptrs/_cuda.py
  • crates/scriptrs-python/python/scriptrs/_errors.py
  • crates/scriptrs-python/python/scriptrs/_native.pyi
  • crates/scriptrs-python/python/scriptrs/cli.py
  • crates/scriptrs-python/python/scriptrs/py.typed
  • crates/scriptrs-python/src/audio.rs
  • crates/scriptrs-python/src/lib.rs
  • crates/scriptrs-python/src/pipeline.rs
  • crates/scriptrs-python/src/results.rs
  • crates/scriptrs-python/src/samples.rs
  • crates/scriptrs-python/tests/conftest.py
  • crates/scriptrs-python/tests/test_scriptrs.py
  • justfile
  • src/long_form.rs
  • src/models.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The published v3 encoder has no metadata.json, so every v3 Core ML
download failed with a 404. Core ML never reads the file, so it is no
longer part of the download list.
# Conflicts:
#	justfile
scriptrs moved to 0.4.0, and release tags carry its version, so the
bindings follow. The sdist job now fails a pull request whose bindings
version differs from the crate's, instead of the mismatch surfacing
only when a tag is published.
@praveenperera
praveenperera merged commit 895bbe9 into master Oct 30, 2026
12 checks passed
@praveenperera
praveenperera deleted the python-wheels branch October 30, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant