Skip to content

Local apps: Add Lemonade #1639

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

Open
wants to merge 4 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
30 changes: 30 additions & 0 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,29 @@ const snippetDockerModelRunner = (model: ModelData, filepath?: string): string =
return `docker model run hf.co/${model.id}${getQuantTag(filepath)}`;
};

const snippetLemonade = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
const tagName = getQuantTag(filepath);
const modelName = model.id.split('/')[1];
return [
{
title: "Pull the model",
setup: "# Download Lemonade from https://lemonade-server.ai/",
content: [
`lemonade-server pull user.${modelName} --checkpoint ${model.id}${tagName} --recipe llamacpp`,
"# Note: If you installed from source, use the lemonade-server-dev command instead.",
].join("\n"),
},
{
title: "Run and chat with the model",
content: `lemonade-server run user.${modelName}`,
},
{
title: "List all available models",
content: "lemonade-server list",
},
];
};

/**
* Add your new local app here.
*
Expand Down Expand Up @@ -478,6 +501,13 @@ export const LOCAL_APPS = {
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetDockerModelRunner,
},
lemonade: {
prettyLabel: "Lemonade",
docsUrl: "https://lemonade-server.ai",
mainTask: "text-generation",
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetLemonade,
},
} satisfies Record<string, LocalApp>;

export type LocalAppKey = keyof typeof LOCAL_APPS;