Instructions to use cortexso/phi-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use cortexso/phi-4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="cortexso/phi-4", filename="phi-4-q2_k.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use cortexso/phi-4 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cortexso/phi-4:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cortexso/phi-4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cortexso/phi-4:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cortexso/phi-4: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 cortexso/phi-4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf cortexso/phi-4: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 cortexso/phi-4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf cortexso/phi-4:Q4_K_M
Use Docker
docker model run hf.co/cortexso/phi-4:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use cortexso/phi-4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cortexso/phi-4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cortexso/phi-4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cortexso/phi-4:Q4_K_M
- Ollama
How to use cortexso/phi-4 with Ollama:
ollama run hf.co/cortexso/phi-4:Q4_K_M
- Unsloth Studio new
How to use cortexso/phi-4 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 cortexso/phi-4 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 cortexso/phi-4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cortexso/phi-4 to start chatting
- Docker Model Runner
How to use cortexso/phi-4 with Docker Model Runner:
docker model run hf.co/cortexso/phi-4:Q4_K_M
- Lemonade
How to use cortexso/phi-4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cortexso/phi-4:Q4_K_M
Run and chat with the model
lemonade run user.phi-4-Q4_K_M
List all available models
lemonade list
Upload folder using huggingface_hub
Browse files- .gitattributes +10 -0
- phi-4-q2_k.gguf +3 -0
- phi-4-q3_k_l.gguf +3 -0
- phi-4-q3_k_m.gguf +3 -0
- phi-4-q3_k_s.gguf +3 -0
- phi-4-q4_k_m.gguf +3 -0
- phi-4-q4_k_s.gguf +3 -0
- phi-4-q5_k_m.gguf +3 -0
- phi-4-q5_k_s.gguf +3 -0
- phi-4-q6_k.gguf +3 -0
- phi-4-q8_0.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,13 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
phi-4-q2_k.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
phi-4-q3_k_l.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
phi-4-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
phi-4-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
phi-4-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
phi-4-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
phi-4-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
phi-4-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
phi-4-q6_k.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
phi-4-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
phi-4-q2_k.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b58e0ec3909991ab5b8db5340384c52069ecd25b1cdc04211b18caf9540bf2cd
|
| 3 |
+
size 5547348160
|
phi-4-q3_k_l.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cb09f66e7118727bfa7f28a18e3e363b99a341e1485548e408998031caea091
|
| 3 |
+
size 7930155200
|
phi-4-q3_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:308e71080f988d0b4df227c990dbba7a6f06b6e814e98e8cfd80e148e0b42089
|
| 3 |
+
size 7363268800
|
phi-4-q3_k_s.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a45e8a9973c7f868390a80bf370564738c5a69a48444b5e1b64d3622647540ec
|
| 3 |
+
size 6504747200
|
phi-4-q4_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c841ed1474a0b0cdde8464f608035ffef2a8cb253efc2ef2379967f5a730d9a5
|
| 3 |
+
size 9053114560
|
phi-4-q4_k_s.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12a277e4eaa5ee3916cceed912ec3017bb4e24f8b2a21e4f34a0f119796b5285
|
| 3 |
+
size 8440762560
|
phi-4-q5_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23ae8b73adbabe7e9c9e831922a941f7e12a9a6ab188cbe328c6f6b66df1cbf1
|
| 3 |
+
size 10604187840
|
phi-4-q5_k_s.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9d995a1895ed8af162c873d1f0c16187939f91574fb1b24e0e365eae8b648d6
|
| 3 |
+
size 10151579840
|
phi-4-q6_k.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b0faa63b8587d8314fc9d1e99c0d7ccfb19c055377a42d4071cedca72275075
|
| 3 |
+
size 12030251200
|
phi-4-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20e7f05d94b988deef91c96b5e88017f97524b815dd866fb2392ef480044255b
|
| 3 |
+
size 15580500160
|