CoolFace
Modelpublic

muranAI/Mistral-Small-3.1-24B-Instruct-2503-GGUF

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
1likes620downloads
Model Card

<p style="margin-bottom: 0;"> <em>See <a href="https://huggingface.co/muranAI">our collection</a> for all new Models.</em> </p>

<div style="display: flex; gap: 5px; align-items: center; "> <a href="https://muranai.com/"> <img src="https://muranai.com/images/logo_white.png" width="133"> </a> </div>

Mistral-Small-3.1-24B-Instruct - GGUF

<div align="center">

High-quality GGUF quantizations of Mistral-Small-3.1-24B-Instruct-2503

![](#quantization-variants) ![](#license) ![](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Instruct-2503) ![](#model-details)

</div>

๐Ÿ“– Model Description

This repository contains GGUF quantized versions of the Mistral-Small-3.1-24B-Instruct-2503 model, optimized for efficient inference using llama.cpp, Ollama, and other GGUF-compatible frameworks.

Mistral Small 3.1 builds upon Mistral Small 3 (2501) and adds state-of-the-art vision understanding and enhances long context capabilities up to 128k tokens without compromising text performance. With 24 billion parameters, this model achieves top-tier capabilities in both text and vision tasks.

Key Features โœจ

  • โ€”๐Ÿ–ผ๏ธ Vision Capabilities: Analyze images and provide insights based on visual content
  • โ€”๐ŸŒ Multilingual: Supports 24+ languages including English, French, German, Spanish, Japanese, Chinese, Arabic, and more
  • โ€”๐Ÿค– Agent-Centric: Best-in-class agentic capabilities with native function calling and JSON output
  • โ€”๐Ÿง  Advanced Reasoning: State-of-the-art conversational and reasoning capabilities
  • โ€”๐Ÿ“ Long Context: 128k token context window for processing large documents
  • โ€”โš–๏ธ Apache 2.0 License: Open license for commercial and non-commercial use
  • โ€”๐ŸŽฏ System Prompt Support: Strong adherence to system prompts

๐Ÿš€ Quick Start

Using with Ollama

bash
# Download and run the model
ollama run hf.co/your-username/mistral-small-3.1-24b-instruct-gguf:q4_k_m

# Or create from local file
ollama create mistral-small-local -f Modelfile
ollama run mistral-small-local

Modelfile for Ollama:

dockerfile
FROM ./mistral-small-3.1-24b-instruct-q4_k_m.gguf

TEMPLATE """<s>[SYSTEM_PROMPT]{{ .System }}[/SYSTEM_PROMPT][INST]{{ .Prompt }}[/INST]"""

PARAMETER temperature 0.15
PARAMETER top_p 0.9
PARAMETER top_k 40
PARAMETER repeat_penalty 1.1
PARAMETER num_ctx 128000

SYSTEM """You are Mistral Small 3.1, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris. You are knowledgeable, creative, and provide detailed responses while being concise when appropriate. You have vision capabilities and can analyze images when provided."""

Using with llama.cpp

bash
# Download the model
huggingface-cli download your-username/mistral-small-3.1-24b-instruct-gguf mistral-small-3.1-24b-instruct-q4_k_m.gguf --local-dir ./models

# Run inference
./llama-cli -m ./models/mistral-small-3.1-24b-instruct-q4_k_m.gguf -p "<s>[SYSTEM_PROMPT]You are a helpful AI assistant.[/SYSTEM_PROMPT][INST]Hello! How are you?[/INST]" -n 256 -c 128000

Using with Python (llama-cpp-python)

python
from llama_cpp import Llama

# Load the model
llm = Llama(
    model_path="./mistral-small-3.1-24b-instruct-q4_k_m.gguf",
    n_ctx=128000,  # Full 128k context window
    n_threads=8,   # Number of CPU threads
    n_gpu_layers=35,  # Number of layers to offload to GPU (if available)
    verbose=False
)

# Generate response with proper template
prompt = "<s>[SYSTEM_PROMPT]You are a helpful AI assistant.[/SYSTEM_PROMPT][INST]Explain quantum computing in simple terms[/INST]"

response = llm(
    prompt,
    max_tokens=512,
    temperature=0.15,
    top_p=0.9,
)

print(response["choices"][0]["text"])

๐Ÿ“Š Quantization Variants

VariantFile SizeDescriptionUse CaseQuality Loss
F1644.0 GBOriginal precisionMaximum quality, researchNone
Q8_023.3 GB8-bit quantizationHigh-end inferenceMinimal
Q6_K18.0 GB6-bit K-quantizationProduction qualityVery Low
Q5_K_M15.6 GB5-bit K-quant (medium)Recommended balanceLow
Q5_K_S15.2 GB5-bit K-quant (small)Balanced quality/sizeLow
Q5_116.5 GB5-bit legacyLegacy compatibilityLow
Q5_015.2 GB5-bit legacyLegacy compatibilityLow
Q4_K_M13.4 GB4-bit K-quant (medium)Popular choiceModerate
Q4_K_S12.5 GB4-bit K-quant (small)Resource constrainedModerate
Q4_113.9 GB4-bit legacyLegacy compatibilityModerate
Q4_012.5 GB4-bit legacyLegacy compatibilityModerate
Q3_K_L11.5 GB3-bit K-quant (large)Limited resourcesNoticeable
Q3_K_M10.8 GB3-bit K-quant (medium)Limited resourcesNoticeable
Q3_K_S9.7 GB3-bit K-quant (small)Very limited resourcesNoticeable
Q2_K8.3 GB2-bit K-quantizationExtreme compressionSignificant

๐ŸŽฏ Recommended Variants

  • โ€”Q5_K_M (15.6 GB): Best balance of quality and size for most users
  • โ€”Q4_K_M (13.4 GB): Good quality with smaller size, popular choice
  • โ€”Q6_K (18.0 GB): Near-original quality if you have the resources
  • โ€”Q3_K_M (10.8 GB): Minimum viable quality for resource-constrained environments

๐Ÿ› ๏ธ Model Details

Architecture

  • โ€”Model Type: Mistral Small 3.1
  • โ€”Parameters: 24 billion
  • โ€”Context Length: 128,000 tokens (128k)
  • โ€”Vocabulary Size: 131,000 (Tekken tokenizer)
  • โ€”Architecture: Transformer with sliding window attention
  • โ€”Precision: Various GGUF quantizations
  • โ€”Base Model: Mistral-Small-3.1-24B-Base-2503

Capabilities

  • โ€”๐Ÿ–ผ๏ธ Vision Understanding: State-of-the-art multimodal capabilities for image analysis
  • โ€”๐Ÿ“ Instruction Following: Excellent at following complex instructions
  • โ€”๐Ÿ’ป Code Generation: Strong programming capabilities across multiple languages
  • โ€”๐Ÿงฎ Mathematical Reasoning: Advanced math and logical reasoning (69.30% on MATH benchmark)
  • โ€”๐ŸŒ Multilingual: Native support for 24+ languages
  • โ€”๐Ÿ’ฌ Conversation: Natural dialogue and chat capabilities
  • โ€”๐Ÿ”ง Function Calling: Native tool calling and JSON output capabilities
  • โ€”๐Ÿ“š Long Context: Process documents up to 128k tokens

Benchmark Performance

Text Benchmarks
  • โ€”MMLU: 80.62% (general knowledge)
  • โ€”MATH: 69.30% (mathematical reasoning)
  • โ€”HumanEval: 88.41% (code generation)
  • โ€”GPQA: 44.42% (graduate-level questions)
Vision Benchmarks
  • โ€”MMMU: 64.00% (multimodal understanding)
  • โ€”ChartQA: 86.24% (chart analysis)
  • โ€”DocVQA: 94.08% (document visual Q&A)
  • โ€”AI2D: 93.72% (scientific diagrams)
Long Context
  • โ€”RULER 32K: 93.96%
  • โ€”RULER 128K: 81.20%
  • โ€”LongBench v2: 37.18%

๐Ÿ’ฌ Chat Template

This model uses the Mistral V7-Tekken instruction format:

<s>[SYSTEM_PROMPT]<system prompt>[/SYSTEM_PROMPT][INST]<user message>[/INST]<assistant response></s>[INST]<user message>[/INST]

Examples:

Basic Chat:

<s>[SYSTEM_PROMPT]You are a helpful AI assistant.[/SYSTEM_PROMPT][INST]Write a Python function to calculate the factorial of a number[/INST]

With Vision:

<s>[SYSTEM_PROMPT]You are a helpful AI assistant with vision capabilities.[/SYSTEM_PROMPT][INST]What do you see in this image? <image>[/INST]

๐Ÿ”ง Technical Requirements

Minimum System Requirements

VariantRAMVRAM (GPU)Storage
Q2_K16 GB8 GB10 GB
Q3KM24 GB12 GB12 GB
Q4KM32 GB16 GB15 GB
Q5KM48 GB18 GB17 GB
Q6_K+64 GB20+ GB20+ GB

Recommended Hardware

  • โ€”CPU: Modern multi-core processor (12+ cores recommended for 128k context)
  • โ€”RAM: 64+ GB for optimal performance with long contexts
  • โ€”GPU: RTX 3090/4090 (24GB), RTX 6000 Ada (48GB), or A100 for GPU acceleration
  • โ€”Storage: NVMe SSD for faster model loading

Note: The original model requires ~55GB GPU RAM in bf16/fp16. Quantized versions significantly reduce memory requirements.

๐Ÿ“ฅ Download Instructions

Individual Files

bash
# Download specific quantization
huggingface-cli download your-username/mistral-small-3.1-24b-instruct-gguf mistral-small-3.1-24b-instruct-q4_k_m.gguf --local-dir ./models

# Download all files (warning: ~200GB total)
huggingface-cli download your-username/mistral-small-3.1-24b-instruct-gguf --local-dir ./models

Git LFS

bash
git clone https://huggingface.co/your-username/mistral-small-3.1-24b-instruct-gguf
cd mistral-small-3.1-24b-instruct-gguf
git lfs pull

๐Ÿงช Usage Examples

Code Generation

<s>[SYSTEM_PROMPT]You are an expert programmer.[/SYSTEM_PROMPT][INST]Create a REST API using FastAPI for a todo application with CRUD operations[/INST]

Creative Writing

<s>[SYSTEM_PROMPT]You are a creative writing assistant.[/SYSTEM_PROMPT][INST]Write a short story about a time traveler who accidentally changes a small detail in the past[/INST]

Data Analysis Help

<s>[SYSTEM_PROMPT]You are a data science expert.[/SYSTEM_PROMPT][INST]I have a dataset with missing values. Explain different strategies to handle them and provide Python code examples[/INST]

Multilingual Support

<s>[SYSTEM_PROMPT]Tu es un assistant multilingue.[/SYSTEM_PROMPT][INST]Explique-moi la diffรฉrence entre l'apprentissage supervisรฉ et non supervisรฉ[/INST]

Function Calling

python
# The model supports native function calling for tool use
tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get current weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {"type": "string", "description": "City name"}
                }
            }
        }
    }
]

