-
Notifications
You must be signed in to change notification settings - Fork 447
add llamafile 🦙📁 #866
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
base: main
Are you sure you want to change the base?
add llamafile 🦙📁 #866
Changes from 3 commits
3fa5005
321cb48
1ca85cd
deaf038
e0c5141
46be03e
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 ? | ||
not-lain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
].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 , | ||
not-lain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
lmstudio: { | ||
prettyLabel: "LM Studio", | ||
docsUrl: "https://lmstudio.ai", | ||
|
Uh oh!
There was an error while loading. Please reload this page.