Pixtral-Large-Instruct-2411 is a 124B multimodal model built on top of Mistral Large 2, i.e.,
Mistral-Large-Instruct-2407
. Pixtral Large is the second model in our multimodal family and demonstrates frontier-level image understanding. Particularly, the model is able to understand documents, charts and natural images, while maintaining the leading text-only understanding of Mistral Large 2.
128K context window: fits minimum of 30 high-resolution images
System Prompt Handling
We appreciate the feedback received from our community regarding our system prompt handling.
In response, we have implemented stronger support for system prompts.
To achieve optimal results, we recommend always including a system prompt that clearly outlines the bot's purpose, even if it is minimal.
We recommend using Pixtral-Large-Instruct-2411 with the
vLLM library
to implement production-ready inference pipelines with Pixtral-Large-Instruct-2411.
import requests
import json
from huggingface_hub import hf_hub_download
from datetime import datetime, timedelta
url = "http://<your-server-url>:8000/v1/chat/completions"
headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
model = "mistralai/Pixtral-Large-Instruct-2411"defload_system_prompt(repo_id: str, filename: str) -> str:
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
withopen(file_path, "r") as file:
system_prompt = file.read()
today = datetime.today().strftime("%Y-%m-%d")
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
model_name = repo_id.split("/")[-1]
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{
"role": "user",
"content": [
{
"type": "text",
"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.",
},
{"type": "image_url", "image_url": {"url": image_url}},
],
},
]
data = {"model": model, "messages": messages}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json()["choices"][0]["message"]["content"])
# Determining which country has the "best" food can be subjective and depends on personal preferences. However, based on popular culinary reputations, here are some countries known for their cuisine:#1. **Italy** (Brown) - Known for its pasta, pizza, and diverse regional dishes.# - City: Milan#2. **France** (Dark Brown) - Renowned for its fine dining, pastries, and wine.# - City: Lyon#3. **Spain** (Yellow) - Famous for tapas, paella, and a variety of seafood dishes.# - City: Barcelona#4. **Greece** (Yellow) - Known for its Mediterranean cuisine, including moussaka, souvlaki, and fresh seafood.# - City: Thessaloniki#These rankings are based on general culinary reputations and can vary widely depending on individual tastes.
Server (Text-only)
You can also ping the client with a text-only example. The following example
shows how the system prompt can be used to make sure the model always knows
the current date.
import requests
import json
from huggingface_hub import hf_hub_download
from datetime import datetime, timedelta
url = "http://<your-server-url>:8000/v1/chat/completions"
headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
model = "mistralai/Pixtral-Large-Instruct-2411"defload_system_prompt(repo_id: str, filename: str) -> str:
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
withopen(file_path, "r") as file:
system_prompt = file.read()
today = datetime.today().strftime("%Y-%m-%d")
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
model_name = repo_id.split("/")[-1]
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{
"role": "user",
"content": "Without browsing the web, how many days ago was Mistral founded?"
},
]
data = {"model": model, "messages": messages}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json()["choices"][0]["message"]["content"])
# Mistral AI was founded in April 2023. Since the current date is November 18, 2024, we can calculate the number of days between April 2023 and November 18, 2024.#First, calculate the days from April 2023 to the end of 2023:#- April: 27 days (30 - 3)#- May: 31 days#- June: 30 days#- July: 31 days#- August: 31 days#- September: 30 days#- October: 31 days#- November: 30 days#- December: 31 days#Total days from April 2023 to December 31, 2023: 27 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 = 272 days#Next, calculate the days from January 1, 2024, to November 18, 2024:#- January: 31 days#- February: 29 days (2024 is a leap year)#- March: 31 days#- April: 30 days#- May: 31 days#- June: 30 days#- July: 31 days#- August: 31 days#- September: 30 days#- October: 31 days#- November: 18 days#Total days from January 1, 2024, to November 18, 2024: 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 18 = 323 days#Adding the two periods together:#272 days (from April 2023 to December 2023) + 323 days (from January 2024 to November 18, 2024) = 595 days#Therefore, Mistral AI was founded 595 days ago from November 18, 2024.
Offline Example
from vllm import LLM
from vllm.sampling_params import SamplingParams
from huggingface_hub import hf_hub_download
from datetime import datetime, timedelta
model_name = "mistralai/Pixtral-Large-Instruct-2411"defload_system_prompt(repo_id: str, filename: str) -> str:
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
withopen(file_path, 'r') as file:
system_prompt = file.read()
today = datetime.today().strftime('%Y-%m-%d')
yesterday = (datetime.today() - timedelta(days=1)).strftime('%Y-%m-%d')
model_name = repo_id.split("/")[-1]
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
SYSTEM_PROMPT = load_system_prompt(model_name, "SYSTEM_PROMPT.txt")
image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{
"role": "user",
"content": [
{
"type": "text",
"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.",
},
{"type": "image_url", "image_url": {"url": image_url}},
],
},
]
sampling_params = SamplingParams(max_tokens=512)
# note that running this model on GPU requires over 300 GB of GPU RAM
llm = LLM(model=model_name, tokenizer_mode="mistral", tensor_parallel_size=8, limit_mm_per_prompt={"image": 4})
outputs = llm.chat(messages, sampling_params=sampling_params)
print(outputs[0].outputs[0].text)
The Mistral AI Team
Albert Jiang, Alexandre Sablayrolles, Alexis Tacnet, Alok Kothari, Antoine Roux, Arthur Mensch, Audrey Herblin-Stoop, Augustin Garreau, Austin Birky, Bam4d, Baptiste Bout, Baudouin de Monicault, Blanche Savary, Carole Rambaud, Caroline Feldman, Devendra Singh Chaplot, Diego de las Casas, Diogo Costa, Eleonore Arcelin, Emma Bou Hanna, Etienne Metzger, Gaspard Blanchet, Gianna Lengyel, Guillaume Bour, Guillaume Lample, Harizo Rajaona, Henri Roussez, Hichem Sattouf, Ian Mack, Jean-Malo Delignon, Jessica Chudnovsky, Justus Murke, Kartik Khandelwal, Lawrence Stewart, Louis Martin, Louis Ternon, Lucile Saulnier, Lélio Renard Lavaud, Margaret Jennings, Marie Pellat, Marie Torelli, Marie-Anne Lachaux, Marjorie Janiewicz, Mickaël Seznec, Nicolas Schuhl, Niklas Muhs, Olivier de Garrigues, Patrick von Platen, Paul Jacob, Pauline Buche, Pavan Kumar Reddy, Perry Savas, Pierre Stock, Romain Sauvestre, Sagar Vaze, Sandeep Subramanian, Saurabh Garg, Sophia Yang, Szymon Antoniak, Teven Le Scao, Thibault Schueller, Thibaut Lavril, Thomas Wang, Théophile Gervet, Timothée Lacroix, Valera Nemychnikova, Wendy Shang, William El Sayed, William Marshall
Runs of mgoin Pixtral-Large-Instruct-2411-hf on huggingface.co
14
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About Pixtral-Large-Instruct-2411-hf huggingface.co Model
More Pixtral-Large-Instruct-2411-hf license Visit here:
Pixtral-Large-Instruct-2411-hf huggingface.co is an AI model on huggingface.co that provides Pixtral-Large-Instruct-2411-hf's model effect (), which can be used instantly with this mgoin Pixtral-Large-Instruct-2411-hf model. huggingface.co supports a free trial of the Pixtral-Large-Instruct-2411-hf model, and also provides paid use of the Pixtral-Large-Instruct-2411-hf. Support call Pixtral-Large-Instruct-2411-hf model through api, including Node.js, Python, http.
Pixtral-Large-Instruct-2411-hf huggingface.co is an online trial and call api platform, which integrates Pixtral-Large-Instruct-2411-hf's modeling effects, including api services, and provides a free online trial of Pixtral-Large-Instruct-2411-hf, you can try Pixtral-Large-Instruct-2411-hf online for free by clicking the link below.
mgoin Pixtral-Large-Instruct-2411-hf online free url in huggingface.co:
Pixtral-Large-Instruct-2411-hf is an open source model from GitHub that offers a free installation service, and any user can find Pixtral-Large-Instruct-2411-hf on GitHub to install. At the same time, huggingface.co provides the effect of Pixtral-Large-Instruct-2411-hf install, users can directly use Pixtral-Large-Instruct-2411-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Pixtral-Large-Instruct-2411-hf install url in huggingface.co: