Instructions to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
- Ollama
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with Ollama:
ollama run hf.co/SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF to start chatting
- Docker Model Runner
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with Docker Model Runner:
docker model run hf.co/SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
- Lemonade
How to use SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Phi-3-mini-4k-instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Phi-3-Mini-4K-Instruct
Phi-3-Mini-4K-Instruct is a lightweight yet highly capable instruction-tuned large language model developed by Microsoft as part of the Phi-3 family. Designed for conversational AI, reasoning, and instruction-following tasks, the model supports up to 4K tokens of context. To enable efficient local and resource-constrained deployment, the model is provided in GGUF quantized formats, where Q4_K_M and Q5_K_M quantization reduce numerical precision from full precision to 4-bit and 5-bit representations. This significantly lowers memory usage and improves inference speed on CPUs and consumer-grade GPUs, while largely preserving the modelโs response quality and reasoning ability.
Model Overview
- Model Name: Phi-3-Mini-4K-Instruct
- Base Model: microsoft/Phi-3-mini-4k-instruct
- Architecture: Decoder-only Transformer
- Parameters: ~3.8 Billion
- Context Length: 4K tokens
- Quantized Versions:
- Q4_K_M (4-bit quantization)
- Q5_K_M (5-bit quantization)
- Modalities: Text only
- Developer: Microsoft
- License: MIT
Quantization Details
Q4_K_M
- Approx. ~71% size reduction
- Very low memory footprint (2.23 GB)
- Optimized for CPU inference and low-VRAM environments
- Faster inference speeds
- Slight degradation in complex or multi-step reasoning tasks
Q5_K_M
- Approx. ~64% size reduction
- Better fidelity to the original FP16 model (2.64 GB)
- Improved coherence and reasoning consistency
- Recommended when slightly more memory is available
Training Details (Original Model)
Phi-3-Mini-4K-Instruct is trained using a multi-stage pipeline focused on high-quality reasoning and instruction alignment, optimized for strong performance at small scale.
Pretraining
- Trained on a curated mixture of high-quality publicly available data.
- Emphasis on reasoning-centric content, including:
- Mathematics
- Logic
- Code
- Scientific and technical text
- Uses autoregressive language modeling as the primary training objective.
- Designed to maximize reasoning efficiency per parameter.
Instruction Fine-Tuning
- Fine-tuned on diverse supervised instruction datasets.
- Further aligned using preference optimization techniques.
- Improves:
- Instruction-following accuracy
- Safety and response helpfulness
- Multi-turn conversational coherence
Key Features
Instruction-tuned chat model
Designed to follow user instructions accurately and generate helpful, aligned responses.Compact and efficient
Strong reasoning performance with a small parameter count, suitable for local and edge deployment.Strong reasoning capabilities
Performs well on logical, mathematical, and analytical tasks relative to its size.Multi-turn dialogue support
Maintains context across short-to-medium conversations.Efficient inference via GGUF
Quantized GGUF formats enable fast, low-memory inference on CPUs and consumer GPUs.Safe and aligned outputs
Fine-tuned to reduce harmful, misleading, or unsafe responses.
Usage
llama.cpp
./llama-cli \
-m SandLogicTechnologies/Phi-3-mini-4k-instruct_Q4_K_M.gguf \
-p "Explain transformers in simple terms."
Recommended Use Cases
- Local AI assistants Run lightweight, offline chat assistants on personal machines.
-Reasoning and Q&A tasks Perform logical analysis, explanations, and structured problem-solving.
Developer tools Integrate into coding helpers, documentation assistants, or CLI tools.
Edge and CPU inference Ideal for laptops, desktops, and low-resource environments.
Privacy-preserving applications Keep inference fully local with no external data transmission.
Acknowledgments
These quantized models are based on the original work by Microsoft development team.
Special thanks to:
The Microsoft team for developing and releasing the Phi-3-mini-4k-instruct model.
Georgi Gerganov and the entire
llama.cppopen-source community for enabling efficient model quantization and inference via the GGUF format.
Contact
For any inquiries or support, please contact us at support@sandlogic.com or visit our Website. ```
- Downloads last month
- 33
4-bit
5-bit
Model tree for SandLogicTechnologies/Phi-3-mini-4k-instruct-GGUF
Base model
microsoft/Phi-3-mini-4k-instruct