Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

mlx-community
/
Mistral-7B-Instruct-v0.2-4bit

Text Generation
MLX
Safetensors
mistral
finetuned
conversational
Model card Files Files and versions
xet
Community
1

Instructions to use mlx-community/Mistral-7B-Instruct-v0.2-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use mlx-community/Mistral-7B-Instruct-v0.2-4bit 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/Mistral-7B-Instruct-v0.2-4bit")
    
    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 Settings
  • LM Studio
  • MLX LM

    How to use mlx-community/Mistral-7B-Instruct-v0.2-4bit 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/Mistral-7B-Instruct-v0.2-4bit"
    Run an OpenAI-compatible server
    # Install MLX LM
    uv tool install mlx-lm
    # Start the server
    mlx_lm.server --model "mlx-community/Mistral-7B-Instruct-v0.2-4bit"
    # 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/Mistral-7B-Instruct-v0.2-4bit",
         "messages": [
           {"role": "user", "content": "Hello"}
         ]
       }'
Mistral-7B-Instruct-v0.2-4bit
18.6 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 8 commits
shawhin's picture
shawhin
c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468
effe8f9 verified almost 2 years ago
  • .gitattributes
    1.52 kB
    initial commit over 2 years ago
  • README.md
    811 Bytes
    c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468 almost 2 years ago
  • config.json
    2.21 kB
    c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468 almost 2 years ago
  • model-00001-of-00003.safetensors
    5.35 GB
    xet
    dce10e43f3b30f7489f03dd7e528a7362f87603f41d8b0b9dc6707acf522427a almost 2 years ago
  • model-00002-of-00003.safetensors
    5.3 GB
    xet
    c9994c71bb4fae1703de8ad8205186ee543d376c0315611ece7bff484007f429 almost 2 years ago
  • model-00003-of-00003.safetensors
    3.83 GB
    xet
    9b074d78ca9d8aa1b58ee06931245fc5fd6e7acfc3c48bb3b2d70ba46fe60be9 almost 2 years ago
  • model.safetensors
    4.07 GB
    xet
    58cf285a786e8c521cb10aaa2641d590bc1d0935be6b3c46b7f8dbf059b11100 almost 2 years ago
  • model.safetensors.index.json
    25.1 kB
    c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468 almost 2 years ago
  • special_tokens_map.json
    414 Bytes
    Upload folder using huggingface_hub over 2 years ago
  • tokenizer.json
    1.8 MB
    c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468 almost 2 years ago
  • tokenizer.model
    493 kB
    xet
    Upload folder using huggingface_hub over 2 years ago
  • tokenizer_config.json
    2.1 kB
    c1a7132aed5c1cb82c0c02db25bb80fdaa7846016cb685e73cedd98e2e880468 almost 2 years ago