Skip to content

[vLLM Snippet] update #942

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

Merged
merged 1 commit into from
Oct 4, 2024
Merged
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
13 changes: 6 additions & 7 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface LocalAppSnippet {
/**
* Content (or command) to be run
*/
content: string;
content: string | string[];
}

/**
Expand Down Expand Up @@ -149,7 +149,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
`curl -X POST "http://localhost:8000/v1/chat/completions" \\ `,
` -H "Content-Type: application/json" \\ `,
` --data '{`,
` "model": "${model.id}"`,
` "model": "${model.id}",`,
` "messages": [`,
` {"role": "user", "content": "Hello!"}`,
` ]`,
Expand All @@ -159,7 +159,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
{
title: "Install from pip",
setup: ["# Install vLLM from pip:", "pip install vllm"].join("\n"),
content: ["# Load and run the model:", `vllm serve "${model.id}"`, ...runCommand].join("\n"),
content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand.join("\n")],
},
{
title: "Use Docker images",
Expand All @@ -175,10 +175,9 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
` --model ${model.id}`,
].join("\n"),
content: [
"# Load and run the model:",
`docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
...runCommand,
].join("\n"),
`# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
runCommand.join("\n"),
],
},
];
};
Expand Down
Loading