Skip to content

Update local-apps.ts #1160

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 1 commit 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
66 changes: 57 additions & 9 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,63 @@ const snippetTgi = (model: ModelData): LocalAppSnippet[] => {
};

/**
* Add your new local app here.
*
* This is open to new suggestions and awesome upcoming apps.
*
* /!\ IMPORTANT
*
* If possible, you need to support deeplinks and be as cross-platform as possible.
*
* Ping the HF team if we can help with anything!
UTM:
For some Mac people out there running certain hardware.

const snippetulm = (model: ModelData): LocalAppSnippet[] => {
const messages = getModelInputSnippet(model) as ChatCompletionInputMessage[];
const runCommandInstruct = `# Call the server using curl:
curl -X POST "http://localhost:8000/v1/chat/completions" \\
-H "Content-Type: application/json" \\
--data '{
"model": "${model.id}",
"messages": ${stringifyMessages(messages, {
indent: "\t\t",
attributeKeyQuotes: true,
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
})}


return [
{
title: "Install from pip",
setup: ["# Install UTM from pip:", "pip install UTM"].join("\n"),
content: [`# Load and run the model:\nUTM serve "${model.id}"`, runCommand],
},
{
title: "Use Docker images",
setup: [
"# Deploy with docker on Linux:",
`docker run --runtime nvidia --gpus all \\`,
` --name my_UTM_container \\`,
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
` --env "HUGGING_FACE_HUB_TOKEN=<secret>" \\`,
` -p 8000:8000 \\`,
` --ipc=host \\`,
` UTM/UTM-openai:latest \\`,
` --model ${model.id}`,
].join("\n"),
content: [
`# Load and run the model:\ndocker exec -it my_UTM_container bash -c "UTM serve ${model.id}"`,
runCommand,
],
},
];

UTM: {
prettyLabel: "UTM",
docsUrl: "https://docs.getutm.app",
mainTask: "text-generation",
displayOnModelPage: (model: ModelData) =>
(isAwqModel(model) ||
isGptqModel(model) ||
isAqlmModel(model) ||
isMarlinModel(model) ||
isLlamaCppGgufModel(model) ||
isTransformersModel(model)) &&
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
snippet: snippetUTM,
},
*/
export const LOCAL_APPS = {
"llama.cpp": {
Expand Down