Mintplex-Labs/anything-llm · critical · Error
No NVIDIA NIM API Base Path was set.
Error message
No NVIDIA NIM API Base Path was set.
What it means
Constructor guard for NvidiaNimLLM: throws if process.env.NVIDIA_NIM_LLM_BASE_PATH is absent. Unlike cloud providers, NIM is self-hosted and uses apiKey: null — authentication is handled by the endpoint itself, so the only required config is the base path (parsed by parseNvidiaNimBasePath). Without it the adapter cannot be built.
Source
Thrown at server/utils/AiProviders/nvidiaNim/index.js:13
const { NativeEmbedder } = require("../../EmbeddingEngines/native");
const {
LLMPerformanceMonitor,
} = require("../../helpers/chat/LLMPerformanceMonitor");
const {
handleDefaultStreamResponseV2,
formatChatHistory,
} = require("../../helpers/chat/responses");
class NvidiaNimLLM {
constructor(embedder = null, modelPreference = null) {
if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)
throw new Error("No NVIDIA NIM API Base Path was set.");
this.className = "NvidiaNimLLM";
const { OpenAI: OpenAIApi } = require("openai");
this.nvidiaNim = new OpenAIApi({
baseURL: parseNvidiaNimBasePath(process.env.NVIDIA_NIM_LLM_BASE_PATH),
apiKey: null,
});
this.model = modelPreference || process.env.NVIDIA_NIM_LLM_MODEL_PREF;
this.limits = {
history: this.promptWindowLimit() * 0.15,
system: this.promptWindowLimit() * 0.15,
user: this.promptWindowLimit() * 0.7,
};
this.embedder = embedder ?? new NativeEmbedder();
this.defaultTemp = 0.7;
this.#log(View on GitHub (pinned to 526360e320)
Solutions
- Set NVIDIA_NIM_LLM_BASE_PATH to the NIM endpoint URL (e.g. http://host:8000/v1).
- Confirm the endpoint is reachable from the AnythingLLM process (network/firewall).
- Restart the server to reload env.
- Verify parseNvidiaNimBasePath accepts your URL format.
Example fix
// server/.env NVIDIA_NIM_LLM_BASE_PATH=http://localhost:8000/v1 NVIDIA_NIM_LLM_MODEL_PREF=meta/llama-3.1-8b-instruct
Defensive patterns
Strategy: validation
Validate before calling
if (!process.env.NVIDIA_NIM_LLM_BASE_PATH) {
throw new Error('NVIDIA_NIM_LLM_BASE_PATH missing — point it at your self-hosted NIM endpoint.');
} Try / catch
try {
const llm = new NvidiaNimLLM(embedder, modelPref);
} catch (e) {
if (/No NVIDIA NIM API Base Path/i.test(e.message)) {
// config error — set the NIM endpoint URL
}
} Prevention
- Treat NIM base path as required infra config — validate it in the provider factory.
- Confirm endpoint reachability from the app host (firewall/DNS).
- Document the expected URL form (scheme://host:port[/v1]).
When it happens
Trigger: Instantiating `new NvidiaNimLLM(...)` without NVIDIA_NIM_LLM_BASE_PATH set — i.e. selecting the NVIDIA NIM provider without pointing it at a running NIM endpoint.
Common situations: First-time self-hosted NIM setup; NIM endpoint moved port/host; env var not propagated to the container; .env typo (e.g. NVIDIA_NIM_BASE_PATH without _LLM).
Related errors
- No Privatemode Base Path was set.
- TextGenWebUI must have a valid base path to use for the api.
- No Lemonade API Base Path was set.
- LiteLLM must have a valid base path to use for the api.
- No LMStudio API Base Path was set.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/fedcd3a6094a606d.
Report an issue: GitHub.