Skip to content
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

lmstudio deeplink for MLX models #963

Merged
merged 2 commits into from
Oct 10, 2024
Merged
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
6 changes: 5 additions & 1 deletion packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ function isLlamaCppGgufModel(model: ModelData) {
return !!model.gguf?.context_length;
}

function isMlxModel(model: ModelData) {
return model.tags.includes("mlx");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return model.tags.includes("mlx");
return model.library_name === "mlx";

or maybe like this @Vaibhavs10 if we want to be pedantic about it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually nvm because https://huggingface.co/mlx-community/Llama-3.2-3B-Instruct-4bit for instance is not library=mlx

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Just mlx tag would be more reliable 👍

}

const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
const command = (binary: string) =>
[
Expand Down Expand Up @@ -218,7 +222,7 @@ export const LOCAL_APPS = {
prettyLabel: "LM Studio",
docsUrl: "https://lmstudio.ai",
mainTask: "text-generation",
displayOnModelPage: isLlamaCppGgufModel,
displayOnModelPage: isLlamaCppGgufModel || isMlxModel,
yagil marked this conversation as resolved.
Show resolved Hide resolved
deeplink: (model, filepath) =>
new URL(`lmstudio://open_from_hf?model=${model.id}${filepath ? `&file=${filepath}` : ""}`),
},
Expand Down