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

const snippetMlxGui = (model: ModelData): LocalAppSnippet[] => {
const runCommand = [
"# Call the API (text generation):",
`curl -X POST "http://localhost:8000/v1/chat/completions" \\`,
` -H "Content-Type: application/json" \\`,
` -d '{`,
` "model": "${model.id}",`,
` "messages": [{"role": "user", "content": "Hello!"}],`,
` "max_tokens": 100`,
` }'`,
].join("\n");

const installCommand = [
"# Install model:",
`curl -X POST "http://localhost:8000/v1/models/install" \\`,
` -H "Content-Type: application/json" \\`,
` -d '{"model_id": "${model.id}", "name": "${model.id.split('/').pop()}"}'`,
].join("\n");

return [
{
title: "Download macOS App",
setup: [
"# Download latest .app from releases:",
"https://github.com/RamboRogers/mlx-gui/releases/latest",
"# Drag to /Applications and launch",
].join("\n"),
content: [installCommand, runCommand].join("\n\n"),
},
{
title: "Install from source",
setup: [
"# Install MLX-GUI:",
"pip install git+https://github.com/RamboRogers/mlx-gui.git",
"# Start server:",
"mlx-gui start --port 8000",
].join("\n"),
content: [installCommand, runCommand].join("\n\n"),
},
];
};


/**
* Add your new local app here.
*
Expand Down Expand Up @@ -341,6 +384,18 @@ export const LOCAL_APPS = {
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
snippet: snippetVllm,
},
"mlx-gui": {
prettyLabel: "MLX-GUI",
docsUrl: "https://github.com/RamboRogers/mlx-gui",
mainTask: "text-generation",
displayOnModelPage: (model: ModelData) =>
model.library_name === "mlx" &&
(model.pipeline_tag === "text-generation" ||
model.pipeline_tag === "image-text-to-text" ||
model.pipeline_tag === "automatic-speech-recognition" ||
model.pipeline_tag === "feature-extraction"),
snippet: snippetMlxGui,
},
"mlx-lm": {
prettyLabel: "MLX LM",
docsUrl: "https://github.com/ml-explore/mlx-lm",
Expand Down