Skip to content

add aikit to localapps #739

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
27 changes: 26 additions & 1 deletion packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ llama \\
-p "I believe the meaning of life is" \\
-n 128`,
`# Option 2: build llama.cpp from source with curl support
git clone https://github.com/ggerganov/llama.cpp.git
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
LLAMA_CURL=1 make

Expand All @@ -72,6 +72,24 @@ LLAMA_CURL=1 make
];
};

const snippetAikit = (model: ModelData, filepath?: string): string[] => {
// convert model id to lowercase for docker image name
model.id = model.id.toLowerCase();
return [
`# build the container with docker locally
docker buildx build -t ${model.id}:latest --load \
--build-arg="model=huggingface://${model.id}/${filepath ?? "file.gguf"}" \
"https://raw.githubusercontent.com/sozercan/aikit/main/models/aikitfile.yaml"

# run the container locally
docker run -d --rm -p 8080:8080 ${model.id}:latest

# visit http://localhost:8080/chat with your browser
# or
# curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "${filepath ?? "file.gguf"}", "messages": [{"role": "user", "content": "I believe the meaning of life is"}]}'`
];
};

/**
* Add your new local app here.
*
Expand Down Expand Up @@ -178,6 +196,13 @@ export const LOCAL_APPS = {
displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
deeplink: (model) => new URL(`diffusionbee://open_from_hf?model=${model.id}`),
},
aikit: {
prettyLabel: "AIKit",
docsUrl: "https://github.com/sozercan/aikit",
mainTask: "text-generation",
displayOnModelPage: isGgufModel,
snippet: snippetAikit,
},
} satisfies Record<string, LocalApp>;

export type LocalAppKey = keyof typeof LOCAL_APPS;