{"record":{"id":"22ed774aae849ec7","repo":"mudler/LocalAI","slug":"1","errorCode":"1","errorMessage":"[omnivoice-cpp] ERROR: model_path is required\\n","messagePattern":"\\[omnivoice-cpp\\] ERROR: model_path is required\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp","lineNumber":33,"sourceCode":"    const char *lvl = \"?????\";\n    switch (level) {\n    case GGML_LOG_LEVEL_DEBUG: lvl = \"DEBUG\"; break;\n    case GGML_LOG_LEVEL_INFO:  lvl = \"INFO\";  break;\n    case GGML_LOG_LEVEL_WARN:  lvl = \"WARN\";  break;\n    case GGML_LOG_LEVEL_ERROR: lvl = \"ERROR\"; break;\n    default: break;\n    }\n    fprintf(stderr, \"[%-5s] %s\", lvl, log);\n    fflush(stderr);\n}\n\nint omni_load(const char *model_path, const char *codec_path, int use_fa,\n              int clamp_fp16) {\n    ggml_log_set(ggml_log_cb, nullptr);\n    ggml_backend_load_all();\n\n    if (!model_path || model_path[0] == '\\0') {\n        fprintf(stderr, \"[omnivoice-cpp] ERROR: model_path is required\\n\");\n        return 1;\n    }\n    if (!codec_path || codec_path[0] == '\\0') {\n        fprintf(stderr, \"[omnivoice-cpp] ERROR: codec_path is required\\n\");\n        return 2;\n    }\n\n    ov_init_params p;\n    ov_init_default_params(&p);\n    p.model_path = model_path;\n    p.codec_path = codec_path;\n    p.use_fa = use_fa != 0;\n    p.clamp_fp16 = clamp_fp16 != 0;\n\n    fprintf(stderr, \"[omnivoice-cpp] Loading model=%s codec=%s\\n\", model_path,\n            codec_path);\n\n    g_ctx = ov_init(&p);","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp#L15-L51","documentation":"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.","triggerScenarios":"Calling omni_load(\"\", codec, use_fa, clamp_fp16) — model path unset in the backend configuration or a nil pointer passed from Go.","commonSituations":"LocalAI config for omnivoice-cpp missing the model file key; template path not expanded; caller passes empty options struct.","solutions":["Configure a valid model_path in the backend options.","Add a Go-side guard for empty strings before the FFI call."],"exampleFix":"// before\nrc := C.omni_load(C.CString(\"\"), codec, 1, 0)\n// after\nif modelPath == \"\" { return errors.New(\"omnivoice-cpp: model path required\") }\nrc := C.omni_load(C.CString(modelPath), codec, 1, 0)","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(modelPath) == \"\" {\n    return errors.New(\"omnivoice-cpp: model_path is required\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate both omni_load paths before the FFI call.","Map return codes 1/2/3 to explicit configuration error messages."],"tags":["omnivoice-cpp","tts","argument-validation","model-loading"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}