Mistral
Mistral / Mistral AI
An open-source language model from the French AI startup Mistral AI. Achieves both efficiency and performance with a Mixture of Experts (MoE) architecture. Reached GPT-4-class performance with Mistral Large 3 in 2025.
Mistral / Mistral AI
An open-source language model from the French AI startup Mistral AI. Achieves both efficiency and performance with a Mixture of Experts (MoE) architecture. Reached GPT-4-class performance with Mistral Large 3 in 2025.
Mistral is a series of large language models (LLMs) developed by Mistral AI, an AI startup headquartered in Paris, France. Founded in 2023 by researchers from Meta and Google DeepMind, it quickly drew attention by releasing its models under the open-source-friendly Apache 2.0 license.
Mistral's most distinctive feature is its Mixture of Experts (MoE) architecture. By activating only a portion of the total parameters, it greatly reduces inference costs while maintaining high performance. For example, Mixtral 8x7B has 45B parameters in total but uses only 12B during actual inference, and it delivers performance that surpasses GPT-3.5.
In December 2025, Mistral Large 3 was released, opening a new horizon for open-source LLMs. It offers 675B total parameters, 41B active parameters, and a 256K context window, and it achieved performance comparable to GPT-4o and Gemini 2. It includes multimodal and multilingual support and was released under the Apache 2.0 license.
In practice, Mistral models are widely used for building cost-efficient LLM services, for enterprises that need on-premises deployment, and for coding/reasoning-specialized tasks. In addition to the Mistral API, they are available on HuggingFace, AWS Bedrock, Azure, and Google Cloud, and Mistral has recently released coding-specialized models as well with the Devstral series.
| Model | Parameter | Features |
|---|---|---|
| Mistral 7B | 7B | Small, high performance; outperforms Llama 2 13B |
| Mixtral 8x7B | 45B (12B active) | MoE, outperforms GPT-3.5, 32K context |
| Mixtral 8x22B | 141B (39B active) | MoE, 64K context |
| Mistral Large 3 | 675B (41B active) | GPT-4 class, multimodal, 256K context |
| Ministral 3 (3B/8B/14B) | 3B-14B | For edge/mobile, vision support |
# pip install mistralai
from mistralai import Mistral
# 1. Mistral API 사용
client = Mistral(api_key="your-api-key")
# 기본 채팅 완성
response = client.chat.complete(
model="mistral-large-latest", # 또는 "mistral-small-latest", "open-mixtral-8x22b"
messages=[
{"role": "user", "content": "Python에서 비동기 프로그래밍의 장점을 설명해주세요."}
],
temperature=0.7,
max_tokens=1024
)
print(response.choices[0].message.content)
# 2. 스트리밍 응답
stream = client.chat.stream(
model="mistral-large-latest",
messages=[{"role": "user", "content": "간단한 FastAPI 서버 코드를 작성해주세요."}]
)
for chunk in stream:
if chunk.data.choices[0].delta.content:
print(chunk.data.choices[0].delta.content, end="", flush=True)
# 3. Function Calling (Tool Use)
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "도시의 현재 날씨를 조회합니다",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "도시 이름"}
},
"required": ["city"]
}
}
}
]
response = client.chat.complete(
model="mistral-large-latest",
messages=[{"role": "user", "content": "서울 날씨 어때?"}],
tools=tools,
tool_choice="auto"
)
# 4. HuggingFace Transformers로 로컬 실행
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Mistral 7B Instruct (약 14GB VRAM 필요)
model_id = "mistralai/Mistral-7B-Instruct-v0.3"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
messages = [{"role": "user", "content": "메타 러닝이란 무엇인가요?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=512, do_sample=True, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
# 5. vLLM으로 고성능 서빙 (프로덕션 권장)
# pip install vllm
from vllm import LLM, SamplingParams
llm = LLM(model="mistralai/Mistral-7B-Instruct-v0.3")
sampling_params = SamplingParams(temperature=0.7, max_tokens=512)
prompts = ["[INST] FastAPI와 Flask의 차이점은? [/INST]"]
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
print(output.outputs[0].text)
Mistral AI API prices as of January 2025.
| Model | Input ($/1M tokens) | Output ($/1M tokens) | Notes |
|---|---|---|---|
| Mistral Large 24.11 | $2.00 | $6.00 | 128K context, latest flagship |
| Mistral Small 24.09 | $0.20 | $0.60 | Cost-efficient, 32K context |
| Codestral 24.12 | $0.30 | $0.90 | Coding-specialized, 256K context |
| Pixtral Large | $2.00 | $6.00 | Multimodal (image + text) |
| Ministral 3B | $0.04 | $0.04 | For edge/mobile |
| Ministral 8B | $0.10 | $0.10 | For edge/mobile |
Open-source options: Mixtral 8x7B and Mistral 7B can be used commercially for free under the Apache 2.0 license. When self-hosting, only inference costs are incurred.
"I think we should use Mixtral 8x22B for the internal chatbot. Because it is MoE, the actual inference cost is on par with a 39B Dense model, yet the performance is much better, and thanks to Apache 2.0, commercial use is unrestricted. If we serve it with vLLM, 2 A100s are enough."
"Mistral is the model that led the popularization of the MoE architecture. Mixtral 8x7B activates only 2 of its 8 Experts, delivering 45B-class performance with 12B-level computation. Recently, Mistral Large 3 is a GPT-4o-class open-source model that supports a 256K context and multimodality."
"Llama leads in the community ecosystem, but Mistral is efficient thanks to MoE and has an advantage in complying with European regulations. With a diverse lineup — Devstral for coding, Mistral Large for general purpose, and Ministral for edge — you can choose by use case."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
Do not mistakenly think that Mixtral 8x7B uses only 7B. All 45B parameters must be loaded into memory. Only the inference computation is at the 12B level.
Mistral Instruct models require the [INST][/INST] tags. An incorrect format causes performance degradation. Use tokenizer.apply_chat_template().
Choose Mistral 7B for simple tasks, Mixtral 8x22B or Mistral Large for complex reasoning, Devstral for coding, and Ministral for mobile/edge. Decide by comparing API and self-hosting costs.