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
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 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"
Update README.md
Browse files
README.md
CHANGED
|
@@ -38,7 +38,7 @@ Start the llama-server with the following command:
|
|
| 38 |
```bash
|
| 39 |
llama-server \
|
| 40 |
--model models/Phi-4-mini-instruct-Q4_K_M-tool_use.gguf \
|
| 41 |
-
--port
|
| 42 |
--jinja
|
| 43 |
```
|
| 44 |
|
|
@@ -52,53 +52,69 @@ This will start the server with:
|
|
| 52 |
|
| 53 |
You can test the server using curl commands. Here are some examples:
|
| 54 |
|
| 55 |
-
### Example 1:
|
| 56 |
|
| 57 |
```bash
|
| 58 |
-
curl http://localhost:
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"messages": [
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
| 64 |
]
|
| 65 |
-
|
| 66 |
```
|
| 67 |
|
| 68 |
-
### Example 2:
|
| 69 |
|
| 70 |
```bash
|
| 71 |
-
curl http://localhost:
|
| 72 |
-H "Content-Type: application/json" \
|
| 73 |
-d '{
|
| 74 |
-
"model": "
|
| 75 |
"messages": [
|
| 76 |
-
{"role":"
|
|
|
|
| 77 |
]
|
| 78 |
}'
|
| 79 |
```
|
| 80 |
|
| 81 |
-
### Example
|
| 82 |
|
| 83 |
```bash
|
| 84 |
-
curl http://localhost:
|
| 85 |
-H "Content-Type: application/json" \
|
| 86 |
-d '{
|
| 87 |
-
"model": "
|
| 88 |
"messages": [
|
| 89 |
-
{
|
| 90 |
-
|
| 91 |
-
"content": "You are a helpful AI assistant that can use tools.",
|
| 92 |
-
"tools": "[{\"name\": \"calculator\", \"description\": \"Useful for performing mathematical calculations\", \"parameters\": {\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to evaluate\"}}}}]"
|
| 93 |
-
},
|
| 94 |
-
{
|
| 95 |
-
"role": "user",
|
| 96 |
-
"content": "What is 235 * 89?"
|
| 97 |
-
}
|
| 98 |
]
|
| 99 |
}'
|
| 100 |
```
|
| 101 |
|
|
|
|
|
|
|
| 102 |
## API Endpoints
|
| 103 |
|
| 104 |
The server provides a ChatGPT-compatible API with the following main endpoints:
|
|
@@ -122,7 +138,6 @@ If you encounter issues:
|
|
| 122 |
1. Ensure the model file exists in the specified path
|
| 123 |
2. Check that port 8082 is not in use by another application
|
| 124 |
3. Verify that llama-cpp-python is installed with server support
|
| 125 |
-
4. Check the server logs with `--verbose` flag for detailed information
|
| 126 |
|
| 127 |
## License
|
| 128 |
|
|
|
|
| 38 |
```bash
|
| 39 |
llama-server \
|
| 40 |
--model models/Phi-4-mini-instruct-Q4_K_M-tool_use.gguf \
|
| 41 |
+
--port 8080 \
|
| 42 |
--jinja
|
| 43 |
```
|
| 44 |
|
|
|
|
| 52 |
|
| 53 |
You can test the server using curl commands. Here are some examples:
|
| 54 |
|
| 55 |
+
### Example 1: Using Tools
|
| 56 |
|
| 57 |
```bash
|
| 58 |
+
curl http://localhost:8080/v1/chat/completions -d '{
|
| 59 |
+
"model": "phi-4-mini-instruct-with-tools",
|
| 60 |
+
"tools": [
|
| 61 |
+
{
|
| 62 |
+
"type":"function",
|
| 63 |
+
"function":{
|
| 64 |
+
"name":"python",
|
| 65 |
+
"description":"Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.",
|
| 66 |
+
"parameters":{
|
| 67 |
+
"type":"object",
|
| 68 |
+
"properties":{
|
| 69 |
+
"code":{
|
| 70 |
+
"type":"string",
|
| 71 |
+
"description":"The code to run in the ipython interpreter."
|
| 72 |
+
}
|
| 73 |
+
},
|
| 74 |
+
"required":["code"]
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
],
|
| 79 |
"messages": [
|
| 80 |
+
{
|
| 81 |
+
"role": "user",
|
| 82 |
+
"content": "Print a hello world message with python."
|
| 83 |
+
}
|
| 84 |
]
|
| 85 |
+
}'
|
| 86 |
```
|
| 87 |
|
| 88 |
+
### Example 2: Generate HTML Hello World
|
| 89 |
|
| 90 |
```bash
|
| 91 |
+
curl http://localhost:8080/v1/chat/completions \
|
| 92 |
-H "Content-Type: application/json" \
|
| 93 |
-d '{
|
| 94 |
+
"model": "phi-4-mini-instruct-with-tools",
|
| 95 |
"messages": [
|
| 96 |
+
{"role":"system","content":"You are a helpful coding assistant"},
|
| 97 |
+
{"role":"user","content":"give me an html hello world document"}
|
| 98 |
]
|
| 99 |
}'
|
| 100 |
```
|
| 101 |
|
| 102 |
+
### Example 2: Tell a Joke
|
| 103 |
|
| 104 |
```bash
|
| 105 |
+
curl http://localhost:8080/v1/chat/completions \
|
| 106 |
-H "Content-Type: application/json" \
|
| 107 |
-d '{
|
| 108 |
+
"model": "phi-4-mini-instruct-with-tools",
|
| 109 |
"messages": [
|
| 110 |
+
{"role":"system","content":"You are a helpful clown instruction assistant"},
|
| 111 |
+
{"role":"user","content":"tell me a funny joke"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
]
|
| 113 |
}'
|
| 114 |
```
|
| 115 |
|
| 116 |
+
|
| 117 |
+
|
| 118 |
## API Endpoints
|
| 119 |
|
| 120 |
The server provides a ChatGPT-compatible API with the following main endpoints:
|
|
|
|
| 138 |
1. Ensure the model file exists in the specified path
|
| 139 |
2. Check that port 8082 is not in use by another application
|
| 140 |
3. Verify that llama-cpp-python is installed with server support
|
|
|
|
| 141 |
|
| 142 |
## License
|
| 143 |
|