-
Notifications
You must be signed in to change notification settings - Fork 467
Add mistral-common library #1641
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
Changes from 2 commits
4e23a83
4cd3f27
df8ee13
98ada82
4297132
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 |
---|---|---|
|
@@ -207,10 +207,28 @@ curl -X POST "http://localhost:8000/v1/completions" \\ | |
"temperature": 0.5 | ||
}'`; | ||
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct; | ||
|
||
let setup; | ||
let dockerCommand; | ||
|
||
if (model.tags.includes("mistral-common")) { | ||
setup = [ | ||
"# Install vLLM from pip:", | ||
"pip install vllm", | ||
"# Make sure you have the latest version of mistral-common installed:", | ||
"pip install --upgrade mistral-common" | ||
].join(""); | ||
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"`; | ||
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. out of curiosity, what happens if one runs 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. It wouldn't know how to load the model correctly so failing :/ 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. wouldn't this be something to fix on vllm side directly? feels weird if all vllm-compatible models can be correctly served with (not against adding it, just wondering why it's not a default) 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. Sorry my previous info was not complete, here is the behavior:
|
||
} | ||
else { | ||
setup = ["# Install vLLM from pip:", "pip install vllm"].join(""); | ||
juliendenize marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`; | ||
} | ||
|
||
return [ | ||
{ | ||
title: "Install from pip", | ||
setup: ["# Install vLLM from pip:", "pip install vllm"].join("\n"), | ||
setup: setup, | ||
content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand], | ||
}, | ||
{ | ||
|
@@ -227,7 +245,7 @@ curl -X POST "http://localhost:8000/v1/completions" \\ | |
` --model ${model.id}`, | ||
].join("\n"), | ||
content: [ | ||
`# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`, | ||
dockerCommand, | ||
runCommand, | ||
], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1893,4 +1893,24 @@ audio = model.autoencoder.decode(codes)[0].cpu() | |
torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate) | ||
`, | ||
]; | ||
|
||
export const mistral_common = (model: ModelData): string[] => [ | ||
`# We recommend to use vLLM to serve Mistral AI models. | ||
pip install vllm | ||
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. Is 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.
|
||
|
||
# Make sure to have installed the latest version of mistral-common. | ||
pip install --upgrade mistral-common[image,audio] | ||
|
||
# Serve the model with an OpenAI-compatible API. | ||
vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice | ||
|
||
# Query the model with curl in a separate terminal. | ||
curl http://localhost:8000/v1/chat/completions \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"model": "${model.id}", | ||
"messages": [{"role": "user", "content": "What is the capital of France?"}] | ||
}'`, | ||
]; | ||
|
||
//#endregion |
Uh oh!
There was an error while loading. Please reload this page.