{"record":{"id":"fedcd3a6094a606d","repo":"Mintplex-Labs/anything-llm","slug":"no-nvidia-nim-api-base-path-was-set","errorCode":null,"errorMessage":"No NVIDIA NIM API Base Path was set.","messagePattern":"No NVIDIA NIM API Base Path was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/nvidiaNim/index.js","lineNumber":13,"sourceCode":"const { NativeEmbedder } = require(\"../../EmbeddingEngines/native\");\nconst {\n  LLMPerformanceMonitor,\n} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\nconst {\n  handleDefaultStreamResponseV2,\n  formatChatHistory,\n} = require(\"../../helpers/chat/responses\");\n\nclass NvidiaNimLLM {\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)\n      throw new Error(\"No NVIDIA NIM API Base Path was set.\");\n\n    this.className = \"NvidiaNimLLM\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.nvidiaNim = new OpenAIApi({\n      baseURL: parseNvidiaNimBasePath(process.env.NVIDIA_NIM_LLM_BASE_PATH),\n      apiKey: null,\n    });\n\n    this.model = modelPreference || process.env.NVIDIA_NIM_LLM_MODEL_PREF;\n    this.limits = {\n      history: this.promptWindowLimit() * 0.15,\n      system: this.promptWindowLimit() * 0.15,\n      user: this.promptWindowLimit() * 0.7,\n    };\n\n    this.embedder = embedder ?? new NativeEmbedder();\n    this.defaultTemp = 0.7;\n    this.#log(","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/AiProviders/nvidiaNim/index.js#L1-L31","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n# (NVIDIA_NIM_LLM_BASE_PATH not set)\n# after\nNVIDIA_NIM_LLM_BASE_PATH=http://localhost:8000/v1","handlingStrategy":"validation","validationCode":"if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)\n  throw new Error('NVIDIA NIM selected but NVIDIA_NIM_LLM_BASE_PATH is not configured');\nconst llm = new NvidiaNimLLM(embedder);","typeGuard":null,"tryCatchPattern":"try {\n  const llm = new NvidiaNimLLM(embedder);\n} catch (e) {\n  if (e.message === 'No NVIDIA NIM API Base Path was set.')\n    return respondConfigError(e); // set base path, restart, do not retry\n  throw e;\n}","preventionTips":["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"],"tags":["nvidia-nim","anythingllm","base-url","environment-variables","configuration"],"backgroundTag":"missing-env-var","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}