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 ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 4.09 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp
-
curl -L -o backend-dispatched-device.cpp https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp
4.09 kB
| uint32_t backend_device_get_device_count(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| int32_t dev_count = reg->iface.get_device_count(reg); | |
| apir_encode_int32_t(enc, &dev_count); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_count(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| int32_t dev_count = reg->iface.get_device_count(reg); | |
| apir_encode_int32_t(enc, &dev_count); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_name(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| const char * string = dev->iface.get_name(dev); | |
| const size_t string_size = strlen(string) + 1; | |
| apir_encode_array_size(enc, string_size); | |
| apir_encode_char_array(enc, string, string_size); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_description(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| const char * string = dev->iface.get_description(dev); | |
| const size_t string_size = strlen(string) + 1; | |
| apir_encode_array_size(enc, string_size); | |
| apir_encode_char_array(enc, string, string_size); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_type(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| uint32_t type = dev->iface.get_type(dev); | |
| apir_encode_uint32_t(enc, &type); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_memory(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| size_t free, total; | |
| dev->iface.get_memory(dev, &free, &total); | |
| apir_encode_size_t(enc, &free); | |
| apir_encode_size_t(enc, &total); | |
| return 0; | |
| } | |
| uint32_t backend_device_supports_op(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| const ggml_tensor * op = apir_decode_ggml_tensor_inplace(dec); | |
| bool supports_op = dev->iface.supports_op(dev, op); | |
| apir_encode_bool_t(enc, &supports_op); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_buffer_type(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| ggml_backend_buffer_type_t bufft = dev->iface.get_buffer_type(dev); | |
| apir_encode_ggml_buffer_type(enc, bufft); | |
| return 0; | |
| } | |
| uint32_t backend_device_get_props(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| ggml_backend_dev_props props; | |
| dev->iface.get_props(dev, &props); | |
| apir_encode_bool_t(enc, &props.caps.async); | |
| apir_encode_bool_t(enc, &props.caps.host_buffer); | |
| apir_encode_bool_t(enc, &props.caps.buffer_from_host_ptr); | |
| apir_encode_bool_t(enc, &props.caps.events); | |
| apir_encode_bool_t(enc, &props.caps.mmap_support); | |
| return 0; | |
| } | |
| uint32_t backend_device_buffer_from_ptr(apir_encoder * enc, apir_decoder * dec, virgl_apir_context * ctx) { | |
| GGML_UNUSED(ctx); | |
| GGML_UNUSED(dec); | |
| uint32_t shmem_res_id; | |
| apir_decode_virtgpu_shmem_res_id(dec, &shmem_res_id); | |
| void * shmem_ptr = ctx->iface->get_shmem_ptr(ctx->ctx_id, shmem_res_id); | |
| if (!shmem_ptr) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: Couldn't get the shmem addr from virgl\n", __func__); | |
| apir_decoder_set_fatal(dec); | |
| return 1; | |
| } | |
| size_t size; | |
| apir_decode_size_t(dec, &size); | |
| size_t max_tensor_size; | |
| apir_decode_size_t(dec, &max_tensor_size); | |
| ggml_backend_buffer_t buffer; | |
| buffer = dev->iface.buffer_from_host_ptr(dev, shmem_ptr, size, max_tensor_size); | |
| apir_encode_ggml_buffer(enc, buffer); | |
| apir_encode_ggml_buffer_type(enc, buffer->buft); | |
| if (buffer) { | |
| apir_track_backend_buffer(buffer); | |
| } | |
| return 0; | |
| } | |