{"record":{"id":"866e63f611e29cd4","repo":"BerriAI/litellm","slug":"nvidia-riva-requires-api-base-host-port-for-the","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"http","errorClass":"NvidiaRivaException","httpStatus":400,"severity":"error","filePath":"litellm/llms/nvidia_riva/audio_transcription/handler.py","lineNumber":158,"sourceCode":"            atranscription=True,\n        )\n\n    def _run_sync(\n        self,\n        model: str,\n        audio_file: FileTypes,\n        optional_params: dict,\n        litellm_params: dict,\n        model_response: TranscriptionResponse,\n        timeout: float,\n        logging_obj: \"LiteLLMLoggingObj\",\n        api_key: str | None,\n        api_base: str | None,\n        provider_config: NvidiaRivaAudioTranscriptionConfig,\n        atranscription: bool = False,\n    ) -> TranscriptionResponse:\n        if not api_base:\n            raise NvidiaRivaException(\n                status_code=400,\n                message=(\n                    \"NVIDIA Riva requires `api_base` (host:port for the gRPC \"\n                    \"endpoint, e.g. `grpc.nvcf.nvidia.com:443` or \"\n                    \"`localhost:50051`). Set it in litellm_params or via \"\n                    \"NVIDIA_RIVA_API_BASE.\"\n                ),\n            )\n\n        processed: Final = process_audio_file(audio_file)\n        resampled: Final = resample_to_riva_pcm(processed.file_content)\n\n        request_payload: Final = provider_config.transform_audio_transcription_request(\n            model=model,\n            audio_file=audio_file,\n            optional_params=optional_params,\n            litellm_params={\n                **litellm_params,","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/nvidia_riva/audio_transcription/handler.py#L140-L176","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\nlitellm.transcription(\n  model='riva/nvidia-parakeet-usa-v2',\n  audio_file=open('a.wav','rb'),\n)\n\n// after\nlitellm.transcription(\n  model='riva/nvidia-parakeet-usa-v2',\n  audio_file=open('a.wav','rb'),\n  api_base='grpc.nvcf.nvidia.com:443',  # or set NVIDIA_RIVA_API_BASE\n)","handlingStrategy":"validation","validationCode":"import os\n\nRIVA_API_BASE = os.getenv('NVIDIA_RIVA_API_BASE', 'grpc.nvcf.nvidia.com:443')\nassert RIVA_API_BASE, 'Set NVIDIA_RIVA_API_BASE (host:port) before calling Riva transcription'\n\nlitellm.transcription(\n    model='riva/nvidia-parakeet-usa-v2',\n    audio_file=f,\n    api_base=RIVA_API_BASE,\n)","typeGuard":"def has_riva_endpoint(litellm_params: dict, env: dict[str, str]) -> bool:\n    \"\"\"True when a non-empty api_base is reachable for Riva.\"\"\"\n    base = litellm_params.get('api_base') or env.get('NVIDIA_RIVA_API_BASE')\n    return isinstance(base, str) and bool(base.strip())","tryCatchPattern":null,"preventionTips":["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."],"tags":["configuration","nvidia-riva","speech-to-text","grpc","missing-parameter"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}