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"
File size: 3,614 Bytes
df41178 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | """誤差補償つき量子化(GPTQ系)。
素朴な量子化は「重みを丸める」が、本当に守りたいのは出力 y=Wx。
ある列を丸めた誤差を、まだ丸めていない列に押しつけて打ち消せば、
同じビット数でも出力誤差だけを大きく下げられる。ここが1bit未満を
実用に近づける唯一の現実的なテコ。
"""
import numpy as np
import wcodec as C
def hessian(X, damp=0.01):
"""X: (in, nsample) の較正用活性化。H = X X^T(+ 対角ダンピング)"""
H = (X @ X.T).astype(np.float64) / X.shape[1]
d = np.mean(np.diag(H)) * damp
H[np.diag_indices_from(H)] += d
dead = np.diag(H) == 0
H[dead, dead] = 1.0
return H
def _hinv_chol(H):
"""GPTQ の定石: inv(H) のコレスキー上三角。"""
Hi = np.linalg.inv(H)
Hi = (Hi + Hi.T) / 2
L = np.linalg.cholesky(Hi) # 下三角 L, Hi = L L^T
return np.linalg.cholesky(np.linalg.inv(H)).T if False else L.T
def gptq_scalar(W, X, bits=2, G=128, ternary=False):
"""列を1本ずつ丸め、誤差を右側の未処理列へ流す(本家GPTQ相当)。"""
W = W.astype(np.float64).copy()
n = W.shape[1]
U = _hinv_chol(hessian(X))
# グループごとのスケールは元の重みから先に決めておく
W0 = W.copy()
for start in range(0, n, G):
end = min(start + G, n)
blk = W0[:, start:end]
s = np.abs(blk).max(1, keepdims=True)
s[s == 0] = 1
if ternary:
s = np.abs(blk).mean(1, keepdims=True); s[s == 0] = 1
qmax = 1
else:
qmax = 2 ** (bits - 1) - 1
for j in range(start, end):
w = W[:, j:j + 1]
q = np.clip(np.rint(w / s * qmax), -qmax, qmax) / qmax * s
W0[:, j:j + 1] = q # 記録用
err = (w - q) / U[j, j]
if j + 1 < n:
W[:, j + 1:] -= err @ U[j:j + 1, j + 1:]
W[:, j:j + 1] = q
bpw = (np.log2(3) if ternary else bits) + 16 / G
name = "三値" if ternary else f"{bits}bit"
return W.astype(np.float32), bpw, f"GPTQ-{name}(G={G})"
def gptq_pvq(W, X, k=8, cb_bits=4, G=128, seed=0, iters=8):
"""k列ずつまとめてベクトル量子化し、ブロック外へ誤差を流す。
ブロック内の逐次補正は省略(近似)。
"""
W = W.astype(np.float64).copy()
out, n = W.shape
assert n % k == 0 and G % k == 0
U = _hinv_chol(hessian(X))
# コードブックは元の重みから一度だけ学習
Xg = C._grouped(W.astype(np.float32), G)
s_all = C._scales(Xg)
Cb = C._kmeans((Xg / s_all).reshape(-1, k).astype(np.float32),
2 ** cb_bits, iters=iters, seed=seed)
for start in range(0, n, G):
end = min(start + G, n)
s = np.abs(W[:, start:end]).max(1, keepdims=True)
s[s == 0] = 1
for j in range(start, end, k):
blk = W[:, j:j + k] / s # (out,k)
idx = C._assign(blk.astype(np.float32), Cb)
q = Cb[idx] * s # (out,k)
E = W[:, j:j + k] - q
W[:, j:j + k] = q
if j + k < n:
# ブロックの各列の誤差を、右側の未処理列へ流す
for t in range(k):
col = j + t
err = E[:, t:t + 1] / U[col, col]
W[:, j + k:] -= err @ U[col:col + 1, j + k:]
bpw = cb_bits / k + 16 / G
return W.astype(np.float32), bpw, f"GPTQ-PVQ k={k},{cb_bits}bit(G={G})"
|