Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,21 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[]
};

const snippetNodeLlamaCppCli = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
let tagName = "{{OLLAMA_TAG}}";

if (filepath) {
const quantLabel = parseGGUFQuantLabel(filepath);
tagName = quantLabel ? `:${quantLabel}` : tagName;
}

return [
{
title: "Chat with the model",
content: [
`npx -y node-llama-cpp chat \\`,
` --model "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}" \\`,
` --prompt 'Hi there!'`,
].join("\n"),
content: `npx -y node-llama-cpp chat hf:${model.id}${tagName}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this looks quite clean 👍

},
{
title: "Estimate the model compatibility with your hardware",
content: `npx -y node-llama-cpp inspect estimate "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}"`,
content: `npx -y node-llama-cpp inspect estimate hf:${model.id}${tagName}`,
},
];
};
Expand Down
Loading