-
Notifications
You must be signed in to change notification settings - Fork 228
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
[draft] add llamafile 🦙📁 #866
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -104,6 +104,29 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[] | |||||
]; | ||||||
}; | ||||||
|
||||||
const snippetLlamafileGGUF = (model: ModelData, filepath?: string): LocalAppSnippet[] => { | ||||||
const command = (binary: string) => | ||||||
[ | ||||||
"# Load and run the model :", | ||||||
`wget https://huggingface.co/${model.id}/resolve/main/`.concat(`${filepath ?? "{{GGUF_FILE}}"}`), // could not figure out how to do it without concat | ||||||
`chmod +x ${binary}`, | ||||||
`${binary} -m ${filepath?? "{{GGUF_FILE}}"} -p 'You are a helpful assistant' `, // will this create a second dropdown ? | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
].join("\n"); | ||||||
return [ | ||||||
{ | ||||||
title: "Use pre-built binary", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this step is correct in llamafile, because the downloaded model file is already a pre-built binary. The release binary from https://github.com/Mozilla-Ocho/llamafile/releases is used in Creating llamafiles section of the README. So this step should be named |
||||||
setup: [ | ||||||
// prettier-ignore | ||||||
"# Download pre-built binary from:", | ||||||
"# https://github.com/Mozilla-Ocho/llamafile/releases", | ||||||
"# Example : ", | ||||||
"# wget https://github.com/Mozilla-Ocho/llamafile/releases/download/0.8.13/llamafile-0.8.13", | ||||||
].join("\n"), | ||||||
content: command("./llamafile-0.8.13") | ||||||
} | ||||||
]; | ||||||
}; | ||||||
|
||||||
const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[] => { | ||||||
const command = (binary: string) => | ||||||
["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n"); | ||||||
|
@@ -146,6 +169,15 @@ export const LOCAL_APPS = { | |||||
displayOnModelPage: isLlamaCppGgufModel, | ||||||
snippet: snippetLlamacpp, | ||||||
}, | ||||||
// llamafile uses .llamafile and .gguf files | ||||||
// update this later to handle .llamafile | ||||||
llamafile : { | ||||||
prettyLabel : "llamafile", | ||||||
docsUrl : "https://github.com/Mozilla-Ocho/llamafile", | ||||||
mainTask : "text-generation", | ||||||
displayOnModelPage : isLlamaCppGgufModel, // update this later to include .llamafile | ||||||
snippet: snippetLlamafileGGUF , | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}, | ||||||
lmstudio: { | ||||||
prettyLabel: "LM Studio", | ||||||
docsUrl: "https://lmstudio.ai", | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like that work? (not sure)