Skip to main content

Cheetah Binding for Python

Cheetah Speech-to-Text Engine

Made in Vancouver, Canada by Picovoice

Cheetah is an on-device streaming speech-to-text engine. Cheetah is:

  • Private; All voice processing runs locally.
  • Accurate
  • Compact and Computationally-Efficient
  • Cross-Platform:
    • Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
    • Android and iOS
    • Chrome, Safari, Firefox, and Edge
    • Raspberry Pi (3, 4, 5)

Compatibility

  • Python 3.10+
  • Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

Installation

pip3 install pvcheetah

AccessKey

Cheetah requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Cheetah SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

Basic Transcription

Create an instance of the engine and transcribe audio:

import pvcheetah

handle = pvcheetah.create(access_key='${ACCESS_KEY}')

def get_next_audio_frame():
    pass

while True:
    partial_transcript, is_endpoint = handle.process(get_next_audio_frame())
    if is_endpoint:
        final_transcript = handle.flush()

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. When done be sure to explicitly release the resources using handle.delete().

Annotated Transcription

Create an instance of the engine and get the audio transcription and word-level metadata:

import pvcheetah

handle = pvcheetah.create(access_key='${ACCESS_KEY}')

def get_next_audio_frame():
    pass

while True:
    partial_output = handle.process_annotated(get_next_audio_frame())
    partial_transcript = partial_output.transcript
    partial_words = partial_output.words
    is_endpoint = partial_output.is_endpoint

    if is_endpoint:
        final_output = handle.flush_annotated()
        final_transcript = final_output.transcript
        final_words = final_output.words

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. When done be sure to explicitly release the resources using handle.delete().

Language Model

The Cheetah Python SDK comes preloaded with a default English language model (.pv file). Default models for other supported languages can be found in lib/common.

Create custom language models using the Picovoice Console. Here you can train language models with custom vocabulary and boost words in the existing vocabulary.

Pass in the .pv file via the model_path argument:

cheetah = pvcheetah.create(
    access_key='${ACCESS_KEY}',
    model_path='${MODEL_FILE_PATH}')

Train Models over API

You can train models over API without going to the console:

train_model_from_words(
        "${ACCESS_KEY}",                                                   # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
        "${OUTPUT_PATH}",                                                  # Path to save the newly trained model.
        "${LANGUAGE}",                                                     # Two-character language code.
        {"${NEW_WORD}": set(["${PRONUNCIATION1}", "${PRONUNCIATION2}"])},  # New words with optional custom pronunciation to add to the model.
        set(["${BOOST_WORD1}", "${BOOST_WORD2}"]))                         # Boost words.

(or)

train_model_from_yaml(
        "${ACCESS_KEY}",   # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
        "${OUTPUT_PATH}",  # Path to save the newly trained model.
        "${LANGUAGE}",     # Two-character language code.
        "${YAML_PATH}")    # Path to YAML configuration file.

Check Cheetah Model API docs for a list of supported languages.

Demos

pvcheetahdemo provides command-line utilities for processing audio using Cheetah.

Metadata

Release files for pvcheetah 4.3.0

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

Source distribution (sdist)

Source distribution for pvcheetah 4.3.0
File Size Uploaded Provenance Actions
pvcheetah-4.3.0.tar.gz 42.6 MB Without provenance Details for pvcheetah-4.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pvcheetah 4.3.0
File Interpreter ABI Platform Actions
pvcheetah-4.3.0-py3-none-any.whl Python 3 none any Details for pvcheetah-4.3.0-py3-none-any.whl

Total release size: 85.3 MB

Release files / pvcheetah-4.3.0.tar.gz

Download URL pvcheetah-4.3.0.tar.gz
Size 42.6 MB
Tags Source
SHA-256 checksum
How to use checksums
18857ddc777e9a1efac7ef6fc5b1e24bc67832221326d4b1de585a2c102bae12
BLAKE2b-256 checksum
How to use checksums
f6295464cc5c37d68503e2c71180998ed752407429550af4737a65c534be3b5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pvcheetah-4.3.0-py3-none-any.whl

Download URL pvcheetah-4.3.0-py3-none-any.whl
Size 42.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c857717d47a1cc9f50a65da96e56134d602e937632d04e6f3b1cdfe4ce3172ac
BLAKE2b-256 checksum
How to use checksums
5f6f5bba795e3d80538e9deb22c89b3e2e24413666b469502b6001446dd2cacc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for pvcheetah 4.3.0

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.

Release history Release notifications | RSS feed

This release

4.3.0 This release

2 release files No provenance

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