danny-avila/LibreChat · warning

Multiple providers are set. Please set only one provider.

Error message

Multiple providers are set. Please set only one provider.

What it means

getProvider filters ttsSchema entries (excluding `allowedAddresses`) for non-empty objects and requires exactly one. If two or more providers are populated (e.g. openai AND elevenlabs), it throws because it cannot pick.

Source

Thrown at api/server/services/Files/Audio/TTSService.js:60

  /**
   * Retrieves the configured TTS provider.
   * @param {AppConfig | null | undefined} [appConfig] - The app configuration object.
   * @returns {string} The name of the configured provider.
   * @throws {Error} If no provider is set or multiple providers are set.
   */
  getProvider(appConfig) {
    const ttsSchema = appConfig?.speech?.tts;
    if (!ttsSchema) {
      throw new Error(
        'No TTS schema is set. Did you configure TTS in the custom config (librechat.yaml)?',
      );
    }
    const providers = Object.entries(ttsSchema).filter(
      ([key, value]) => key !== 'allowedAddresses' && Object.keys(value).length > 0,
    );

    if (providers.length !== 1) {
      throw new Error(
        providers.length > 1
          ? 'Multiple providers are set. Please set only one provider.'
          : 'No provider is set. Please set a provider.',
      );
    }
    return providers[0][0];
  }

  /**
   * Selects a voice for TTS based on provider schema and request.
   * @async
   * @param {Object} providerSchema - The schema for the selected provider.
   * @param {string} requestVoice - The requested voice.
   * @returns {Promise<string>} The selected voice.
   */
  async getVoice(providerSchema, requestVoice) {
    const voices = providerSchema.voices.filter((voice) => voice && voice.toUpperCase() !== 'ALL');
    let voice = requestVoice;

View on GitHub (pinned to 5ff282f900)

Solutions

  1. Keep only one populated provider under speech.tts; empty or remove the rest.
  2. Reload the config / restart the API server.

Example fix

# before
speech:
  tts:
    openai: { apiKey: '...' }
    elevenlabs: { apiKey: '...' }

# after
speech:
  tts:
    elevenlabs: { apiKey: '...', voices: ['...'] }
Defensive patterns

Strategy: validation

Validate before calling

const providers = Object.entries(appConfig.speech.tts || {})
  .filter(([k, v]) => k !== 'allowedAddresses' && v && Object.keys(v).length > 0);
if (providers.length > 1) {
  throw new Error(`Multiple TTS providers configured: ${providers.map(p => p[0]).join(', ')}`);
}

Prevention

When it happens

Trigger: librechat.yaml `speech.tts` has more than one provider block populated with at least one field each.

Common situations: Example config pasted with two providers; switched providers without removing the old block; default + override both populated.

Related errors


AI-assisted analysis of danny-avila/LibreChat@5ff282f900 (2026-08-12). Data as JSON: /api/errors/48118a6aed395764. Report an issue: GitHub.