Instructions to use Felipe97/llama-cpp-compiled 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 Felipe97/llama-cpp-compiled 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 Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
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 Felipe97/llama-cpp-compiled # Run inference directly in the terminal: ./build/bin/llama cli -hf Felipe97/llama-cpp-compiled
Use Docker
docker model run hf.co/Felipe97/llama-cpp-compiled
- Llama new
- LM Studio
- Jan
- Ollama
How to use Felipe97/llama-cpp-compiled with Ollama:
ollama run hf.co/Felipe97/llama-cpp-compiled
- Unsloth Desktop
- Docker Model Runner
How to use Felipe97/llama-cpp-compiled with Docker Model Runner:
docker model run hf.co/Felipe97/llama-cpp-compiled
- Lemonade
How to use Felipe97/llama-cpp-compiled with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Felipe97/llama-cpp-compiled
Run and chat with the model
lemonade run user.llama-cpp-compiled-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download ggml/src/ggml-metal/kernels/common.h from Felipe97/llama-cpp-compiled: direct link, hf CLI and curl.
- Browser
- Download file 3.48 kB
-
https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-metal/kernels/common.h
- Command line
-
hf download hf://Felipe97/llama-cpp-compiled/ggml/src/ggml-metal/kernels/common.h
-
curl -L -o common.h https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/ggml/src/ggml-metal/kernels/common.h
3.48 kB
| using namespace metal; | |
| // ref: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf | |
| // | |
| // cmd: | |
| // .../usr/bin/metal -dM -E -c ggml/src/ggml-metal/kernels/<src>.metal | |
| // .../usr/bin/metal -dM -E -c -target air64-apple-ios14.0 ggml/src/ggml-metal/kernels/<src>.metal | |
| // | |
| typedef matrix<bfloat, 4, 4> bfloat4x4; | |
| typedef matrix<bfloat, 2, 4> bfloat2x4; | |
| constexpr constant static float kvalues_iq4nl_f[16] = { | |
| -127.f, -104.f, -83.f, -65.f, -49.f, -35.f, -22.f, -10.f, 1.f, 13.f, 25.f, 38.f, 53.f, 69.f, 89.f, 113.f | |
| }; | |
| constexpr constant static float kvalues_mxfp4_f[16] = { | |
| 0, .5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, -0, -.5f, -1.f, -1.5f, -2.f, -3.f, -4.f, -6.f | |
| }; | |
| static inline int best_index_int8(int n, constant float * val, float x) { | |
| if (x <= val[0]) return 0; | |
| if (x >= val[n-1]) return n-1; | |
| int ml = 0, mu = n-1; | |
| while (mu-ml > 1) { | |
| int mav = (ml+mu)/2; | |
| if (x < val[mav]) mu = mav; else ml = mav; | |
| } | |
| return x - val[mu-1] < val[mu] - x ? mu-1 : mu; | |
| } | |
| static inline float e8m0_to_fp32(uint8_t x) { | |
| uint32_t bits; | |
| if (x == 0) { | |
| bits = 0x00400000; | |
| } else { | |
| bits = (uint32_t) x << 23; | |
| } | |
| return as_type<float>(bits); | |
| } | |
| static inline float dot(float x, float y) { | |
| return x*y; | |
| } | |
| static inline float sum(float x) { | |
| return x; | |
| } | |
| static inline float sum(float4 x) { | |
| return x[0] + x[1] + x[2] + x[3]; | |
| } | |
| enum ggml_sort_order { | |
| GGML_SORT_ORDER_ASC, | |
| GGML_SORT_ORDER_DESC, | |
| }; | |
| constant float GELU_COEF_A = 0.044715f; | |
| constant float GELU_QUICK_COEF = -1.702f; | |
| constant float SQRT_2_OVER_PI = 0.79788456080286535587989211986876f; | |
| constant float SQRT_2_INV = 0.70710678118654752440084436210484f; | |
| // based on Abramowitz and Stegun formula 7.1.26 or similar Hastings' approximation | |
| // ref: https://www.johndcook.com/blog/python_erf/ | |
| constant float p_erf = 0.3275911f; | |
| constant float a1_erf = 0.254829592f; | |
| constant float a2_erf = -0.284496736f; | |
| constant float a3_erf = 1.421413741f; | |
| constant float a4_erf = -1.453152027f; | |
| constant float a5_erf = 1.061405429f; | |
| template<typename T> | |
| inline T erf_approx(T x) { | |
| T sign_x = sign(x); | |
| x = fabs(x); | |
| T t = 1.0f / (1.0f + p_erf * x); | |
| T y = 1.0f - (((((a5_erf * t + a4_erf) * t) + a3_erf) * t + a2_erf) * t + a1_erf) * t * exp(-x * x); | |
| return sign_x * y; | |
| } | |
| template<typename T> T elu_approx(T x); | |
| template<> inline float elu_approx<float>(float x) { | |
| return (x > 0.f) ? x : (exp(x) - 1); | |
| } | |
| template<> inline float4 elu_approx<float4>(float4 x) { | |
| float4 res; | |
| res[0] = (x[0] > 0.0f) ? x[0] : (exp(x[0]) - 1.0f); | |
| res[1] = (x[1] > 0.0f) ? x[1] : (exp(x[1]) - 1.0f); | |
| res[2] = (x[2] > 0.0f) ? x[2] : (exp(x[2]) - 1.0f); | |
| res[3] = (x[3] > 0.0f) ? x[3] : (exp(x[3]) - 1.0f); | |
| return res; | |
| } | |