Skip to content
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
47 changes: 47 additions & 0 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,46 @@ const snippetMlxLm = (model: ModelData): LocalAppSnippet[] => {
];
};

const snippetMlxKnife = (model: ModelData): LocalAppSnippet[] => {
return [
{
title: "Terminal Usage",
setup: [],
content: [
"# Install MLX Knife",
"pip install mlx-knife",
"",
"# Check available models",
"mlxk list",
"",
"# Run model (if already installed)",
`mlxk run ${model.id.replace('mlx-community/', '')} "Hello!"`,
"",
"# Interactive chat",
`mlxk run ${model.id.replace('mlx-community/', '')}`,
"",
"# Download if needed",
`mlxk pull ${model.id}`,
].join("\n"),
},
{
title: "Web Interface",
setup: [],
content: [
"# Install MLX Knife",
"pip install mlx-knife",
"",
"# Start server",
"mlxk server --port 8000",
"",
"# Download web interface",
"curl -O https://raw.githubusercontent.com/mzau/mlx-knife/main/simple_chat.html",
"open simple_chat.html",
].join("\n"),
}
];
};

const snippetDockerModelRunner = (model: ModelData, filepath?: string): string => {
return `docker model run hf.co/${model.id}${getQuantTag(filepath)}`;
};
Expand Down Expand Up @@ -387,6 +427,13 @@ export const LOCAL_APPS = {
displayOnModelPage: (model) => model.pipeline_tag === "text-generation" && isMlxModel(model),
snippet: snippetMlxLm,
},
"mlx-knife": {
prettyLabel: "MLX Knife",
docsUrl: "https://github.com/mzau/mlx-knife",
mainTask: "text-generation",
displayOnModelPage: (model) => model.pipeline_tag === "text-generation" && isMlxModel(model),
snippet: snippetMlxKnife,
},
tgi: {
prettyLabel: "TGI",
docsUrl: "https://huggingface.co/docs/text-generation-inference/",
Expand Down