Phi-3-medium-128k-instruct

Microsoft (United States) · Language (text)

🧠 14.0B📄 128K context🔓 Open weights (downloadable)⚖️ mit

Which way is for me?

💻 On my own computer

  1. Download and install LM Studio (free): lmstudio.ai
  2. In LM Studio open Search (the magnifier) and type exactly:
    bartowski/Phi-3-medium-128k-instruct-GGUF
  3. From the list of files pick the version the check above suggested; if unsure, take Q4_K_M (compressed, slightly lower quality, less memory).
  4. Press Download, then Load, and start talking in Chat.

Or, if you use Ollama, this one command is enough:

ollama run hf.co/bartowski/Phi-3-medium-128k-instruct-GGUF

🧑‍💻 For developers

vLLM

vllm serve microsoft/Phi-3-medium-128k-instruct

Transformers (Python)

from transformers import pipeline
pipe = pipeline("text-generation", model="microsoft/Phi-3-medium-128k-instruct")

llama.cpp

llama-server -hf bartowski/Phi-3-medium-128k-instruct-GGUF
Words used here
GGUF
The file format LM Studio, Ollama and llama.cpp use to run a model.
Quantization (Q4, Q8)
Shrinking a model by storing numbers less precisely: Q4 smallest and slightly weaker, Q8 almost full, FP16 full.
VRAM
The graphics card's memory (or shared memory on a Mac); the model has to fit in it.
Context
The most text the model can see at once in a conversation (questions, answers and files).
Tokens per second
How fast the answer is written; 20 is about reading speed, 5 is slow.

From the Hugging Face model card

The Phi-3-Medium-128K-Instruct is a 14B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes both synthetic data and the filtered publicly available websites data with a focus on high-quality and reasoning dense properties. The model belongs to the Phi-3 family with the Medium version in two variants 4k and 128K which is the context length (in tokens) that it can support.

Intended use

The model is intended for broad commercial and research use in English. The model provides uses for general purpose AI systems and applications which require :

Benchmarks (from the model card)

BenchmarkPhi-3-Medium-128k-Instruct 14bCommand R+ 104BMixtral 8x22BLlama-3-70B-InstructGPT3.5-Turbo version 1106Gemini Pro
AGI Eval 5-shot49.750.154.056.948.449.0
MMLU 5-shot76.673.876.280.271.466.7
BigBench Hard 3-shot77.974.181.880.468.375.6
ANLI 7-shot57.363.465.268.358.164.2
HellaSwag 5-shot81.678.079.082.678.876.2
ARC Challenge 10-shot91.086.991.393.087.488.3
ARC Easy 10-shot97.695.796.998.296.396.1
BoolQ 2-shot86.586.182.789.179.186.4

Source: Hugging Face · microsoft/Phi-3-medium-128k-instruct · License: mit

Hardware and running it

Local Weights are published and it runs on your own hardware.

Minimum Q4
9.4 GB
Recommended Q8
16.8 GB
Full quality FP16
33.5 GB

On common hardware

RTX 4060 · 8 GBWon't run
RTX 4090 · 24 GBGreatQ8 · ≈ 26–43 tokens/s
RTX 5090 · 32 GBGreatQ8 · ≈ 46–77 tokens/s
Mac M4 Max · 128 GBUsableFP16 · ≈ 7–12 tokens/s
H100 · 80 GBGreatFP16 · ≈ 43–72 tokens/s
8× H100 · 640 GBGreatFP16 · ≈ 350–580 tokens/s

Speeds are estimates. estimated speed for one user, from memory bandwidth

Links come from the vendor's official site and the model card the vendor published · Updated: