Skip to content

Commit 48e8f5e

Browse files
committed
feat(inspect gpu command): log prebuilt binaries and cloned source releases
1 parent 7cf77d1 commit 48e8f5e

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

src/cli/commands/inspect/commands/InspectGpuCommand.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import {BuildGpu, LlamaLogLevel} from "../../../../bindings/types.js";
88
import {getPrettyBuildGpuName} from "../../../../bindings/consts.js";
99
import {getModuleVersion} from "../../../../utils/getModuleVersion.js";
1010
import {withCliCommandDescriptionDocsUrl} from "../../../utils/withCliCommandDescriptionDocsUrl.js";
11-
import {documentationPageUrls} from "../../../../config.js";
11+
import {builtinLlamaCppGitHubRepo, documentationPageUrls} from "../../../../config.js";
1212
import {Llama} from "../../../../bindings/Llama.js";
1313
import {getPlatformInfo} from "../../../../bindings/utils/getPlatformInfo.js";
1414
import {getLinuxDistroInfo} from "../../../../bindings/utils/getLinuxDistroInfo.js";
1515
import {isRunningUnderRosetta} from "../../../utils/isRunningUnderRosetta.js";
1616
import {toBytes} from "../../../utils/toBytes.js";
17+
import {getBinariesGithubRelease} from "../../../../bindings/utils/binariesGithubRelease.js";
18+
import {getClonedLlamaCppRepoReleaseInfo} from "../../../../bindings/utils/cloneLlamaCppRepo.js";
1719

1820
type InspectGpuCommand = {
1921
// no options for now
@@ -74,8 +76,33 @@ export const InspectGpuCommand: CommandModule<object, InspectGpuCommand> = {
7476
try {
7577
const moduleVersion = await getModuleVersion();
7678

77-
if (moduleVersion != null)
79+
if (moduleVersion != null) {
80+
console.info();
7881
console.info(`${chalk.yellow("node-llama-cpp:")} ${moduleVersion}`);
82+
}
83+
} catch (err) {
84+
// do nothing
85+
}
86+
87+
try {
88+
const prebuiltBinariesRelease = await getBinariesGithubRelease();
89+
90+
console.info(`${chalk.yellow("Prebuilt binaries:")} ${prebuiltBinariesRelease}`);
91+
} catch (err) {
92+
// do nothing
93+
}
94+
95+
try {
96+
const clonedLlamaCppRelease = await getClonedLlamaCppRepoReleaseInfo();
97+
98+
if (clonedLlamaCppRelease != null)
99+
console.info(
100+
`${chalk.yellow("Cloned source:")} ${clonedLlamaCppRelease.tag}` + (
101+
clonedLlamaCppRelease.llamaCppGithubRepo !== builtinLlamaCppGitHubRepo
102+
? ` (${clonedLlamaCppRelease.llamaCppGithubRepo})`
103+
: ""
104+
)
105+
);
79106
} catch (err) {
80107
// do nothing
81108
}

0 commit comments

Comments
 (0)