Skip to main content

Provider-specific Swarmauri import package for Whisper transcription, translation, async, and batch speech-to-text workflows.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_llm_whisper Discord

Swarmauri Whisper Transcription

swarmauri_llm_whisper provides the provider-specific Swarmauri import package for WhisperLargeModel. Despite the older llm package name, the runtime is a speech-to-text adapter that calls Hugging Face Inference for openai/whisper-large-v3 and supports both transcription and translation workflows.

The adapter targets Hugging Face Inference at https://api-inference.huggingface.co/models/openai/whisper-large-v3, accepts local audio file paths, and returns text output for single-file, async, and batch processing workflows.

Why Use This Package?

  • Keep Whisper-specific imports explicit in Swarmauri applications.
  • Transcribe or translate audio through a Swarmauri component instead of hand-writing Hugging Face Inference requests.
  • Reuse one adapter for synchronous, asynchronous, and batch audio processing.
  • Bridge older llms import patterns while newer stt-oriented package paths continue to evolve.

FAQ

What does swarmauri_llm_whisper install?

It installs WhisperLargeModel under swarmauri.llms.

Is this a chat LLM package?

No. The runtime is a speech-to-text adapter for openai/whisper-large-v3 on Hugging Face Inference.

Which tasks are supported?

The adapter supports transcription and translation.

Which model is supported today?

The current runtime allowlist contains openai/whisper-large-v3.

Does it support streaming?

No. stream and astream are explicitly unimplemented for this adapter.

What credentials are required?

You need a Hugging Face access token with permission to use the target inference surface.

Features

  • WhisperLargeModel for transcription and translation against Hugging Face Inference.
  • Sync and async single-file processing.
  • Batch and async batch audio workflows.
  • Explicit task selection between transcription and translation.
  • Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

uv add swarmauri_llm_whisper
pip install swarmauri_llm_whisper

Usage

Set HF_API_KEY in your environment before creating the model.

Transcription

import os

from swarmauri_llm_whisper import WhisperLargeModel

model = WhisperLargeModel(api_key=os.environ["HF_API_KEY"])
text = model.predict("tests/static/test.mp3", task="transcription")

print(text)

Translation

import os

from swarmauri_llm_whisper import WhisperLargeModel

model = WhisperLargeModel(api_key=os.environ["HF_API_KEY"])
text = model.predict("tests/static/test_fr.mp3", task="translation")

print(text)

Async Batch Processing

import asyncio
import os

from swarmauri_llm_whisper import WhisperLargeModel


async def main() -> None:
    model = WhisperLargeModel(api_key=os.environ["HF_API_KEY"])
    results = await model.abatch(
        {
            "tests/static/test.mp3": "transcription",
            "tests/static/test_fr.mp3": "translation",
        }
    )
    print(results)


# asyncio.run(main())

Examples

  • Use transcription when the output should stay in the original spoken language.
  • Use translation when the output should be translated into English.
  • Use batch methods when one job needs to process multiple audio files together.

Related Packages

Foundational Swarmauri Packages

More Documentation

Best Practices

  • Keep HF_API_KEY in environment variables or a secret manager.
  • Choose translation only when English output is the intended downstream behavior.
  • Use explicit local audio file paths and validate the file exists before dispatching a batch job.
  • Prefer newer Swarmauri STT-native imports when available for new projects, since this package preserves an older compatibility surface.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_llm_whisper-0.11.0.dev1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmauri_llm_whisper-0.11.0.dev1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_llm_whisper-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_llm_whisper-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_llm_whisper-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 f510ee526d895ced09acb1348ef7157289fd097d3d23682ab4bdc7a3a16db2d8
MD5 e943de5594171f400c5f0d04de7a9df2
BLAKE2b-256 683fd9225ec7acc88829c5b8948de4192b29f66c7f1c92ae66e05538b347321a

See more details on using hashes here.

File details

Details for the file swarmauri_llm_whisper-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_llm_whisper-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_llm_whisper-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 6665c8f6b0cede704e7423041293ebab518819959c7141687f98bf88dcfc05f2
MD5 d67b0e1f7b1a27c208fd87828b51c68b
BLAKE2b-256 1dc502285783642e2a895594f0665d5f6b4ba15d6cfcad6a8b09cb889365bdfc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page