Instructions to use mlx-community/Devstral-Small-2505-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Devstral-Small-2505-bf16 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Devstral-Small-2505-bf16") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use mlx-community/Devstral-Small-2505-bf16 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Devstral-Small-2505-bf16"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Devstral-Small-2505-bf16" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Devstral-Small-2505-bf16", "messages": [ {"role": "user", "content": "Hello"} ] }'
Upload 3 files
Browse files- special_tokens_map.json +0 -7
- tokenizer_config.json +2 -3
special_tokens_map.json
CHANGED
|
@@ -1015,13 +1015,6 @@
|
|
| 1015 |
"rstrip": false,
|
| 1016 |
"single_word": false
|
| 1017 |
},
|
| 1018 |
-
"pad_token": {
|
| 1019 |
-
"content": "<pad>",
|
| 1020 |
-
"lstrip": false,
|
| 1021 |
-
"normalized": false,
|
| 1022 |
-
"rstrip": false,
|
| 1023 |
-
"single_word": false
|
| 1024 |
-
},
|
| 1025 |
"unk_token": {
|
| 1026 |
"content": "<unk>",
|
| 1027 |
"lstrip": false,
|
|
|
|
| 1015 |
"rstrip": false,
|
| 1016 |
"single_word": false
|
| 1017 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1018 |
"unk_token": {
|
| 1019 |
"content": "<unk>",
|
| 1020 |
"lstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -9007,13 +9007,12 @@
|
|
| 9007 |
"<SPECIAL_999>"
|
| 9008 |
],
|
| 9009 |
"bos_token": "<s>",
|
|
|
|
| 9010 |
"clean_up_tokenization_spaces": false,
|
| 9011 |
"eos_token": "</s>",
|
| 9012 |
"extra_special_tokens": {},
|
| 9013 |
"legacy": true,
|
| 9014 |
-
"model_max_length":
|
| 9015 |
-
"pad_token": "<pad>",
|
| 9016 |
-
"processor_class": "PixtralProcessor",
|
| 9017 |
"tokenizer_class": "LlamaTokenizerFast",
|
| 9018 |
"unk_token": "<unk>",
|
| 9019 |
"use_default_system_prompt": false
|
|
|
|
| 9007 |
"<SPECIAL_999>"
|
| 9008 |
],
|
| 9009 |
"bos_token": "<s>",
|
| 9010 |
+
"chat_template": "{%- set today = strftime_now(\"%Y-%m-%d\") %}\n{%- set default_system_message = \"You are Devstral, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\\nYour knowledge base was last updated on 2023-10-01. The current date is \" + today + \".\\n\\nWhen you're not sure about some information, you say that you don't have the information and don't make up anything.\\nIf the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. \\\"What are some good restaurants around me?\\\" => \\\"Where are you?\\\" or \\\"When is the next flight to Tokyo\\\" => \\\"Where do you travel from?\\\")\" %}\n\n{{- bos_token }}\n\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = default_system_message %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{{- '[SYSTEM_PROMPT]' + system_message + '[/SYSTEM_PROMPT]' }}\n\n{%- for message in loop_messages %}\n {%- if message['role'] == 'user' %}\n {{- '[INST]' + message['content'] + '[/INST]' }}\n {%- elif message['role'] == 'system' %}\n {{- '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }}\n {%- elif message['role'] == 'assistant' %}\n {{- message['content'] + eos_token }}\n {%- else %}\n {{- raise_exception('Only user, system and assistant roles are supported!') }}\n {%- endif %}\n{%- endfor %}",
|
| 9011 |
"clean_up_tokenization_spaces": false,
|
| 9012 |
"eos_token": "</s>",
|
| 9013 |
"extra_special_tokens": {},
|
| 9014 |
"legacy": true,
|
| 9015 |
+
"model_max_length": 131072,
|
|
|
|
|
|
|
| 9016 |
"tokenizer_class": "LlamaTokenizerFast",
|
| 9017 |
"unk_token": "<unk>",
|
| 9018 |
"use_default_system_prompt": false
|