SambaNova STT
The SambaNovaSTTService provides high-efficiency inference for real-time speech transcription using SambaNova's optimized Whisper API.
Installation
To use SambaNova, install the required dependencies:
pip install "piopiy-ai[sambanova]"
Prerequisites
- A SambaNova account and API key (Get yours here).
- Set your API key in your environment:
export SAMBANOVA_API_KEY="your_api_key_here"
Configuration
SambaNovaSTTService Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | Required | Your SambaNova API key. |
model | str | "Whisper-Large-v3" | The Whisper model to use. |
base_url | str | "https://api.sambanova.ai/v1" | SambaNova API base URL. |
language | Language | Language.EN | Language of the audio input. |
prompt | str | None | Optional text to guide the model's style. |
temperature | float | 0.0 | Sampling temperature between 0 and 1. |
Usage
Basic Setup
import os
from piopiy.services.sambanova.stt import SambaNovaSTTService
stt = SambaNovaSTTService(
api_key=os.getenv("SAMBANOVA_API_KEY")
)
With Custom Model and Language
import os
from piopiy.services.sambanova.stt import SambaNovaSTTService
from piopiy.transcriptions.language import Language
stt = SambaNovaSTTService(
api_key=os.getenv("SAMBANOVA_API_KEY"),
model="Whisper-Large-v3",
language=Language.EN_US
)
Notes
- Optimized Inference: SambaNova's platform is engineered for extremely fast execution of foundation models like Whisper.
- Probability Metrics: Note that SambaNova STT does not currently support probability metrics.