diff --git a/common/arg.cpp b/common/arg.cpp index d82f55890dee5..c58c057d63e87 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -1307,6 +1307,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex [](common_params &) { fprintf(stderr, "version: %d (%s)\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT); fprintf(stderr, "built with %s for %s\n", LLAMA_COMPILER, LLAMA_BUILD_TARGET); + fprintf(stderr, "ggml version: %s\n", llama_ggml_version()); exit(0); } )); diff --git a/include/llama.h b/include/llama.h index c5622cc16b4c2..d1b0f8cc80269 100644 --- a/include/llama.h +++ b/include/llama.h @@ -375,6 +375,9 @@ extern "C" { // lora adapter struct llama_adapter_lora; + LLAMA_API const char * llama_ggml_version(void); + LLAMA_API const char * llama_ggml_commit(void); + // Helpers for getting default parameters // TODO: update API to start accepting pointers to params structs (https://github.com/ggml-org/llama.cpp/discussions/9172) LLAMA_API struct llama_model_params llama_model_default_params(void); diff --git a/src/llama.cpp b/src/llama.cpp index 34906cdb62844..1ad95463403f9 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -356,3 +356,11 @@ const char * llama_print_system_info(void) { return s.c_str(); } +const char * llama_ggml_version(void) { + return ggml_version(); +} + +const char * llama_ggml_commit(void) { + return ggml_commit(); +} +