๐Ÿ† Ideal Use Cases

  • โ€”๐Ÿ’ฌ Fast-response conversational agents
  • โ€”โšก Low-latency function calling
  • โ€”๐ŸŽ“ Subject matter experts via fine-tuning
  • โ€”๐Ÿ  Local inference for privacy-sensitive applications
  • โ€”๐Ÿ’ป Programming and mathematical reasoning
  • โ€”๐Ÿ“„ Long document understanding and analysis
  • โ€”๐Ÿ–ผ๏ธ Visual content analysis and description
  • โ€”๐ŸŒ Multilingual applications

โš ๏ธ Limitations

  • โ€”Quantization Loss: Lower bit quantizations (Q2, Q3) may show reduced quality, especially for complex reasoning
  • โ€”Context Limit: Maximum context length of 128,000 tokens
  • โ€”Knowledge Cutoff: Training data cutoff as of October 2023
  • โ€”Hallucination: May generate plausible but incorrect information
  • โ€”Bias: May reflect biases present in training data
  • โ€”Vision: Text-only quantizations don't preserve vision capabilities optimally

๐Ÿ›ก๏ธ Ethical Considerations

  • โ€”Use responsibly and in accordance with Mistral AI's usage policies
  • โ€”Be aware of potential biases in model outputs
  • โ€”Verify important information from model responses
  • โ€”Consider privacy implications when processing sensitive data
  • โ€”Follow applicable laws and regulations in your jurisdiction
  • โ€”Respect copyright when analyzing images or documents

๐Ÿ“„ License

This model is released under the Apache 2.0 License, same as the original Mistral-Small-3.1-24B-Instruct-2503 model.

๐Ÿ™ Acknowledgments

  • โ€”Mistral AI for the original Mistral-Small-3.1-24B-Instruct-2503 model
  • โ€”Georgi Gerganov and the llama.cpp team for GGUF format and quantization tools
  • โ€”The open-source community for continued development of efficient inference tools

๐Ÿ“ž Support


<div align="center">

Made with โค๏ธ by the open-source community

๐Ÿค— Hugging Face โ€ข ๐Ÿฆ™ llama.cpp โ€ข ๐Ÿง  Mistral AI โ€ข ๐Ÿ“ฑ Ollama

</div>