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

  1. Set NVIDIA_NIM_LLM_BASE_PATH to the NIM endpoint URL (e.g. http://host:8000/v1).
  2. Confirm the endpoint is reachable from the AnythingLLM process (network/firewall).
  3. Restart the server to reload env.
  4. 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

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


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/fedcd3a6094a606d. Report an issue: GitHub.