Instructions to use AJKADZ/PHI_CODER 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 AJKADZ/PHI_CODER 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 AJKADZ/PHI_CODER:Q4_K_M # Run inference directly in the terminal: llama cli -hf AJKADZ/PHI_CODER:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AJKADZ/PHI_CODER:Q4_K_M # Run inference directly in the terminal: llama cli -hf AJKADZ/PHI_CODER: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 AJKADZ/PHI_CODER:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf AJKADZ/PHI_CODER: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 AJKADZ/PHI_CODER:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf AJKADZ/PHI_CODER:Q4_K_M
Use Docker
docker model run hf.co/AJKADZ/PHI_CODER:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use AJKADZ/PHI_CODER with Ollama:
ollama run hf.co/AJKADZ/PHI_CODER:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use AJKADZ/PHI_CODER with Docker Model Runner:
docker model run hf.co/AJKADZ/PHI_CODER:Q4_K_M
- Lemonade
How to use AJKADZ/PHI_CODER with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AJKADZ/PHI_CODER:Q4_K_M
Run and chat with the model
lemonade run user.PHI_CODER-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download phi-coder-hf/llama.cpp/tools/server/tests/unit/test_infill.py from AJKADZ/PHI_CODER: direct link, hf CLI and curl.
- Browser
- Download file 2.67 kB
-
https://huggingface.co/AJKADZ/PHI_CODER/resolve/main/phi-coder-hf/llama.cpp/tools/server/tests/unit/test_infill.py
- Command line
-
hf download hf://AJKADZ/PHI_CODER/phi-coder-hf/llama.cpp/tools/server/tests/unit/test_infill.py
-
curl -L -o test_infill.py https://huggingface.co/AJKADZ/PHI_CODER/resolve/main/phi-coder-hf/llama.cpp/tools/server/tests/unit/test_infill.py
2.67 kB
| import pytest | |
| from utils import * | |
| server = ServerPreset.tinyllama_infill() | |
| def create_server(): | |
| global server | |
| server = ServerPreset.tinyllama_infill() | |
| def test_infill_without_input_extra(): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/infill", data={ | |
| "input_prefix": "#include <cstdio>\n#include \"llama.h\"\n\nint main() {\n", | |
| "prompt": " int n_threads = llama_", | |
| "input_suffix": "}\n", | |
| }) | |
| assert res.status_code == 200 | |
| assert match_regex("(Ann|small|shiny|Daddy)+", res.body["content"]) | |
| def test_infill_with_input_extra(): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/infill", data={ | |
| "input_extra": [{ | |
| "filename": "llama.h", | |
| "text": "LLAMA_API int32_t llama_n_threads();\n" | |
| }], | |
| "input_prefix": "#include <cstdio>\n#include \"llama.h\"\n\nint main() {\n", | |
| "prompt": " int n_threads = llama_", | |
| "input_suffix": "}\n", | |
| }) | |
| assert res.status_code == 200 | |
| assert match_regex("(Dad|excited|park)+", res.body["content"]) | |
| def test_invalid_input_extra_req(input_extra): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/infill", data={ | |
| "input_extra": [input_extra], | |
| "input_prefix": "#include <cstdio>\n#include \"llama.h\"\n\nint main() {\n", | |
| "prompt": " int n_threads = llama_", | |
| "input_suffix": "}\n", | |
| }) | |
| assert res.status_code == 400 | |
| assert "error" in res.body | |
| def test_with_qwen_model(): | |
| global server | |
| server.model_file = None | |
| server.model_hf_repo = "ggml-org/Qwen2.5-Coder-1.5B-IQ3_XXS-GGUF" | |
| server.model_hf_file = "qwen2.5-coder-1.5b-iq3_xxs-imat.gguf" | |
| server.start(timeout_seconds=600) | |
| res = server.make_request("POST", "/infill", data={ | |
| "input_extra": [{ | |
| "filename": "llama.h", | |
| "text": "LLAMA_API int32_t llama_n_threads();\n" | |
| }], | |
| "input_prefix": "#include <cstdio>\n#include \"llama.h\"\n\nint main() {\n", | |
| "prompt": " int n_threads = llama_", | |
| "input_suffix": "}\n", | |
| }) | |
| assert res.status_code == 200 | |
| assert res.body["content"] == "n_threads();\n printf(\"Number of threads: %d\\n\", n_threads);\n return 0;\n" | |