litellm/litellm/types
Sameer Kankute e912e6d4ff
feat(audio_transcription): add NVIDIA Riva STT provider (#27185)
* feat(audio_transcription): add NVIDIA Riva STT provider

Adds nvidia_riva as a new audio transcription provider, supporting both
NVCF-hosted and self-hosted Riva ASR deployments via gRPC streaming.

- Auto-resamples input audio to 16 kHz mono LINEAR_PCM (soundfile + numpy,
  audioread fallback) so callers can send any common format.
- Maps OpenAI params: language (en -> en-US), response_format (text/json/
  verbose_json), timestamp_granularities=["word"] -> enable_word_time_offsets,
  word offsets converted ms -> s for verbose_json.
- Auth: NVCF when nvcf_function_id is set (SSL on by default), self-hosted
  otherwise (SSL off by default), with explicit use_ssl override.
- gRPC errors wrapped via NvidiaRivaException -> litellm exception classes.
- Optional deps gated behind [stt-nvidia-riva] extra (nvidia-riva-client,
  soundfile, audioread, numpy).

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(nvidia_riva): address PR review feedback

- handler: forward call-level `timeout` to streaming_response_generator
  (kwarg-detected via inspect for older riva-client compat) so a stalled
  Riva server cannot block the caller indefinitely.
- audio_utils: spill bytes to a tempfile before audioread.audio_open;
  most audioread backends (FFmpeg, GStreamer) require a real filesystem
  path and previously raised TypeError on BytesIO, breaking the mp3/m4a
  fallback path.
- audio_utils: prefer soxr / scipy.signal.resample_poly for resampling
  (anti-aliased polyphase) when installed, falling back to linear only
  as a last resort. Avoids aliasing on 44.1/48 kHz -> 16 kHz downsamples.
- transformation: bare `es` now maps to es-ES (Castilian) instead of
  es-US, matching BCP-47 conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: trigger CI re-run [stabilize loop 1/3]

* Update litellm/llms/nvidia_riva/audio_transcription/transformation.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* chore: trigger CI re-run [stabilize loop 1/3]

* fix code qa

* fix lint

* fix mypy

* fix mypy

* Fix NVIDIA Riva ASR service lookup

* Fix NVIDIA Riva transcription payload logging

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: oss-pr-review-agent-shin[bot] <281797381+oss-pr-review-agent-shin[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-05-05 17:17:51 -07:00
..
containers feat(containers): Azure routing, managed container IDs, delete response parsing (#25287) 2026-04-11 09:21:01 -07:00
google_genai fix(mypy): fix scattered 1-off type errors across 14 files 2026-03-13 00:08:57 +00:00
images merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
integrations style: apply black formatting 2026-04-20 16:02:21 -07:00
interactions build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
litellm_core_utils include server_tool_use in streaming usage (#16826) 2025-11-25 14:50:17 -08:00
llms feat(realtime): OpenAI Realtime GA support and beta compatibility (#27110) 2026-05-05 16:49:20 -07:00
management_endpoints feat: routing groups ui 2026-05-04 18:09:14 -07:00
mcp_server feat(mcp): rehash short tool prefix on collision and cache per server 2026-04-29 03:43:34 +00:00
passthrough_endpoints refactor: define pass-through custom body state key in types module 2026-04-11 15:26:44 -07:00
prompts style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
proxy feat: add Qohash Nexus guardrail hook (#24927) 2026-05-01 17:26:32 +05:30
responses refactor: extract duplicated stdout/stderr → logs logic to shared helper 2026-03-18 22:05:27 -03:00
secret_managers style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
videos style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
access_group.py allow editing of access group names 2026-02-13 17:03:41 -08:00
adapter.py feat(anthropic_adapter.py): support for translating anthropic params to openai format 2024-07-10 00:32:28 -07:00
agents.py fix(agents.tsx): support granting agents access to subagents 2026-03-10 21:03:20 -07:00
caching.py fix(caching): preserve prompt_tokens_details through embedding cache round-trip (#26653) 2026-04-28 08:25:11 -07:00
completion.py fix: correct CompletionRequest messages type to match OpenAI API spec (#12980) 2025-07-28 16:47:20 -07:00
compression.py Prompt Compression - add it to the proxy (#25729) 2026-04-20 15:08:00 -07:00
embedding.py Removed config dict type definition 2024-05-17 10:39:00 +08:00
files.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
fine_tuning.py (feat) POST /fine_tuning/jobs support passing vertex specific hyper params (#7490) 2025-01-01 07:44:48 -08:00
guardrails.py feat: add Qohash Nexus guardrail hook (#24927) 2026-05-01 17:26:32 +05:30
mcp.py Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
memory_management.py feat(proxy): add /v1/memory CRUD endpoints (#26218) 2026-04-24 18:38:07 -07:00
policy_engine.py [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612) 2026-01-22 19:49:53 -08:00
rag.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime.py address greptile review feedback (greploop iteration 2) 2026-03-12 18:53:22 +05:30
rerank.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
router.py feat: selectively apply routing strategy according to model name 2026-05-04 13:27:32 -07:00
scheduler.py Squashed commit of the following: (#9709) 2025-04-02 21:24:54 -07:00
search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
services.py [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920) 2025-12-13 08:18:43 -08:00
tag_management.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
tool_management.py Bug Fix: auto-inject prompt caching support for Gemini models (#21881) 2026-03-03 20:25:35 -08:00
utils.py feat(audio_transcription): add NVIDIA Riva STT provider (#27185) 2026-05-05 17:17:51 -07:00
vector_store_files.py Vector store files Stable Release (#16643) 2025-11-15 13:00:33 -08:00
vector_stores.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00