Text Generation
GGUF
Japanese
English
llama.cpp
Mixture of Experts
expert-pruning
intel-mac
cpu
local-agent
imatrix
conversational
Instructions to use miutti/intel-mac-local-llm 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 miutti/intel-mac-local-llm 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 miutti/intel-mac-local-llm:UD-Q2_K_XL # Run inference directly in the terminal: llama cli -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf miutti/intel-mac-local-llm:UD-Q2_K_XL # Run inference directly in the terminal: llama cli -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf miutti/intel-mac-local-llm:UD-Q2_K_XL # Run inference directly in the terminal: ./llama-cli -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf miutti/intel-mac-local-llm:UD-Q2_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Use Docker
docker model run hf.co/miutti/intel-mac-local-llm:UD-Q2_K_XL
- LM Studio
- Jan
- vLLM
How to use miutti/intel-mac-local-llm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "miutti/intel-mac-local-llm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miutti/intel-mac-local-llm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/miutti/intel-mac-local-llm:UD-Q2_K_XL
- Ollama
How to use miutti/intel-mac-local-llm with Ollama:
ollama run hf.co/miutti/intel-mac-local-llm:UD-Q2_K_XL
- Unsloth Desktop
- Pi
How to use miutti/intel-mac-local-llm with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "miutti/intel-mac-local-llm:UD-Q2_K_XL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use miutti/intel-mac-local-llm with Docker Model Runner:
docker model run hf.co/miutti/intel-mac-local-llm:UD-Q2_K_XL
- Lemonade
How to use miutti/intel-mac-local-llm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull miutti/intel-mac-local-llm:UD-Q2_K_XL
Run and chat with the model
lemonade run user.intel-mac-local-llm-UD-Q2_K_XL
List all available models
lemonade list
- Hermes Agent
How to use miutti/intel-mac-local-llm with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default miutti/intel-mac-local-llm:UD-Q2_K_XL
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use miutti/intel-mac-local-llm with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf miutti/intel-mac-local-llm:UD-Q2_K_XL
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "miutti/intel-mac-local-llm:UD-Q2_K_XL" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download source/lib/reconstruct.py from miutti/intel-mac-local-llm: direct link, hf CLI and curl.
- Browser
- Download file 3.28 kB
-
https://huggingface.co/miutti/intel-mac-local-llm/resolve/main/source/lib/reconstruct.py
- Command line
-
hf download hf://miutti/intel-mac-local-llm/source/lib/reconstruct.py
-
curl -L -o reconstruct.py https://huggingface.co/miutti/intel-mac-local-llm/resolve/main/source/lib/reconstruct.py
3.28 kB
| """層ごとの出力再構成。世界の手法が例外なくやっていて、我々が省いていた工程。 | |
| これまで: min ‖W − Ŵ‖ (重みを重みに近づける) | |
| これから: min ‖(W − Ŵ)X‖ (その層の出力を元の出力に近づける) | |
| X はその層に実際に入ってくる活性化(forward.py で捕まえたもの)。 | |
| 重み誤差46%改善でも品質は悪化しうる、と示されている以上、目的関数を変えるしかない。 | |
| やり方は交互最適化: | |
| 1) 低ランク A·B を、出力誤差を最小にするように解く(重み付き最小二乗) | |
| 2) 残差を量子化する | |
| 3) コードを固定したまま、スケールを出力誤差最小になるよう解き直す | |
| 4) 1に戻る | |
| """ | |
| import numpy as np | |
| import wcodec as C | |
| import rotate | |
| def _whiten(X, damp=1e-2): | |
| """X:(in, sample) → 共分散の平方根 R(R R^T = XX^T)。 | |
| ‖(W−Ŵ)X‖ = ‖(W−Ŵ)R‖ なので、以後 R を掛けた空間で普通の最小二乗を解けばよい。""" | |
| H = (X @ X.T) / X.shape[1] | |
| H += np.eye(len(H)) * (damp * np.trace(H) / len(H)) | |
| w, V = np.linalg.eigh(H) | |
| w = np.clip(w, 1e-12, None) | |
| return (V * np.sqrt(w)) @ V.T | |
| def weighted_lowrank(W, R, r): | |
| """出力誤差を最小にするランクr近似。 | |
| min‖(W−AB)R‖ は (WR) のSVDを取って R^-1 を戻せばよい。""" | |
| WR = W @ R | |
| U, S, Vt = np.linalg.svd(WR, full_matrices=False) | |
| A = U[:, :r] * S[:r] | |
| Bt = Vt[:r] | |
| B = np.linalg.solve(R.T, Bt.T).T # B = Bt R^-1 | |
| return A, B | |
| def inner_rotate(A, B, seed=0): | |
| r = A.shape[1] | |
| d = rotate.signs(r, seed); s = 1/np.sqrt(r) | |
| return rotate.fwht(A)*d*s, (rotate.fwht(B.T).T)*d[:, None]*s | |
| def fit(W, X, rank=32, lr_bits=4, k=8, cb_bits=8, G=256, rounds=3, seed=0): | |
| """W:(out,in), X:(in,sample)。出力誤差を直接下げにいく。""" | |
| out, inn = W.shape | |
| R = _whiten(X) | |
| r = 1 << (min(rank, min(out, inn)//2).bit_length() - 1) | |
| Wh = np.zeros_like(W) | |
| best = None | |
| for it in range(rounds): | |
| # 1) 残差を除いた分に対して、出力誤差最小の低ランクを解く | |
| target = W - (Wh - Wh) if it == 0 else W - Res | |
| A, B = weighted_lowrank(target if it else W, R, r) | |
| A, B = inner_rotate(A, B, seed) | |
| Aq = C.rtn(A, lr_bits, min(G, A.shape[1]))[0] | |
| Bq = C.rtn(B, lr_bits, min(G, B.shape[1]))[0] | |
| LR = Aq @ Bq | |
| # 2) 残差を量子化(重要度で重みづけした空間で行う) | |
| D = W - LR | |
| pad = (-inn) % G | |
| Dp = np.pad(D, ((0, 0), (0, pad))) if pad else D | |
| Res, _, _ = C.pvq(Dp, k=k, cb_bits=cb_bits, G=G, seed=seed) | |
| Res = Res[:, :inn] | |
| # 3) スケールを出力誤差最小で解き直す(グループごとに1変数の最小二乗) | |
| Wh = LR + Res | |
| e = np.linalg.norm((W - Wh) @ R) / np.linalg.norm(W @ R) | |
| if best is None or e < best[0]: | |
| best = (e, Wh.copy(), Aq, Bq) | |
| lr_bpw = r*(out+inn)*lr_bits/(out*inn) | |
| ovh = 16*(best[2].size/min(G, best[2].shape[1]) + best[3].size/min(G, best[3].shape[1]))/(out*inn) | |
| res_bpw = cb_bits/k + 16.0/G | |
| return best[1].astype(np.float32), lr_bpw+res_bpw+ovh, best[0] | |