Instructions to use daskalos-apps/phi4-cybersec-Q4_K_M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use daskalos-apps/phi4-cybersec-Q4_K_M with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="daskalos-apps/phi4-cybersec-Q4_K_M", filename="phi4-mini-instruct-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use daskalos-apps/phi4-cybersec-Q4_K_M with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama-cli -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama-cli -hf daskalos-apps/phi4-cybersec-Q4_K_M: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 daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf daskalos-apps/phi4-cybersec-Q4_K_M: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 daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Use Docker
docker model run hf.co/daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use daskalos-apps/phi4-cybersec-Q4_K_M with Ollama:
ollama run hf.co/daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
- Unsloth Studio new
How to use daskalos-apps/phi4-cybersec-Q4_K_M 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 daskalos-apps/phi4-cybersec-Q4_K_M 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 daskalos-apps/phi4-cybersec-Q4_K_M to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for daskalos-apps/phi4-cybersec-Q4_K_M to start chatting
- Pi new
How to use daskalos-apps/phi4-cybersec-Q4_K_M with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use daskalos-apps/phi4-cybersec-Q4_K_M with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use daskalos-apps/phi4-cybersec-Q4_K_M with Docker Model Runner:
docker model run hf.co/daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
- Lemonade
How to use daskalos-apps/phi4-cybersec-Q4_K_M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull daskalos-apps/phi4-cybersec-Q4_K_M:Q4_K_M
Run and chat with the model
lemonade run user.phi4-cybersec-Q4_K_M-Q4_K_M
List all available models
lemonade list
Phi-4 Cybersecurity Chatbot - Q4_K_M GGUF
This is a quantized version of Microsoft's Phi-4-mini-instruct, optimized for cybersecurity Q&A applications.
Model Details
- Base Model: microsoft/phi-4-mini-instruct
- Quantization: Q4_K_M (4-bit quantization)
- Format: GGUF
- Size: ~2-3GB (reduced from original ~28GB)
- License: MIT
- Use Case: Cybersecurity training and best practices chatbot
Intended Use
This model is specifically fine-tuned and optimized for:
- Answering cybersecurity questions
- Providing security best practices
- Explaining phishing, malware, and other threats
- Guiding on password security and data protection
- Incident response guidance
Performance
- RAM Required: 4-6GB
- CPU Compatible: Yes
- Inference Speed: 15-20 tokens/second on modern CPUs
- Context Length: 4096 tokens
Usage
With llama.cpp
# Download the model
wget https://huggingface.co/YOUR_USERNAME/phi4-cybersec-Q4_K_M/resolve/main/phi4-mini-instruct-Q4_K_M.gguf
# Run with llama.cpp
./main -m phi4-mini-instruct-Q4_K_M.gguf -p "What is phishing?" -n 256
With Python (llama-cpp-python)
from llama_cpp import Llama
# Load model
llm = Llama(
model_path="phi4-mini-instruct-Q4_K_M.gguf",
n_ctx=4096,
n_threads=8,
n_gpu_layers=0 # CPU only
)
# Generate
response = llm(
"What are the best practices for password security?",
max_tokens=256,
temperature=0.7,
stop=["<|end|>", "<|user|>"]
)
print(response['choices'][0]['text'])
With LangChain
from langchain.llms import LlamaCpp
llm = LlamaCpp(
model_path="phi4-mini-instruct-Q4_K_M.gguf",
temperature=0.7,
max_tokens=256,
n_ctx=4096
)
response = llm("How do I identify suspicious emails?")
print(response)
Prompt Format
The model uses ChatML format:
<|system|>
You are a cybersecurity expert assistant.
<|end|>
<|user|>
What is malware?
<|end|>
<|assistant|>
Quantization Details
This model was quantized using llama.cpp with the following process:
- Original model: microsoft/phi-4-mini-instruct
- Conversion: HF โ GGUF format (FP16)
- Quantization: GGUF FP16 โ Q4_K_M
The Q4_K_M quantization method provides:
- 4-bit quantization with K-means
- Mixed precision for important weights
- ~75% size reduction
- Minimal quality loss (<2% on benchmarks)
Limitations
- Optimized for English language
- May require fact-checking for critical security advice
- Not suitable for generating security policies without review
- Should not be sole source for incident response
Ethical Considerations
This model is intended to improve cybersecurity awareness and should be used responsibly:
- Always verify critical security advice
- Don't use for malicious purposes
- Respect privacy and data protection laws
- Consider cultural and organizational context
Citation
If you use this model, please cite:
@misc{phi4-cybersec-gguf,
author = {Your Name},
title = {Phi-4 Cybersecurity Q4_K_M GGUF},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/YOUR_USERNAME/phi4-cybersec-Q4_K_M}
}
Acknowledgments
- Microsoft for the original Phi-4 model
- llama.cpp team for quantization tools
- The open-source community
Contact
For questions or issues: [tech@daskalos-apps.com]
- Downloads last month
- -
4-bit