Instructions to use microsoft/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 microsoft/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 microsoft/Phi-3-mini-4k-instruct-gguf # Run inference directly in the terminal: llama cli -hf microsoft/Phi-3-mini-4k-instruct-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf microsoft/Phi-3-mini-4k-instruct-gguf # Run inference directly in the terminal: llama cli -hf microsoft/Phi-3-mini-4k-instruct-gguf
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf microsoft/Phi-3-mini-4k-instruct-gguf # Run inference directly in the terminal: ./build/bin/llama cli -hf microsoft/Phi-3-mini-4k-instruct-gguf
Use Docker
docker model run hf.co/microsoft/Phi-3-mini-4k-instruct-gguf
- Llama new
- LM Studio
- Jan
- vLLM
How to use microsoft/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 "microsoft/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": "microsoft/Phi-3-mini-4k-instruct-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/microsoft/Phi-3-mini-4k-instruct-gguf
- Ollama
How to use microsoft/Phi-3-mini-4k-instruct-gguf with Ollama:
ollama run hf.co/microsoft/Phi-3-mini-4k-instruct-gguf
- Unsloth Desktop
- Docker Model Runner
How to use microsoft/Phi-3-mini-4k-instruct-gguf with Docker Model Runner:
docker model run hf.co/microsoft/Phi-3-mini-4k-instruct-gguf
- Lemonade
How to use microsoft/Phi-3-mini-4k-instruct-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull microsoft/Phi-3-mini-4k-instruct-gguf
Run and chat with the model
lemonade run user.Phi-3-mini-4k-instruct-gguf-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Try this quantizations, they are way better.
https://huggingface.co/ZeroWw/Phi-3-mini-128k-instruct-GGUF
These are my own quantizations (updated almost daily).
The difference with normal quantizations is that I quantize the output and embed tensors to f16.
and the other tensors to 15_k,q6_k or q8_0.
This creates models that are little or not degraded at all and have a smaller size.
They run at about 3-6 t/sec on CPU only using llama.cpp
And obviously faster on computers with potent GPUs
sure:
step 1:python llama.cpp/convert-hf-to-gguf.py --outtype f16 Phi-3-mini-4k-instruct --outfile Phi-3-mini-4k-instruct.f16.gguf
step 2-X:
./build/bin/llama-quantize --allow-requantize --output-tensor-type f16 --token-embedding-type f16 Phi-3-mini-4k-instruct.f16.gguf Phi-3-mini-4k-instruct.q5_k.gguf $QTYPE $(nproc)
where QTYPE is q5_k q6_k q8_0 etc etc
I also tried to quantize embed+output to q8_0 and the rest to q4 or q5 or q6 but the models degrade too much.
Thank you! I am curious if you notice any quality difference on the f16 and quantized models in comparison with the original one.
@ZeroWw For Q8_0 you can also directly go like this convert-hf-to-gguf.py --outtype q8_0 ..\Phi-3-mini-128k-instruct\ --outfile Phi-3-mini-128k-instruct-Q8_0.gguf, in single pass. Did you test if your method offers measurable performance improvements, like for example better PPL scores?
@ZeroWw For Q8_0 you can also directly go like this
convert-hf-to-gguf.py --outtype q8_0 ..\Phi-3-mini-128k-instruct\ --outfile Phi-3-mini-128k-instruct-Q8_0.gguf, in single pass. Did you test if your method offers measurable performance improvements, like for example better PPL scores?
hmm I have tio check but I think the direct way generates a different output... in my way the output and embed tensors are at F16 and the other tensors at q8_0 or q6_k or q5_k