Mintplex-Labs/anything-llm · error · Error

No base URL was set.

Error message

No base URL was set.

What it means

Thrown synchronously by the GenericOpenAiWhisper constructor in collector/utils/WhisperProviders/GenericOpenAiWhisper.js:7 when options.WhisperGenericOpenAiBaseUrl is falsy. This provider is for an OpenAI-compatible Whisper endpoint, so without a base URL the OpenAI client cannot be pointed at the custom host. Constructing the class anywhere (transcription pipeline bootstrap) will throw and bubble up to the caller.

Source

Thrown at collector/utils/WhisperProviders/GenericOpenAiWhisper.js:7

const fs = require("fs");

class GenericOpenAiWhisper {
  constructor({ options }) {
    const { OpenAI: OpenAIApi } = require("openai");
    if (!options.WhisperGenericOpenAiBaseUrl)
      throw new Error("No base URL was set.");

    this.openai = new OpenAIApi({
      baseURL: options.WhisperGenericOpenAiBaseUrl,
      apiKey: options.WhisperGenericOpenAiApiKey || null,
    });
    this.model = options.WhisperGenericOpenAiModel || "whisper-small";
    this.temperature = 0;
    this.#log("Initialized.");
  }

  #log(text, ...args) {
    console.log(`\x1b[32m[GenericOpenAiWhisper]\x1b[0m ${text}`, ...args);
  }

  async processFile(fullFilePath) {
    return await this.openai.audio.transcriptions
      .create({
        file: fs.createReadStream(fullFilePath),

View on GitHub (pinned to 526360e320)

Solutions

  1. Set WhisperGenericOpenAiBaseUrl on the options object (e.g. "https://local-whisper.example.com/v1").
  2. If using the AnythingLLM UI, re-open the transcription settings and fill the Base URL field for the Generic OpenAI-compatible provider.
  3. If setting via env, confirm the variable is exported in the collector process and mapped into options.
  4. If you actually meant to use OpenAI-hosted Whisper, switch the provider to OpenAiWhisper instead.

Example fix

// before
new GenericOpenAiWhisper({ options: { WhisperGenericOpenAiBaseUrl: "" } });

// after
new GenericOpenAiWhisper({
  options: {
    WhisperGenericOpenAiBaseUrl: "https://whisper.local/v1",
    WhisperGenericOpenAiApiKey: process.env.WHISPER_KEY,
    WhisperGenericOpenAiModel: "whisper-small",
  },
});
Defensive patterns

Strategy: validation

Validate before calling

function canBuildGenericWhisper(options) {
  return !!(options && typeof options.WhisperGenericOpenAiBaseUrl === "string"
    && options.WhisperGenericOpenAiBaseUrl.trim().length > 0);
}
if (!canBuildGenericWhisper(options)) {
  throw new Error("GenericOpenAiWhisper requires WhisperGenericOpenAiBaseUrl in options");
}
new GenericOpenAiWhisper({ options });

Type guard

/** @param {unknown} o */
function isGenericWhisperConfig(o) {
  return o != null && typeof o === "object"
    && typeof o.WhisperGenericOpenAiBaseUrl === "string"
    && o.WhisperGenericOpenAiBaseUrl.trim().length > 0;
}

Try / catch

// constructor throws synchronously — wrap the instantiation, not just the call site
let provider;
try {
  provider = new GenericOpenAiWhisper({ options });
} catch (e) {
  if (/No base URL was set/.test(e.message)) {
    return surfaceConfigError("Transcription base URL is missing in settings.");
  }
  throw e;
}

Prevention

When it happens

Trigger: Instantiating new GenericOpenAiWhisper({ options }) when the SystemPrompt/LLM preference set has WhisperProvider="GenericOpenAiWhisper" but WhisperGenericOpenAiBaseUrl is empty, undefined, or whitespace in the saved options payload.

Common situations: User selected the Generic OpenAI Whisper provider in settings but did not fill the base URL field; env var feeding the option was not set in the container; option key typo in a custom integration; migration reset the field.

Related errors


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