Instructions to use ariel-pillar/phi-4_function_calling 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 ariel-pillar/phi-4_function_calling 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 ariel-pillar/phi-4_function_calling:Q4_K_M # Run inference directly in the terminal: llama cli -hf ariel-pillar/phi-4_function_calling:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ariel-pillar/phi-4_function_calling:Q4_K_M # Run inference directly in the terminal: llama cli -hf ariel-pillar/phi-4_function_calling: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 ariel-pillar/phi-4_function_calling:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ariel-pillar/phi-4_function_calling: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 ariel-pillar/phi-4_function_calling:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ariel-pillar/phi-4_function_calling:Q4_K_M
Use Docker
docker model run hf.co/ariel-pillar/phi-4_function_calling:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use ariel-pillar/phi-4_function_calling with Ollama:
ollama run hf.co/ariel-pillar/phi-4_function_calling:Q4_K_M
- Unsloth Desktop
- Pi
How to use ariel-pillar/phi-4_function_calling with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ariel-pillar/phi-4_function_calling:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ariel-pillar/phi-4_function_calling:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ariel-pillar/phi-4_function_calling with Docker Model Runner:
docker model run hf.co/ariel-pillar/phi-4_function_calling:Q4_K_M
- Lemonade
How to use ariel-pillar/phi-4_function_calling with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ariel-pillar/phi-4_function_calling:Q4_K_M
Run and chat with the model
lemonade run user.phi-4_function_calling-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ariel-pillar/phi-4_function_calling with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ariel-pillar/phi-4_function_calling: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 ariel-pillar/phi-4_function_calling:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ariel-pillar/phi-4_function_calling with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ariel-pillar/phi-4_function_calling:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ariel-pillar/phi-4_function_calling:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- microsoft/Phi-4-mini-instruct
|
| 4 |
+
---
|
| 5 |
+
# Phi-4-mini-instruct with llama-server
|
| 6 |
+
|
| 7 |
+
This repository contains instructions for running the Phi-4-mini-instruct model using llama-server, which provides a ChatGPT-compatible API interface.
|
| 8 |
+
|
| 9 |
+
## Prerequisites
|
| 10 |
+
|
| 11 |
+
- [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) installed with server support
|
| 12 |
+
- The Phi-4-mini-instruct model in GGUF format
|
| 13 |
+
|
| 14 |
+
## Installation
|
| 15 |
+
|
| 16 |
+
1. Install llama-cpp-python with server support:
|
| 17 |
+
```bash
|
| 18 |
+
pip install llama-cpp-python[server]
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
2. Ensure your model file is in the correct location:
|
| 22 |
+
```bash
|
| 23 |
+
models/Phi-4-mini-instruct-Q4_K_M-modified.gguf
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Running the Server
|
| 27 |
+
|
| 28 |
+
Start the llama-server with the following command:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
llama-server \
|
| 32 |
+
--model models/Phi-4-mini-instruct-Q4_K_M-modified.gguf \
|
| 33 |
+
--port 8082 \
|
| 34 |
+
--verbose \
|
| 35 |
+
--jinja
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
This will start the server with:
|
| 39 |
+
- The model loaded in memory
|
| 40 |
+
- Server running on port 8082
|
| 41 |
+
- Verbose logging enabled
|
| 42 |
+
- Jinja template support for chat formatting
|
| 43 |
+
|
| 44 |
+
## Testing the API
|
| 45 |
+
|
| 46 |
+
You can test the server using curl commands. Here are some examples:
|
| 47 |
+
|
| 48 |
+
### Example 1: Generate HTML Hello World
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
curl http://localhost:8082/v1/chat/completions \
|
| 52 |
+
-H "Content-Type: application/json" \
|
| 53 |
+
-d '{
|
| 54 |
+
"model": "any-model",
|
| 55 |
+
"messages": [
|
| 56 |
+
{"role":"user","content":"give me an html hello world document"}
|
| 57 |
+
]
|
| 58 |
+
}'
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
### Example 2: Tell a Joke
|
| 62 |
+
|
| 63 |
+
```bash
|
| 64 |
+
curl http://localhost:8082/v1/chat/completions \
|
| 65 |
+
-H "Content-Type: application/json" \
|
| 66 |
+
-d '{
|
| 67 |
+
"model": "any-model",
|
| 68 |
+
"messages": [
|
| 69 |
+
{"role":"user","content":"tell me a funny joke"}
|
| 70 |
+
]
|
| 71 |
+
}'
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## API Endpoints
|
| 75 |
+
|
| 76 |
+
The server provides a ChatGPT-compatible API with the following main endpoints:
|
| 77 |
+
|
| 78 |
+
- `/v1/chat/completions` - For chat completions
|
| 79 |
+
- `/v1/completions` - For text completions
|
| 80 |
+
- `/v1/models` - To list available models
|
| 81 |
+
|
| 82 |
+
## Notes
|
| 83 |
+
|
| 84 |
+
- The server uses the same API format as OpenAI's ChatGPT API, making it compatible with many existing tools and libraries
|
| 85 |
+
- The `--jinja` flag enables proper chat template formatting for the model
|
| 86 |
+
- The model name in the requests can be set to "any-model" as shown in the examples
|
| 87 |
+
|
| 88 |
+
## Troubleshooting
|
| 89 |
+
|
| 90 |
+
If you encounter issues:
|
| 91 |
+
|
| 92 |
+
1. Ensure the model file exists in the specified path
|
| 93 |
+
2. Check that port 8082 is not in use by another application
|
| 94 |
+
3. Verify that llama-cpp-python is installed with server support
|
| 95 |
+
4. Check the server logs with `--verbose` flag for detailed information
|
| 96 |
+
|
| 97 |
+
## License
|
| 98 |
+
|
| 99 |
+
Please ensure you comply with the model's license terms when using it.
|