Text Generation
Transformers
PyTorch
Safetensors
mistral
finetuned
mistral-common
conversational
text-generation-inference
Instructions to use mistralai/Mistral-7B-Instruct-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mistralai/Mistral-7B-Instruct-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1") model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use mistralai/Mistral-7B-Instruct-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Install mistral-common: pip install --upgrade mistral-common # Start the vLLM server: vllm serve "mistralai/Mistral-7B-Instruct-v0.1" --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mistralai/Mistral-7B-Instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mistralai/Mistral-7B-Instruct-v0.1
- SGLang
How to use mistralai/Mistral-7B-Instruct-v0.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mistralai/Mistral-7B-Instruct-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mistralai/Mistral-7B-Instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mistralai/Mistral-7B-Instruct-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mistralai/Mistral-7B-Instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mistralai/Mistral-7B-Instruct-v0.1 with Docker Model Runner:
docker model run hf.co/mistralai/Mistral-7B-Instruct-v0.1
Install & run this model easily using llmpm
#187 opened 3 months ago
by
sarthak-saxena
Question about mistralai/Mistral-7B-Instruct-v0.1 and its base model
1
#186 opened 3 months ago
by
dqdw
Request Access to Replicate Paper
#185 opened 4 months ago
by
tauheed-elahee
Requesting Access
#184 opened 8 months ago
by
ujeong1
Upload 2 files
#183 opened 8 months ago
by
Lorriea73
Request: DOI
#182 opened 9 months ago
by
I-Am-Batman-12
My2025
#180 opened 9 months ago
by
mahmmed77481
Хзх
#179 opened 10 months ago
by
lored1oxxx
Request Access
#177 opened 10 months ago
by
sdfghjklkjhgfd
Request: DOI
#176 opened 10 months ago
by
sdfghjklkjhgfd
Request: DOI
#175 opened 10 months ago
by
OllyT13
Request: DOI
#174 opened 10 months ago
by
kieranlunny
Request: DOI
#173 opened 10 months ago
by
vervain026
Request Access
1
#172 opened 10 months ago
by
ShyYven
Request: DOI
#171 opened 10 months ago
by
Cheick007
Request: DOI
#170 opened 10 months ago
by
Jalajbaghwala
سؤال
#169 opened 11 months ago
by
dayahimour
Requesting Access
#168 opened 11 months ago
by
SMS-MG
vedanttest
#167 opened 11 months ago
by
Vedant1009
requesting access
#166 opened 11 months ago
by
Abhinav928
request access
#165 opened 11 months ago
by
amalb22
Requesting Access
#164 opened 11 months ago
by
vamcumn123
Request Access to Mistral-7B-Instruct-v0.1 Model
1
#163 opened 11 months ago
by
samuelabrahamyan
Access request for Mistral model
9
#162 opened 12 months ago
by
Code-fy
add AIBOM
#161 opened 12 months ago
by
sabato-nocera
Request : DOI
#160 opened 12 months ago
by
helesta02
Request :DOI
#159 opened 12 months ago
by
ankush-kukde
app.py creation
#158 opened 12 months ago
by
mirnaaiman
Request: DOI
#156 opened about 1 year ago
by
ARtOrias11
Request: DOI
#155 opened about 1 year ago
by
smeehh
Request: DOI
#154 opened about 1 year ago
by
MMVSolutions
Update README.md
#152 opened about 1 year ago
by
savrabhrao17
lala
#151 opened about 1 year ago
by
MaryemOuichka
Request: DOI
#150 opened about 1 year ago
by
lilithreb0rn
Request: DOI
#149 opened about 1 year ago
by
wajeenpc
Request: DOI
#148 opened about 1 year ago
by
mecheri
Request: DOI
#147 opened about 1 year ago
by
Zeken3205
Request: DOI
1
#146 opened about 1 year ago
by
Farhan0502M
University thesis.
#145 opened about 1 year ago
by
panazzolo
Request
#144 opened about 1 year ago
by
Kanishk2928
can u give me the access pls i need this in my university project
#143 opened about 1 year ago
by
MohamedAlaa2
Request: DOI
#140 opened about 1 year ago
by
WaqarShah5511
Request: DOI
❤️👀 1
#138 opened about 1 year ago
by
ArBaltee
Request: DOI
#137 opened about 1 year ago
by
shivamkrai
Request: DOI
1
#136 opened about 1 year ago
by
ZakraGull
Request: DOI
#135 opened over 1 year ago
by
nnnyr
Request: DOI
#134 opened over 1 year ago
by
kainatq
Request: DOI
1
#133 opened over 1 year ago
by
sameller