BerriAI/litellm · error · NvidiaRivaException
NVIDIA Riva requires `api_base` (host:port for the gRPC endp
Error message
NVIDIA Riva requires `api_base` (host:port for the gRPC endpoint, e.g. `grpc.nvcf.nvidia.com:443` or `localhost:50051`). Set it in litellm_params or via NVIDIA_RIVA_API_BASE.
What it means
LiteLLM's NVIDIA Riva audio transcription provider requires an explicit gRPC endpoint address because, unlike HTTP providers, there is no usable default host. Before transcribing, the handler checks that `api_base` resolved to a non-empty string (from litellm_params or the NVIDIA_RIVA_API_BASE env var) and raises NvidiaRivaException(400) when it did not. This is a configuration error that happens client-side, before any network call.
Source
Thrown at litellm/llms/nvidia_riva/audio_transcription/handler.py:158
atranscription=True,
)
def _run_sync(
self,
model: str,
audio_file: FileTypes,
optional_params: dict,
litellm_params: dict,
model_response: TranscriptionResponse,
timeout: float,
logging_obj: "LiteLLMLoggingObj",
api_key: str | None,
api_base: str | None,
provider_config: NvidiaRivaAudioTranscriptionConfig,
atranscription: bool = False,
) -> TranscriptionResponse:
if not api_base:
raise NvidiaRivaException(
status_code=400,
message=(
"NVIDIA Riva requires `api_base` (host:port for the gRPC "
"endpoint, e.g. `grpc.nvcf.nvidia.com:443` or "
"`localhost:50051`). Set it in litellm_params or via "
"NVIDIA_RIVA_API_BASE."
),
)
processed: Final = process_audio_file(audio_file)
resampled: Final = resample_to_riva_pcm(processed.file_content)
request_payload: Final = provider_config.transform_audio_transcription_request(
model=model,
audio_file=audio_file,
optional_params=optional_params,
litellm_params={
**litellm_params,View on GitHub (pinned to 6c2dcb801b)
Solutions
- Pass the endpoint in the model config: model_list entry with litellm_params.api_base = 'grpc.nvcf.nvidia.com:443' (or your self-hosted 'localhost:50051').
- Or export the environment variable: export NVIDIA_RIVA_API_BASE='grpc.nvcf.nvidia.com:443'.
- Verify the value actually reaches litellm_params — print the resolved `api_base` in a debug call before the real one.
- For self-hosted Riva, confirm the host:port matches the gRPC server (default 50051), not the HTTP port.
Example fix
// before
litellm.transcription(
model='riva/nvidia-parakeet-usa-v2',
audio_file=open('a.wav','rb'),
)
// after
litellm.transcription(
model='riva/nvidia-parakeet-usa-v2',
audio_file=open('a.wav','rb'),
api_base='grpc.nvcf.nvidia.com:443', # or set NVIDIA_RIVA_API_BASE
) Defensive patterns
Strategy: validation
Validate before calling
import os
RIVA_API_BASE = os.getenv('NVIDIA_RIVA_API_BASE', 'grpc.nvcf.nvidia.com:443')
assert RIVA_API_BASE, 'Set NVIDIA_RIVA_API_BASE (host:port) before calling Riva transcription'
litellm.transcription(
model='riva/nvidia-parakeet-usa-v2',
audio_file=f,
api_base=RIVA_API_BASE,
) Type guard
def has_riva_endpoint(litellm_params: dict, env: dict[str, str]) -> bool:
"""True when a non-empty api_base is reachable for Riva."""
base = litellm_params.get('api_base') or env.get('NVIDIA_RIVA_API_BASE')
return isinstance(base, str) and bool(base.strip()) Prevention
- Centralize provider config: one dataclass/dict per provider with required fields validated at app startup, not per call.
- Fail fast at boot: if any configured model starts with 'riva/', assert the endpoint variable is present during initialization.
- Include api_base in the same secret/config store entry as the Riva API key so they are deployed together.
When it happens
Trigger: Calling `litellm.transcription(model='riva/...', audio_file=...)` (or atranscription) without `api_base` in litellm_params and without the NVIDIA_RIVA_API_BASE environment variable set. Also triggered when api_base is set to an empty string, None, or a key name that LiteLLM does not map to api_base (e.g. passing it as a top-level kwarg that never reaches litellm_params).
Common situations: Copying an example that omits the endpoint; assuming the NVIDIA_API_KEY/NVIDIA_NIM patterns also supply a Riva host; setting `NVIDIA_RIVA_API_BASE` in a different shell than the one running the app (env var not visible); deploying on a host that only has the API key configured via a secret manager while the endpoint was only set locally.
Related errors
- Missing Azure AI API Base - Set AZURE_AI_API_BASE environmen
- Azure AI API Base is required. api_base=None. Set in call or
- api_base is required
- api_base is required
- NVIDIA Riva client is not installed. Install with `pip insta
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/866e63f611e29cd4.
Report an issue: GitHub.