mudler/LocalAI · error

1

1

Error message

[omnivoice-cpp] ERROR: model_path is required\n

What it means

omni_load() rejects the call because model_path is NULL or empty (return code 1). Pure argument validation before ov_init: the OmniVoice main model path is mandatory. ggml backend loading (ggml_backend_load_all) has run, but nothing else.

Source

Thrown at backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp:33

    const char *lvl = "?????";
    switch (level) {
    case GGML_LOG_LEVEL_DEBUG: lvl = "DEBUG"; break;
    case GGML_LOG_LEVEL_INFO:  lvl = "INFO";  break;
    case GGML_LOG_LEVEL_WARN:  lvl = "WARN";  break;
    case GGML_LOG_LEVEL_ERROR: lvl = "ERROR"; break;
    default: break;
    }
    fprintf(stderr, "[%-5s] %s", lvl, log);
    fflush(stderr);
}

int omni_load(const char *model_path, const char *codec_path, int use_fa,
              int clamp_fp16) {
    ggml_log_set(ggml_log_cb, nullptr);
    ggml_backend_load_all();

    if (!model_path || model_path[0] == '\0') {
        fprintf(stderr, "[omnivoice-cpp] ERROR: model_path is required\n");
        return 1;
    }
    if (!codec_path || codec_path[0] == '\0') {
        fprintf(stderr, "[omnivoice-cpp] ERROR: codec_path is required\n");
        return 2;
    }

    ov_init_params p;
    ov_init_default_params(&p);
    p.model_path = model_path;
    p.codec_path = codec_path;
    p.use_fa = use_fa != 0;
    p.clamp_fp16 = clamp_fp16 != 0;

    fprintf(stderr, "[omnivoice-cpp] Loading model=%s codec=%s\n", model_path,
            codec_path);

    g_ctx = ov_init(&p);

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Configure a valid model_path in the backend options.
  2. Add a Go-side guard for empty strings before the FFI call.

Example fix

// before
rc := C.omni_load(C.CString(""), codec, 1, 0)
// after
if modelPath == "" { return errors.New("omnivoice-cpp: model path required") }
rc := C.omni_load(C.CString(modelPath), codec, 1, 0)
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(modelPath) == "" {
    return errors.New("omnivoice-cpp: model_path is required")
}

Prevention

When it happens

Trigger: Calling omni_load("", codec, use_fa, clamp_fp16) — model path unset in the backend configuration or a nil pointer passed from Go.

Common situations: LocalAI config for omnivoice-cpp missing the model file key; template path not expanded; caller passes empty options struct.

Related errors


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