mudler/LocalAI · critical

[acestep-cpp] FATAL: cannot read GGUF metadata from %s\n

Error message

[acestep-cpp] FATAL: cannot read GGUF metadata from %s\n

What it means

acestep-cpp fatal: gf_load() could not open/parse the DiT GGUF even at the metadata level, so neither is_turbo nor silence_latent can be read; load_model returns 2. Distinct from error 155 (file readable, tensor missing) — here the file itself is unreadable as GGUF.

Source

Thrown at backend/go/acestep-cpp/cpp/goacestepcpp.cpp:99

    // Read DiT GGUF metadata + silence_latent
    {
        GGUFModel gf = {};
        if (gf_load(&gf, dit_model_path)) {
            g_is_turbo           = gf_get_bool(gf, "acestep.is_turbo");
            const void * sl_data = gf_get_data(gf, "silence_latent");
            if (sl_data) {
                g_silence_full.resize(15000 * 64);
                memcpy(g_silence_full.data(), sl_data, 15000 * 64 * sizeof(float));
                fprintf(stderr, "[acestep-cpp] silence_latent: [15000, 64] loaded\n");
            } else {
                fprintf(stderr, "[acestep-cpp] FATAL: silence_latent not found in %s\n", dit_model_path);
                gf_close(&gf);
                return 2;
            }
            gf_close(&gf);
        } else {
            fprintf(stderr, "[acestep-cpp] FATAL: cannot read GGUF metadata from %s\n", dit_model_path);
            return 2;
        }
    }

    // Load VAE model
    fprintf(stderr, "[acestep-cpp] Loading VAE from %s\n", vae_model_path);
    vae_ggml_load(&g_vae, vae_model_path);
    g_vae_loaded = true;

    fprintf(stderr, "[acestep-cpp] All models loaded successfully (turbo=%d)\n", g_is_turbo);
    return 0;
}

int generate_music(const char * caption, const char * lyrics, int bpm,
                   const char * keyscale, const char * timesignature,
                   float duration, float temperature, bool instrumental,
                   int seed, const char * dst, int threads) {
    if (!g_dit_loaded || !g_vae_loaded) {

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Verify the path: ls -l and file <dit_model_path> — it must be a regular, GGUF-magic file of the expected size.
  2. Re-download from the canonical gallery URL and checksum before use.
  3. Fix container mounts/volume paths so the backend sees the same file you validated.

Example fix

# before
$ file models/dit.gguf
models/dit.gguf: HTML document   # failed download -> FATAL cannot read GGUF metadata

# after
$ file models/dit.gguf
models/dit.gguf: data   # GGUF magic present, expected size -> loads
Defensive patterns

Strategy: validation

Validate before calling

# accept only well-formed GGUF files of the expected size
file "$DIT" | grep -q 'data' || { echo 'not a GGUF: '"$DIT" >&2; exit 1; }
[ "$(stat -c%s "$DIT")" -eq "$EXPECTED_BYTES" ] || { echo 'size mismatch' >&2; exit 1; }

Type guard

bool is_gguf_file(const char *path) {
    FILE *f = fopen(path, "rb");
    if (!f) return false;
    char magic[4] = {0};
    bool ok = fread(magic, 1, 4, f) == 4 && memcmp(magic, "GGUF", 4) == 0;
    fclose(f);
    return ok;
}

Prevention

When it happens

Trigger: dit_model_path is a nonexistent path, a directory, an empty/truncated file (interrupted download), or a non-GGUF file (e.g. a safetensors or HTML error page saved by a failed fetch); gf_load fails outright.

Common situations: curl failures saving 404 pages as model files; partial uploads to model storage; wrong mount paths in containers; file corrupted in transfer.

Related errors


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