Instructions to use VladHong/llama-cpp-K2-FAST2 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 VladHong/llama-cpp-K2-FAST2 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 VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: llama cli -hf VladHong/llama-cpp-K2-FAST2
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: llama cli -hf VladHong/llama-cpp-K2-FAST2
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 VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: ./build/bin/llama cli -hf VladHong/llama-cpp-K2-FAST2
Use Docker
docker model run hf.co/VladHong/llama-cpp-K2-FAST2
- Llama new
- LM Studio
- Jan
- Ollama
How to use VladHong/llama-cpp-K2-FAST2 with Ollama:
ollama run hf.co/VladHong/llama-cpp-K2-FAST2
- Unsloth Desktop
- Docker Model Runner
How to use VladHong/llama-cpp-K2-FAST2 with Docker Model Runner:
docker model run hf.co/VladHong/llama-cpp-K2-FAST2
- Lemonade
How to use VladHong/llama-cpp-K2-FAST2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull VladHong/llama-cpp-K2-FAST2
Run and chat with the model
lemonade run user.llama-cpp-K2-FAST2-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download tools/server/tests/unit/test_basic.py from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 3.4 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/unit/test_basic.py
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/server/tests/unit/test_basic.py
-
curl -L -o test_basic.py https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/unit/test_basic.py
3.4 kB
| import pytest | |
| import requests | |
| from utils import * | |
| server = ServerPreset.tinyllama2() | |
| def create_server(): | |
| global server | |
| server = ServerPreset.tinyllama2() | |
| def test_server_start_simple(): | |
| global server | |
| server.start() | |
| res = server.make_request("GET", "/health") | |
| assert res.status_code == 200 | |
| def test_server_props(): | |
| global server | |
| server.start() | |
| res = server.make_request("GET", "/props") | |
| assert res.status_code == 200 | |
| assert ".gguf" in res.body["model_path"] | |
| assert res.body["total_slots"] == server.n_slots | |
| default_val = res.body["default_generation_settings"] | |
| assert server.n_ctx is not None and server.n_slots is not None | |
| assert default_val["n_ctx"] == server.n_ctx / server.n_slots | |
| assert default_val["params"]["seed"] == server.seed | |
| def test_server_models(): | |
| global server | |
| server.start() | |
| res = server.make_request("GET", "/models") | |
| assert res.status_code == 200 | |
| assert len(res.body["data"]) == 1 | |
| assert res.body["data"][0]["id"] == server.model_alias | |
| def test_server_slots(): | |
| global server | |
| # without slots endpoint enabled, this should return error | |
| server.server_slots = False | |
| server.start() | |
| res = server.make_request("GET", "/slots") | |
| assert res.status_code == 501 # ERROR_TYPE_NOT_SUPPORTED | |
| assert "error" in res.body | |
| server.stop() | |
| # with slots endpoint enabled, this should return slots info | |
| server.server_slots = True | |
| server.n_slots = 2 | |
| server.start() | |
| res = server.make_request("GET", "/slots") | |
| assert res.status_code == 200 | |
| assert len(res.body) == server.n_slots | |
| assert server.n_ctx is not None and server.n_slots is not None | |
| assert res.body[0]["n_ctx"] == server.n_ctx / server.n_slots | |
| assert "params" not in res.body[0] | |
| def test_load_split_model(): | |
| global server | |
| server.offline = False | |
| server.model_hf_repo = "ggml-org/models" | |
| server.model_hf_file = "tinyllamas/split/stories15M-q8_0-00001-of-00003.gguf" | |
| server.model_alias = "tinyllama-split" | |
| server.start() | |
| res = server.make_request("POST", "/completion", data={ | |
| "n_predict": 16, | |
| "prompt": "Hello", | |
| "temperature": 0.0, | |
| }) | |
| assert res.status_code == 200 | |
| assert match_regex("(little|girl)+", res.body["content"]) | |
| def test_no_ui(): | |
| global server | |
| # default: UI enabled | |
| server.start() | |
| url = f"http://{server.server_host}:{server.server_port}" | |
| res = requests.get(url) | |
| assert res.status_code == 200 | |
| assert "<!doctype html>" in res.text | |
| server.stop() | |
| # with --no-ui, the UI should be disabled | |
| server.no_ui = True | |
| server.start() | |
| res = requests.get(url) | |
| assert res.status_code == 404 | |
| def test_server_model_aliases_and_tags(): | |
| global server | |
| server.model_alias = "tinyllama-2,fim,code" | |
| server.model_tags = "chat,fim,small" | |
| server.start() | |
| res = server.make_request("GET", "/models") | |
| assert res.status_code == 200 | |
| assert len(res.body["data"]) == 1 | |
| model = res.body["data"][0] | |
| # aliases field must contain all aliases | |
| assert set(model["aliases"]) == {"tinyllama-2", "fim", "code"} | |
| # tags field must contain all tags | |
| assert set(model["tags"]) == {"chat", "fim", "small"} | |
| # id is derived from first alias (alphabetical order from std::set) | |
| assert model["id"] == "code" | |