Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions packages/tasks/src/local-apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,16 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
]
}'`);
});

it("docker model runner", async () => {
const { snippet: snippetFunc } = LOCAL_APPS["docker-model-runner"];
const model: ModelData = {
id: "bartowski/Llama-3.2-3B-Instruct-GGUF",
tags: ["conversational"],
inference: "",
};
const snippet = snippetFunc(model);

expect(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
});
});
13 changes: 12 additions & 1 deletion packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,15 @@ const snippetMlxLm = (model: ModelData): LocalAppSnippet[] => {
setup: ["# Install MLX LM", "uv tool install mlx-lm"].join("\n"),
content: ["# Start the server", `mlx_lm.server --model "${model.id}"`, ...openaiCurl].join("\n"),
},
]
]
: []),
];
};

const snippetDockerModelRunner = (model: ModelData, filepath?: string): string => {
return `docker model run hf.co/${model.id}${getQuantTag(filepath)}`;
};

/**
* Add your new local app here.
*
Expand Down Expand Up @@ -467,6 +471,13 @@ export const LOCAL_APPS = {
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetOllama,
},
"docker-model-runner": {
prettyLabel: "Docker Model Runner",
docsUrl: "https://docs.docker.com/ai/model-runner/",
mainTask: "text-generation",
displayOnModelPage: isLlamaCppGgufModel,
snippet: snippetDockerModelRunner,
},
} satisfies Record<string, LocalApp>;

export type LocalAppKey = keyof typeof LOCAL_APPS;
Loading