Mintplex-Labs/anything-llm · error · Error
No NVIDIA NIM API Base Path was set.
Error message
No NVIDIA NIM API Base Path was set.
What it means
NvidiaNimLLM's constructor throws when process.env.NVIDIA_NIM_LLM_BASE_PATH is falsy. The base path (parsed via parseNvidiaNimBasePath) points at a self-hosted NVIDIA NIM inference server's OpenAI-compatible endpoint, and without it there is no endpoint to build the client against, so the provider cannot be constructed at all.
Solutions
- Set NVIDIA_NIM_LLM_BASE_PATH to the NIM server endpoint, e.g. http://localhost:8000/v1
- Restart the AnythingLLM server or container
- Verify the NIM server is up: curl http://localhost:8000/v1/models
- In Docker, ensure the variable (and host networking if NIM runs locally) is configured
Example fix
# before # (NVIDIA_NIM_LLM_BASE_PATH not set) # after NVIDIA_NIM_LLM_BASE_PATH=http://localhost:8000/v1
Defensive patterns
Strategy: validation
Validate before calling
if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)
throw new Error('NVIDIA NIM selected but NVIDIA_NIM_LLM_BASE_PATH is not configured');
const llm = new NvidiaNimLLM(embedder); Try / catch
try {
const llm = new NvidiaNimLLM(embedder);
} catch (e) {
if (e.message === 'No NVIDIA NIM API Base Path was set.')
return respondConfigError(e); // set base path, restart, do not retry
throw e;
} Prevention
- Set NVIDIA_NIM_LLM_BASE_PATH (e.g. http://localhost:8000/v1) before selecting NIM
- Health-check GET $NVIDIA_NIM_LLM_BASE_PATH/models at startup
- In Docker, mind host networking when NIM runs on the host
When it happens
Trigger: Selecting NVIDIA NIM as the LLM provider with NVIDIA_NIM_LLM_BASE_PATH unset, empty, or typo'd; .env edited but the server not restarted; Docker deployments where the variable was not passed in.
Common situations: NIM container reachable but the env var never configured; variable name typos (NVIDIA_NIM_BASE_PATH, NIM_LLM_BASE_PATH); forgetting that env changes require a restart.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- No NVIDIA NIM token context limit was set.
- KoboldCPP must have a valid base path to use for the api.
- LiteLLM must have a valid base path to use for the api.
- No Lemonade API Base Path was set.
- No LMStudio API Base Path was set.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/fedcd3a6094a606d.
Report an issue: GitHub.
Appendix: 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 3aec848f28)