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-cpu/common.h from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/ggml/src/ggml-cpu/common.h
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/ggml/src/ggml-cpu/common.h
-
curl -L -o common.h https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/ggml/src/ggml-cpu/common.h
2.33 kB
| // convenience functions/macros for use in template calls | |
| // note: these won't be required after the 'traits' lookup table is used. | |
| static inline ggml_fp16_t f32_to_f16(float x) { | |
| return GGML_CPU_FP32_TO_FP16(x); | |
| } | |
| static inline float f16_to_f32(ggml_fp16_t x) { | |
| return GGML_CPU_FP16_TO_FP32(x); | |
| } | |
| static inline ggml_bf16_t f32_to_bf16(float x) { | |
| return GGML_FP32_TO_BF16(x); | |
| } | |
| static inline float bf16_to_f32(ggml_bf16_t x) { | |
| return GGML_BF16_TO_FP32(x); | |
| } | |
| static inline float i32_to_f32(int32_t x) { | |
| return x; | |
| } | |
| static inline int32_t f32_to_i32(float x) { | |
| return x; | |
| } | |
| static inline float f32_to_f32(float x) { | |
| return x; | |
| } | |
| // TODO - merge this into the traits table, after using row-based conversions | |
| template <class T> | |
| struct type_conversion_table; | |
| template <> | |
| struct type_conversion_table<ggml_fp16_t> { | |
| static constexpr float (*to_f32)(ggml_fp16_t) = f16_to_f32; | |
| static constexpr ggml_fp16_t (*from_f32)(float) = f32_to_f16; | |
| }; | |
| template <> | |
| struct type_conversion_table<float> { | |
| static constexpr float (*to_f32)(float) = f32_to_f32; | |
| static constexpr float (*from_f32)(float) = f32_to_f32; | |
| }; | |
| template <> | |
| struct type_conversion_table<ggml_bf16_t> { | |
| static constexpr float (*to_f32)(ggml_bf16_t) = bf16_to_f32; | |
| static constexpr ggml_bf16_t (*from_f32)(float) = f32_to_bf16; | |
| }; | |
| template <> | |
| struct type_conversion_table<int32_t> { | |
| static constexpr float (*to_f32)(int32_t) = i32_to_f32; | |
| static constexpr int32_t (*from_f32)(float) = f32_to_i32; | |
| }; | |
| static std::pair<int64_t, int64_t> get_thread_range(const struct ggml_compute_params * params, const struct ggml_tensor * src0) { | |
| const int64_t ith = params->ith; | |
| const int64_t nth = params->nth; | |
| const int64_t nr = ggml_nrows(src0); | |
| // rows per thread | |
| const int64_t dr = (nr + nth - 1)/nth; | |
| // row range for this thread | |
| const int64_t ir0 = dr*ith; | |
| const int64_t ir1 = MIN(ir0 + dr, nr); | |
| return {ir0, ir1}; | |
| } | |
| struct ggml_fa_tile_config { | |
| static constexpr size_t Q = GGML_FA_TILE_Q; | |
| static constexpr size_t KV = GGML_FA_TILE_KV; | |
| }; | |