diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cpp index 70ebcc225e3..c7835a1518b 100644 --- a/tools/server/server-context.cpp +++ b/tools/server/server-context.cpp @@ -759,6 +759,11 @@ struct server_context_impl { return false; } + if (ctx == nullptr) { + SRV_ERR("failed to create context for model, '%s'\n", params_base.model.path.c_str()); + return false; + } + vocab = llama_model_get_vocab(model); n_ctx = llama_n_ctx(ctx);