Drive an installed LaRuche App through its declared actions, never its files.
日本語の概要は準備中です。原文の説明を表示しています。
Run a GGUF model locally with llama.cpp, and find one on the HF Hub.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Run a model on this machine: no account, no per-token cost, nothing leaving the disk. llama.cpp does the running; GGUF is the single-file format it reads; the quantisation level is the dial that trades quality for memory.
Two jobs live here. Finding the right file on the Hub, which is mostly a research task, and running it, which is mostly an arithmetic one about how much memory the user has.
The Hub's web pages are the map, but the tree API is the territory. A model card can list quants that were renamed, split or never uploaded. Confirm against the API before handing anyone a command.
Find candidate repositories, with web_fetch:
https://huggingface.co/models?apps=llama.cpp&sort=trending
https://huggingface.co/models?search=<term>&apps=llama.cpp&sort=trending
https://huggingface.co/models?search=<term>&apps=llama.cpp&num_parameters=min:0,max:24B&sort=trending
apps=llama.cpp is the filter that matters: it excludes everything with no GGUF.
Open the repository's local-app view, which carries the maintainer's own command:
https://huggingface.co/<repo>?local-app=llama.cpp
If the snippet is readable, take the command and the recommended quant verbatim. The
Hardware compatibility block is better than any general table here, because it was
written against these specific files.
Confirm against the tree API, which lists what actually exists:
https://huggingface.co/api/models/<repo>/tree/main?recursive=true
It returns a JSON array; keep entries whose type is file and whose path ends in
.gguf. path and size are the truth for filenames and bytes.
Three kinds of file show up together and must not be confused:
mmproj-*.gguf, the vision projector for a multimodal model, which is loaded
ALONGSIDE the main file and is useless alone;BF16/ or *-00001-of-0000N.gguf, an unquantised model split across
files.Build the command. Shorthand when the quant tag is standard, exact file when the repository names things its own way:
llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q4_K_M
llama-server --hf-repo <repo> --hf-file <exact-name-from-the-tree-api.gguf> -c 4096
Suggest converting from Transformers weights only when the repository publishes no
GGUF at all. It is a long job and someone has usually already done it: search for
<model name> GGUF first.
Report the label exactly as the repository writes it. UD-Q4_K_M and IQ4_NL_XL are
real, specific names. Normalising one to Q4_K_M produces a command that downloads
nothing.
brew install llama.cpp # macOS, Linux
winget install llama.cpp # Windows
From source, when you need a specific backend compiled in:
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Release
Verify with llama-cli --version before anything else. A missing binary and a failed
model load produce different errors, and confusing them costs an hour.
Before recommending a quant, work out what fits. Roughly:
-c. A large context window on a small
machine is what turns a working setup into an out-of-memory crash halfway through a
conversation.Then pick:
| Situation | Quant |
|---|---|
| General chat, the default worth starting from | Q4_K_M |
| Code or anything technical, if memory allows | Q5_K_M, Q6_K |
| It must fit, quality second | Q3_K_M, or an IQ variant |
| Memory is not a constraint | Q8_0 |
IQ quants are smaller at equal quality but need more compute to unpack, so on a slow CPU
they can be the wrong trade. Below Q3 the model degrades in ways that look like
stupidity rather than compression.
If the local-app view named a quant for the user's hardware, prefer it over this table.
llama-server -hf <repo>:<QUANT> -c 4096 --port 8080
It exposes an OpenAI-compatible API, which is what lets existing clients talk to it unchanged:
curl -s http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"say hello"}]}'
A JSON reply with a choices array means the model is loaded and serving. Anything else,
read stderr: llama-server reports the load there, including the layer count it offloaded
and the memory it took.
pip install llama-cpp-python
CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --force-reinstall --no-cache-dir
CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python --force-reinstall --no-cache-dir
The plain install is CPU-only. GPU support is compiled in, so switching backends means
reinstalling with --force-reinstall --no-cache-dir: without those flags pip serves the
cached CPU wheel and the GPU is silently never used.
from llama_cpp import Llama
llm = Llama(model_path="C:/models/model-q4_k_m.gguf",
n_ctx=4096, n_gpu_layers=35, n_threads=8)
reply = llm.create_chat_completion(
messages=[{"role": "user", "content": "what is a GGUF file"}],
max_tokens=256,
)
print(reply["choices"][0]["message"]["content"])
for chunk in llm("explain quantisation:", max_tokens=256, stream=True):
print(chunk["choices"][0]["text"], end="", flush=True)
hub = Llama.from_pretrained(repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF",
filename="*Q4_K_M.gguf", n_gpu_layers=35)
n_gpu_layers is how many transformer layers move to the GPU. 0 is CPU-only, -1 is
all of them, and a number too high for the available VRAM fails at load rather than
falling back.
Repo: <repo>
Recommended: <label exactly as published> (<size>)
Command: llama-server -hf <repo>:<label> -c 4096
Also available:
<filename> <size>
mmproj-<...>.gguf <size> (vision projector, load with the main model)
Sources:
https://huggingface.co/<repo>?local-app=llama.cpp
https://huggingface.co/api/models/<repo>/tree/main?recursive=true
Give the sizes. "Q4_K_M is recommended" is not actionable; "Q4_K_M, 2.0 GB" is.
mmproj-*.gguf treated as the model. It is the vision half and produces nothing
alone.--no-cache-dir. pip serves the cached
CPU build and the GPU flags are silently ignored.-c to the model's maximum by reflex. Context is memory. A 128k window on a
laptop is an out-of-memory error waiting for a long conversation.llama-server: command not found. Not installed, or not on PATH after a source build:
the binaries land in build/bin/.
The model loads, then the process dies. Out of memory. Lower -c first, since it is
free to change, then drop to a smaller quant.
Generation is far slower than expected, and the GPU is idle. n_gpu_layers is 0, or
the wheel is the CPU build. Read llama-server's stderr: it prints how many layers were
offloaded.
ValueError: Model file not found. The path or the filename glob matches nothing.
Check it against the tree API output rather than guessing at the pattern.
The download stops partway, repeatedly. Large files over an unstable connection. Fetch
it with curl -C - to resume, and point --hf-file at the local path instead.
Output is fluent but wrong in a way a smaller model would not be. The quant is too aggressive for the task. Move up one level before concluding the model is unsuitable.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Drive an installed LaRuche App through its declared actions, never its files.
日本語の概要は準備中です。原文の説明を表示しています。
Find academic papers on arXiv, with citation counts and BibTeX.
日本語の概要は準備中です。原文の説明を表示しています。
Render text or an image as ASCII art for terminal-friendly output.
日本語の概要は準備中です。原文の説明を表示しています。
Track RSS/Atom feeds and blogs via blogwatcher-cli.
日本語の概要は準備中です。原文の説明を表示しています。
Drive a real web browser: navigate, read, find, click, fill, screenshot
日本語の概要は準備中です。原文の説明を表示しています。
Measure a codebase: lines of code, language mix, and symbol lookups.
日本語の概要は準備中です。原文の説明を表示しています。