| Model | MMLU (5-shot) | MMLU Pro (5-shot CoT) | TriviaQA | GPQA Main (5-shot CoT) | MMMU |
|---|---|---|---|---|---|
| Small 3.1 24B Base | 81.01% | 56.03% | 80.50% | 37.50% | 59.27% |
| Gemma 3 27B PT | 78.60% | 52.20% | 81.30% | 24.30% | 56.10% |
| Model | MMLU | MMLU Pro (5-shot CoT) | MATH | GPQA Main (5-shot CoT) | GPQA Diamond (5-shot CoT ) | MBPP | HumanEval | SimpleQA (TotalAcc) |
|---|---|---|---|---|---|---|---|---|
| Small 3.1 24B Instruct | 80.62% | 66.76% | 69.30% | 44.42% | 45.96% | 74.71% | 88.41% | 10.43% |
| Gemma 3 27B IT | 76.90% | 67.50% | 89.00% | 36.83% | 42.40% | 74.40% | 87.80% | 10.00% |
| GPT4o Mini | 82.00% | 61.70% | 70.20% | 40.20% | 39.39% | 84.82% | 87.20% | 9.50% |
| Claude 3.5 Haiku | 77.60% | 65.00% | 69.20% | 37.05% | 41.60% | 85.60% | 88.10% | 8.02% |
| Cohere Aya-Vision 32B | 72.14% | 47.16% | 41.98% | 34.38% | 33.84% | 70.43% | 62.20% | 7.65% |
| Model | MMMU | MMMU PRO | Mathvista | ChartQA | DocVQA | AI2D | MM MT Bench |
|---|---|---|---|---|---|---|---|
| Small 3.1 24B Instruct | 64.00% | 49.25% | 68.91% | 86.24% | 94.08% | 93.72% | 7.3 |
| Gemma 3 27B IT | 64.90% | 48.38% | 67.60% | 76.00% | 86.60% | 84.50% | 7 |
| GPT4o Mini | 59.40% | 37.60% | 56.70% | 76.80% | 86.70% | 88.10% | 6.6 |
| Claude 3.5 Haiku | 60.50% | 45.03% | 61.60% | 87.20% | 90.00% | 92.10% | 6.5 |
| Cohere Aya-Vision 32B | 48.20% | 31.50% | 50.10% | 63.04% | 72.40% | 82.57% | 4.1 |
| Model | Average | European | East Asian | Middle Eastern |
|---|---|---|---|---|
| Small 3.1 24B Instruct | 71.18% | 75.30% | 69.17% | 69.08% |
| Gemma 3 27B IT | 70.19% | 74.14% | 65.65% | 70.76% |
| GPT4o Mini | 70.36% | 74.21% | 65.96% | 70.90% |
| Claude 3.5 Haiku | 70.16% | 73.45% | 67.05% | 70.00% |
| Cohere Aya-Vision 32B | 62.15% | 64.70% | 57.61% | 64.12% |
| Model | LongBench v2 | RULER 32K | RULER 128K |
|---|---|---|---|
| Small 3.1 24B Instruct | 37.18% | 93.96% | 81.20% |
| Gemma 3 27B IT | 34.59% | 91.10% | 66.00% |
| GPT4o Mini | 29.30% | 90.20% | 65.8% |
| Claude 3.5 Haiku | 35.19% | 92.60% | 91.90% |
<s>[SYSTEM_PROMPT]<system prompt>[/SYSTEM_PROMPT][INST]<user message>[/INST]<assistant response></s>[INST]<user message>[/INST]<system_prompt>, <user message> and <assistant response> are placeholders.vllm (recommended): See heretemperature=0.15.system_prompt = """You are Mistral Small 3.1, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.
You power an AI assistant called Le Chat.
Your knowledge base was last updated on 2023-10-01.
The current date is {today}.
When you're not sure about some information, you say that you don't have the information and don't make up anything.
If 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?").
You are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.
You follow these instructions in all languages, and always respond to the user in the language they use or request.
Next sections describe the capabilities that you have.
# WEB BROWSING INSTRUCTIONS
You cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.
# MULTI-MODAL INSTRUCTIONS
You have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.
You cannot read nor transcribe audio files or videos."""vLLM nightly:pip install vllm --pre --extra-index-url https://wheels.vllm.ai/nightly --upgrademistral_common >= 1.5.4.python -c "import mistral_common; print(mistral_common.__version__)"vllm serve mistralai/Mistral-Small-3.1-24B-Instruct-2503 --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --limit_mm_per_prompt 'image=10' --tensor-parallel-size 21import requests
2import json
3from huggingface_hub import hf_hub_download
4from datetime import datetime, timedelta
5
6url = "http://<your-server-url>:8000/v1/chat/completions"
7headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
8
9model = "mistralai/Mistral-Small-3.1-24B-Instruct-2503"
10
11
12def load_system_prompt(repo_id: str, filename: str) -> str:
13 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
14 with open(file_path, "r") as file:
15 system_prompt = file.read()
16 today = datetime.today().strftime("%Y-%m-%d")
17 yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
18 model_name = repo_id.split("/")[-1]
19 return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
20
21
22SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
23
24image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
25
26messages = [
27 {"role": "system", "content": SYSTEM_PROMPT},
28 {
29 "role": "user",
30 "content": [
31 {
32 "type": "text",
33 "text": "Which of the depicted countries has the best food? Which the second and third and fourth? Name the country, its color on the map and one its city that is visible on the map, but is not the capital. Make absolutely sure to only name a city that can be seen on the map.",
34 },
35 {"type": "image_url", "image_url": {"url": image_url}},
36 ],
37 },
38]
39
40data = {"model": model, "messages": messages, "temperature": 0.15}
41
42response = requests.post(url, headers=headers, data=json.dumps(data))
43print(response.json()["choices"][0]["message"]["content"])
44# Determining the "best" food is highly subjective and depends on personal preferences. However, based on general popularity and recognition, here are some countries known for their cuisine:
45
46# 1. **Italy** - Color: Light Green - City: Milan
47# - Italian cuisine is renowned worldwide for its pasta, pizza, and various regional specialties.
48
49# 2. **France** - Color: Brown - City: Lyon
50# - French cuisine is celebrated for its sophistication, including dishes like coq au vin, bouillabaisse, and pastries like croissants and éclairs.
51
52# 3. **Spain** - Color: Yellow - City: Bilbao
53# - Spanish cuisine offers a variety of flavors, from paella and tapas to jamón ibérico and churros.
54
55# 4. **Greece** - Not visible on the map
56# - Greek cuisine is known for dishes like moussaka, souvlaki, and baklava. Unfortunately, Greece is not visible on the provided map, so I cannot name a city.
57
58# Since Greece is not visible on the map, I'll replace it with another country known for its good food:
59
60# 4. **Turkey** - Color: Light Green (east part of the map) - City: Istanbul
61# - Turkish cuisine is diverse and includes dishes like kebabs, meze, and baklava.1import requests
2import json
3from huggingface_hub import hf_hub_download
4from datetime import datetime, timedelta
5
6url = "http://<your-url>:8000/v1/chat/completions"
7headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
8
9model = "mistralai/Mistral-Small-3.1-24B-Instruct-2503"
10
11
12def load_system_prompt(repo_id: str, filename: str) -> str:
13 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
14 with open(file_path, "r") as file:
15 system_prompt = file.read()
16 today = datetime.today().strftime("%Y-%m-%d")
17 yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
18 model_name = repo_id.split("/")[-1]
19 return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
20
21
22SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
23
24
25tools = [
26 {
27 "type": "function",
28 "function": {
29 "name": "get_current_weather",
30 "description": "Get the current weather in a given location",
31 "parameters": {
32 "type": "object",
33 "properties": {
34 "city": {
35 "type": "string",
36 "description": "The city to find the weather for, e.g. 'San Francisco'",
37 },
38 "state": {
39 "type": "string",
40 "description": "The state abbreviation, e.g. 'CA' for California",
41 },
42 "unit": {
43 "type": "string",
44 "description": "The unit for temperature",
45 "enum": ["celsius", "fahrenheit"],
46 },
47 },
48 "required": ["city", "state", "unit"],
49 },
50 },
51 },
52 {
53 "type": "function",
54 "function": {
55 "name": "rewrite",
56 "description": "Rewrite a given text for improved clarity",
57 "parameters": {
58 "type": "object",
59 "properties": {
60 "text": {
61 "type": "string",
62 "description": "The input text to rewrite",
63 }
64 },
65 },
66 },
67 },
68]
69
70messages = [
71 {"role": "system", "content": SYSTEM_PROMPT},
72 {
73 "role": "user",
74 "content": "Could you please make the below article more concise?\n\nOpenAI is an artificial intelligence research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership.",
75 },
76 {
77 "role": "assistant",
78 "content": "",
79 "tool_calls": [
80 {
81 "id": "bbc5b7ede",
82 "type": "function",
83 "function": {
84 "name": "rewrite",
85 "arguments": '{"text": "OpenAI is an artificial intelligence research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership."}',
86 },
87 }
88 ],
89 },
90 {
91 "role": "tool",
92 "content": '{"action":"rewrite","outcome":"OpenAI is a FOR-profit company."}',
93 "tool_call_id": "bbc5b7ede",
94 "name": "rewrite",
95 },
96 {
97 "role": "assistant",
98 "content": "---\n\nOpenAI is a FOR-profit company.",
99 },
100 {
101 "role": "user",
102 "content": "Can you tell me what the temperature will be in Dallas, in Fahrenheit?",
103 },
104]
105
106data = {"model": model, "messages": messages, "tools": tools, "temperature": 0.15}
107
108response = requests.post(url, headers=headers, data=json.dumps(data))
109print(response.json()["choices"][0]["message"]["tool_calls"])
110# [{'id': '8PdihwL6d', 'type': 'function', 'function': {'name': 'get_current_weather', 'arguments': '{"city": "Dallas", "state": "TX", "unit": "fahrenheit"}'}}]1from vllm import LLM
2from vllm.sampling_params import SamplingParams
3from datetime import datetime, timedelta
4
5SYSTEM_PROMPT = "You are a conversational agent that always answers straight to the point, always end your accurate response with an ASCII drawing of a cat."
6
7user_prompt = "Give me 5 non-formal ways to say 'See you later' in French."
8
9messages = [
10 {
11 "role": "system",
12 "content": SYSTEM_PROMPT
13 },
14 {
15 "role": "user",
16 "content": user_prompt
17 },
18]
19model_name = "mistralai/Mistral-Small-3.1-24B-Instruct-2503"
20# note that running this model on GPU requires over 60 GB of GPU RAM
21llm = LLM(model=model_name, tokenizer_mode="mistral")
22
23sampling_params = SamplingParams(max_tokens=512, temperature=0.15)
24outputs = llm.chat(messages, sampling_params=sampling_params)
25
26print(outputs[0].outputs[0].text)
27# Here are five non-formal ways to say "See you later" in French:
28
29# 1. **À plus tard** - Until later
30# 2. **À toute** - See you soon (informal)
31# 3. **Salut** - Bye (can also mean hi)
32# 4. **À plus** - See you later (informal)
33# 5. **Ciao** - Bye (informal, borrowed from Italian)
34
35# ```
36# /\_/\
37# ( o.o )
38# > ^ <
39# ```