File tree Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -207,10 +207,27 @@ curl -X POST "http://localhost:8000/v1/completions" \\
207
207
"temperature": 0.5
208
208
}'` ;
209
209
const runCommand = model . tags . includes ( "conversational" ) ? runCommandInstruct : runCommandNonInstruct ;
210
+
211
+ let setup ;
212
+ let dockerCommand ;
213
+
214
+ if ( model . tags . includes ( "mistral-common" ) ) {
215
+ setup = [
216
+ "# Install vLLM from pip:" ,
217
+ "pip install vllm" ,
218
+ "# Make sure you have the latest version of mistral-common installed:" ,
219
+ "pip install --upgrade mistral-common" ,
220
+ ] . join ( "\n" ) ;
221
+ 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"` ;
222
+ } else {
223
+ setup = [ "# Install vLLM from pip:" , "pip install vllm" ] . join ( "\n" ) ;
224
+ dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${ model . id } "` ;
225
+ }
226
+
210
227
return [
211
228
{
212
229
title : "Install from pip" ,
213
- setup : [ "# Install vLLM from pip:" , "pip install vllm" ] . join ( "\n" ) ,
230
+ setup : setup ,
214
231
content : [ `# Load and run the model:\nvllm serve "${ model . id } "` , runCommand ] ,
215
232
} ,
216
233
{
@@ -226,10 +243,7 @@ curl -X POST "http://localhost:8000/v1/completions" \\
226
243
` vllm/vllm-openai:latest \\` ,
227
244
` --model ${ model . id } ` ,
228
245
] . join ( "\n" ) ,
229
- content : [
230
- `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${ model . id } "` ,
231
- runCommand ,
232
- ] ,
246
+ content : [ dockerCommand , runCommand ] ,
233
247
} ,
234
248
] ;
235
249
} ;
Original file line number Diff line number Diff line change @@ -2023,4 +2023,24 @@ audio = model.autoencoder.decode(codes)[0].cpu()
2023
2023
torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate)
2024
2024
` ,
2025
2025
] ;
2026
+
2027
+ export const mistral_common = ( model : ModelData ) : string [ ] => [
2028
+ `# We recommend to use vLLM to serve Mistral AI models.
2029
+ pip install vllm
2030
+
2031
+ # Make sure to have installed the latest version of mistral-common.
2032
+ pip install --upgrade mistral-common[image,audio]
2033
+
2034
+ # Serve the model with an OpenAI-compatible API.
2035
+ vllm serve ${ model . id } --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice
2036
+
2037
+ # Query the model with curl in a separate terminal.
2038
+ curl http://localhost:8000/v1/chat/completions \
2039
+ -H "Content-Type: application/json" \
2040
+ -d '{
2041
+ "model": "${ model . id } ",
2042
+ "messages": [{"role": "user", "content": "What is the capital of France?"}]
2043
+ }'` ,
2044
+ ] ;
2045
+
2026
2046
//#endregion
Original file line number Diff line number Diff line change @@ -631,6 +631,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
631
631
filter : false ,
632
632
countDownloads : `path_extension:"ckpt"` ,
633
633
} ,
634
+ mistral_common : {
635
+ prettyLabel : "mistral-common" ,
636
+ repoName : "mistral-common" ,
637
+ repoUrl : "https://github.com/mistralai/mistral-common" ,
638
+ docsUrl : "https://mistralai.github.io/mistral-common/" ,
639
+ snippets : snippets . mistral_common ,
640
+ countDownloads : `path:"config.json" OR path:"params.json"` ,
641
+ } ,
634
642
mitie : {
635
643
prettyLabel : "MITIE" ,
636
644
repoName : "MITIE" ,
You can’t perform that action at this time.
0 commit comments