]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
app : show version (#23426)
authorAdrien Gallouët <redacted>
Thu, 21 May 2026 04:21:13 +0000 (06:21 +0200)
committerGitHub <redacted>
Thu, 21 May 2026 04:21:13 +0000 (06:21 +0200)
Signed-off-by: Adrien Gallouët <redacted>
app/llama.cpp

index 10f909e2f3b4437d64c653766a8a30163c81ca37..55aa8ca5ee074b966d63a1153662093a3d4d5061 100644 (file)
@@ -1,3 +1,5 @@
+#include "build-info.h"
+
 #include <cstdio>
 #include <string>
 #include <vector>
@@ -9,6 +11,7 @@ int llama_cli(int argc, char ** argv);
 int llama_completion(int argc, char ** argv);
 int llama_bench(int argc, char ** argv);
 static int help(int argc, char ** argv);
+static int version(int argc, char ** argv);
 
 struct command {
     const char * name;
@@ -23,9 +26,15 @@ static const command cmds[] = {
     {"cli",        "Command-line interactive interface", {"client"},   false, llama_cli        },
     {"completion", "Text completion",                    {"complete"}, true,  llama_completion },
     {"bench",      "Benchmarking tool",                  {},           true,  llama_bench      },
+    {"version",    "Show version",                       {},           true,  version          },
     {"help",       "Show available commands",            {},           true,  help             },
 };
 
+static int version(int argc, char ** argv) {
+    printf("%s\n", llama_build_info());
+    return 0;
+}
+
 static int help(int argc, char ** argv) {
     const bool show_all = argc >= 2 && std::string(argv[1]) == "all";