Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ GenAIScript local app #1072

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ const snippetOllama = (model: ModelData, filepath?: string): string => {
return `ollama run hf.co/${model.id}{{OLLAMA_TAG}}`;
};

const snippetGenAIScript = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
let ollamatag = "{{OLLAMA_TAG}}";
if (filepath) {
const quantLabel = parseGGUFQuantLabel(filepath);
ollamatag = quantLabel ? `:${quantLabel}` : "";
}
const modelid = `${model.id}${ollamatag}`;
return [
{
title: "Use model through Ollama",
content: `npx --yes genaiscript run poem --model ollama:${modelid}`,
},
];
};

const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
const command = (binary: string) =>
["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
Expand Down Expand Up @@ -427,6 +442,13 @@ export const LOCAL_APPS = {
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetOllama,
},
genaiscript: {
prettyLabel: "GenAIScript",
docsUrl: "https://microsoft.github.io/genaiscript/",
mainTask: "text-generation",
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetGenAIScript,
},
} satisfies Record<string, LocalApp>;

export type LocalAppKey = keyof typeof LOCAL_APPS;