mudler/LocalAI · info

WARNING: LoRA model directory not set. LoRAs in prompts will

Error message

WARNING: LoRA model directory not set. LoRAs in prompts will not be loaded.\n

What it means

Informational warning at model load: no lora_dir option was provided, so lora_dir_path stays empty and any <lora:...> tags found in prompts at generation time cannot be loaded (they will be stripped with the 'LoRA directory not set' warning). Model load itself is unaffected.

Source

Thrown at backend/go/stablediffusion-ggml/cpp/gosd.cpp:610

    ctx_params.clip_vision_path = clip_vision_path;
    ctx_params.t5xxl_path = t5xxl_path;
    ctx_params.llm_path = llm_path;
    ctx_params.llm_vision_path = llm_vision_path;
    ctx_params.diffusion_model_path = diffusion_model_path;
    ctx_params.high_noise_diffusion_model_path = high_noise_diffusion_model_path;
    ctx_params.uncond_diffusion_model_path = uncond_diffusion_model_path;
    ctx_params.vae_path = vae_path;
    ctx_params.audio_vae_path = audio_vae_path;
    ctx_params.embeddings_connectors_path = embeddings_connectors_path;
    ctx_params.taesd_path = taesd_path;
    ctx_params.control_net_path = control_net_path;
    if (lora_dir && strlen(lora_dir) > 0) {
        lora_dir_path = std::string(lora_dir);
        fprintf(stderr, "LoRA model directory set to: %s\n", lora_dir);
        // Discover LoRAs at load time for logging
        discover_lora_files(lora_dir);
    } else {
        fprintf(stderr, "WARNING: LoRA model directory not set. LoRAs in prompts will not be loaded.\n");
    }
    // Set embeddings array and count
    ctx_params.embeddings = embedding_vec.empty() ? NULL : embedding_vec.data();
    ctx_params.embedding_count = static_cast<uint32_t>(embedding_vec.size());
    ctx_params.photo_maker_path = photo_maker_path;
    if (strlen(pulid_weights_path) > 0) ctx_params.pulid_weights_path = pulid_weights_path;
    ctx_params.tensor_type_rules = tensor_type_rules;
    ctx_params.n_threads = n_threads;
    ctx_params.rng_type = rng_type;
    if (wtype != SD_TYPE_COUNT) ctx_params.wtype = wtype;
    if (sampler_rng_type != RNG_TYPE_COUNT) ctx_params.sampler_rng_type = sampler_rng_type;
    if (prediction != PREDICTION_COUNT) ctx_params.prediction = prediction;
    if (lora_apply_mode != LORA_APPLY_MODE_COUNT) ctx_params.lora_apply_mode = lora_apply_mode;
    // Backend / parameter placement specs. Upstream replaced the boolean
    // CPU-offload knobs (offload_params_to_cpu, keep_clip_on_cpu, keep_vae_on_cpu,
    // keep_control_net_on_cpu) with these specs. Seed from the explicit
    // backend/params_backend options, then prepend the legacy boolean-derived
    // assignments, mirroring prepare_backend_assignments() in the upstream CLI.

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Add lora_dir=<path> to the model options if you plan to use LoRA tags in prompts
  2. If LoRAs are not used, ignore the warning
  3. Pre-download LoRA files into that directory so name-based tag lookup works

Example fix

# before
options: "model=/models/sd.safetensors,vae=/models/vae.safetensors"

# after
options: "model=/models/sd.safetensors,vae=/models/vae.safetensors,lora_dir=/models/loras"
Defensive patterns

Strategy: validation

Validate before calling

// Go caller: require lora_dir when prompts may contain LoRA tags
if promptMayContainLoras && opts.LoraDir == "" {
    return fmt.Errorf("lora_dir not configured; LoRA tags in prompts would be ignored")
}

Prevention

When it happens

Trigger: Loading a stablediffusion-ggml model without a lora_dir key=value in the options string, while later prompts may contain LoRA tags.

Common situations: Minimal or default model gallery configs that only set model/vae paths; users unaware that LoRA support must be enabled by pointing at a directory.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/baa156e866c701b4. Report an issue: GitHub.