Mintplex-Labs/anything-llm · error · Error
NVIDIA NIM base path must be provided to use agents.
Error message
NVIDIA NIM base path must be provided to use agents.
What it means
Thrown by AgentHandler.checkSetup() (server/utils/agents/index.js:230) when the workspace agent provider is 'nvidia-nim' but NVIDIA_NIM_LLM_BASE_PATH is unset/empty. NVIDIA NIM can be the hosted integrate.api.nvidia.com endpoint or a self-hosted NIM container, so AnythingLLM validates the base URL rather than a key.
Source
Thrown at server/utils/agents/index.js:231
case "apipie":
if (!process.env.APIPIE_LLM_API_KEY)
throw new Error("ApiPie API Key must be provided to use agents.");
break;
case "xai":
if (!process.env.XAI_LLM_API_KEY)
throw new Error("xAI API Key must be provided to use agents.");
break;
case "zai":
if (!process.env.ZAI_API_KEY)
throw new Error("Z.AI API Key must be provided to use agents.");
break;
case "novita":
if (!process.env.NOVITA_LLM_API_KEY)
throw new Error("Novita API Key must be provided to use agents.");
break;
case "nvidia-nim":
if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)
throw new Error(
"NVIDIA NIM base path must be provided to use agents."
);
break;
case "ppio":
if (!process.env.PPIO_API_KEY)
throw new Error("PPIO API Key must be provided to use agents.");
break;
case "gemini":
if (!process.env.GEMINI_API_KEY)
throw new Error("Gemini API key must be provided to use agents.");
break;
case "moonshotai":
if (!process.env.MOONSHOT_AI_MODEL_PREF)
throw new Error("Moonshot AI model must be set to use agents.");
break;
case "cometapi":
if (!process.env.COMETAPI_LLM_API_KEY)
throw new Error("CometAPI API Key must be provided to use agents.");View on GitHub (pinned to 526360e320)
Solutions
- Set NVIDIA_NIM_LLM_BASE_PATH in .env to the NIM endpoint (hosted: https://integrate.api.nvidia.com/v1; self-hosted: http://<host>:8000/v1).
- For the hosted endpoint, also set NVIDIA_NIM_LLM_API_KEY; the base-path guard does not check it but later calls will 401 without it.
- Restart AnythingLLM so process.env reloads.
- Confirm with curl <base path>/models (add Authorization for the hosted endpoint).
Example fix
// before (.env) // NVIDIA_NIM_LLM_BASE_PATH= // NVIDIA_NIM_LLM_API_KEY= // after (.env) - hosted NVIDIA_NIM_LLM_BASE_PATH=https://integrate.api.nvidia.com/v1 NVIDIA_NIM_LLM_API_KEY=nvapi-...your-key
Defensive patterns
Strategy: validation
Validate before calling
const base = process.env.NVIDIA_NIM_LLM_BASE_PATH;
if (!base) {
throw new Error(
'Cannot start NVIDIA NIM agent: set NVIDIA_NIM_LLM_BASE_PATH (hosted https://integrate.api.nvidia.com/v1 or self-hosted http://<host>:8000/v1) in .env.'
);
}
try { new URL(base); } catch { throw new Error('NVIDIA_NIM_LLM_BASE_PATH is not a valid URL'); }
// Guard checks only base path; warn if the hosted endpoint lacks a key:
if (base.includes('integrate.api.nvidia.com') && !process.env.NVIDIA_NIM_LLM_API_KEY) {
console.warn('Hosted NIM endpoint selected but NVIDIA_NIM_LLM_API_KEY is unset - auth will fail later');
} Try / catch
try {
await agentHandler.start();
} catch (e) {
if (/NVIDIA NIM base path must be provided/.test(e.message)) {
return respondConfigError('nvidia-nim', ['NVIDIA_NIM_LLM_BASE_PATH', 'NVIDIA_NIM_LLM_API_KEY']);
}
throw e;
} Prevention
- The guard checks only the base path; for the hosted endpoint also set NVIDIA_NIM_LLM_API_KEY to avoid a later 401.
- For self-hosted NIM, confirm the container is up and reachable before configuring the provider.
- Restart AnythingLLM after .env edits.
- Add a boot reachability check for the configured base path.
When it happens
Trigger: An agent invocation runs with workspace.agentProvider === 'nvidia-nim' while NVIDIA_NIM_LLM_BASE_PATH is absent from process.env. Path: #providerSetupAndCheck() -> checkSetup() at index.js:476.
Common situations: NVIDIA NIM selected in System > LLM Preference without an endpoint URL; pointing at a self-hosted NIM container that is not running; .env edited but the server not restarted; using the hosted URL without also setting the NVIDIA key, which will fail later on auth even though this guard passes.
Related errors
- Azure OpenAI API endpoint and key must be provided to use ag
- KoboldCPP must have a valid base path to use for the api.
- LocalAI must have a valid base path to use for the api.
- OpenRouter API key must be provided to use agents.
- Mistral API key must be provided to use agents.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/babb7b613fe18450.
Report an issue: GitHub.