Instructions to use tensorblock/phi-4-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/phi-4-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/phi-4-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/phi-4-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/phi-4-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 tensorblock/phi-4-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/phi-4-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tensorblock/phi-4-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/phi-4-GGUF:Q2_K
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 tensorblock/phi-4-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama cli -hf tensorblock/phi-4-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/phi-4-GGUF:Q2_K
- Llama new
- LM Studio
- Jan
- vLLM
How to use tensorblock/phi-4-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/phi-4-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": "tensorblock/phi-4-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/phi-4-GGUF:Q2_K
- SGLang
How to use tensorblock/phi-4-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tensorblock/phi-4-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/phi-4-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tensorblock/phi-4-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/phi-4-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/phi-4-GGUF with Ollama:
ollama run hf.co/tensorblock/phi-4-GGUF:Q2_K
- Unsloth Desktop
- Docker Model Runner
How to use tensorblock/phi-4-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/phi-4-GGUF:Q2_K
- Lemonade
How to use tensorblock/phi-4-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/phi-4-GGUF:Q2_K
Run and chat with the model
lemonade run user.phi-4-GGUF-Q2_K
List all available models
lemonade list
- Atomic Chat
Keep Q2_K/Q3_K_M gguf only
Browse files- phi-4-Q3_K_L.gguf +0 -3
- phi-4-Q3_K_S.gguf +0 -3
- phi-4-Q4_0.gguf +0 -3
- phi-4-Q4_K_M.gguf +0 -3
- phi-4-Q4_K_S.gguf +0 -3
- phi-4-Q5_0.gguf +0 -3
- phi-4-Q5_K_M.gguf +0 -3
- phi-4-Q5_K_S.gguf +0 -3
- phi-4-Q6_K.gguf +0 -3
- phi-4-Q8_0.gguf +0 -3
phi-4-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f56babd99b629fd3e4a6fdfa82be89ff0d4b7522925353ded5c00dd3f592bc2a
|
| 3 |
-
size 7930155104
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:03e3f4da25219943b3ef61c1aea0d865d92200ae8d8287042da3e6c723a96c0a
|
| 3 |
-
size 6504747104
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:1e77d0e11ff2d018df67afe192b05853ce47aad2012810dc79162fb858a5b4b7
|
| 3 |
-
size 8383418464
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ab704ffa097f5902b937ca5d0c166226f1201e7492da30fa4e1c086c217afd6b
|
| 3 |
-
size 9053114464
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:076a14910e1d9f02f40996b23f0347ec5a8caa503081cdd037cd268068d2d9cc
|
| 3 |
-
size 8440762464
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3db2aa4eb3b0200662fbee59a223750b8d9205dc51fb611e443f5de3639872cc
|
| 3 |
-
size 10151579744
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:71b29a0ad348ff0c08fa84570e51443a87012921fdc2ffce0baab016b9ef415d
|
| 3 |
-
size 10604187744
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5d8d8e6f8668dee00ba115e5861a1dbc48125fd0a3fa304c552be69f2c924846
|
| 3 |
-
size 10151579744
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:58c70ac0bb2d84b6d0b885eadb624a2a323f0798329cc6969fb6b4ecaab41def
|
| 3 |
-
size 12030251104
|
|
|
|
|
|
|
|
|
|
|
|
phi-4-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:294392031c56647d3c4ca7de0698174efd58469ceb7e171f0cd52169d0f49fdd
|
| 3 |
-
size 15580500064
|
|
|
|
|
|
|
|
|
|
|
|