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_compat_oai_responses.py from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 3.83 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/unit/test_compat_oai_responses.py
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/server/tests/unit/test_compat_oai_responses.py
-
curl -L -o test_compat_oai_responses.py https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/unit/test_compat_oai_responses.py
3.83 kB
| import pytest | |
| from openai import OpenAI | |
| from utils import * | |
| server: ServerProcess | |
| def create_server(): | |
| global server | |
| server = ServerPreset.tinyllama2() | |
| def test_responses_with_openai_library(): | |
| global server | |
| server.start() | |
| client = OpenAI(api_key="dummy", base_url=f"http://{server.server_host}:{server.server_port}/v1") | |
| res = client.responses.create( | |
| model="gpt-4.1", | |
| input=[ | |
| {"role": "system", "content": "Book"}, | |
| {"role": "user", "content": "What is the best book"}, | |
| ], | |
| max_output_tokens=8, | |
| temperature=0.8, | |
| ) | |
| assert res.id.startswith("resp_") | |
| assert res.output[0].id is not None | |
| assert res.output[0].id.startswith("msg_") | |
| assert match_regex("(Suddenly)+", res.output_text) | |
| def test_responses_stream_with_openai_library(): | |
| global server | |
| server.start() | |
| client = OpenAI(api_key="dummy", base_url=f"http://{server.server_host}:{server.server_port}/v1") | |
| stream = client.responses.create( | |
| model="gpt-4.1", | |
| input=[ | |
| {"role": "system", "content": "Book"}, | |
| {"role": "user", "content": "What is the best book"}, | |
| ], | |
| max_output_tokens=8, | |
| temperature=0.8, | |
| stream=True, | |
| ) | |
| gathered_text = '' | |
| resp_id = '' | |
| msg_id = '' | |
| for r in stream: | |
| if r.type == "response.created": | |
| assert r.response.id.startswith("resp_") | |
| resp_id = r.response.id | |
| if r.type == "response.in_progress": | |
| assert r.response.id == resp_id | |
| if r.type == "response.output_item.added": | |
| assert r.item.id is not None | |
| assert r.item.id.startswith("msg_") | |
| msg_id = r.item.id | |
| if (r.type == "response.content_part.added" or | |
| r.type == "response.output_text.delta" or | |
| r.type == "response.output_text.done" or | |
| r.type == "response.content_part.done"): | |
| assert r.item_id == msg_id | |
| if r.type == "response.output_item.done": | |
| assert r.item.id == msg_id | |
| if r.type == "response.output_text.delta": | |
| gathered_text += r.delta | |
| if r.type == "response.completed": | |
| assert r.response.id.startswith("resp_") | |
| assert r.response.output[0].id is not None | |
| assert r.response.output[0].id.startswith("msg_") | |
| assert gathered_text == r.response.output_text | |
| assert match_regex("(Suddenly)+", r.response.output_text) | |
| def test_responses_stream_with_llama_telemetry(): | |
| global server | |
| server.n_ctx = 256 | |
| server.n_batch = 32 | |
| server.n_slots = 1 | |
| server.start() | |
| saw_progress = False | |
| saw_delta_timings = False | |
| completed = None | |
| res = server.make_stream_request("POST", "/responses", data={ | |
| "input": "This is a test" * 10, | |
| "max_output_tokens": 8, | |
| "temperature": 0.8, | |
| "stream": True, | |
| "timings_per_token": True, | |
| "return_progress": True, | |
| }) | |
| for data in res: | |
| if "prompt_progress" in data: | |
| assert data["type"] == "response.in_progress" | |
| assert data["prompt_progress"]["total"] > 0 | |
| assert data["prompt_progress"]["processed"] >= data["prompt_progress"]["cache"] | |
| saw_progress = True | |
| if "timings" in data: | |
| assert "prompt_per_second" in data["timings"] | |
| assert "predicted_per_second" in data["timings"] | |
| if data["type"] == "response.output_text.delta": | |
| saw_delta_timings = True | |
| if data["type"] == "response.completed": | |
| completed = data | |
| assert saw_progress | |
| assert saw_delta_timings | |
| assert completed is not None | |
| assert "usage" in completed["response"] | |
| assert "timings" in completed | |