HF and GGUF Promptable Apps¶
The SDK has two backends for promptable apps:
ClamsHFPromptableApp runs a Hugging Face
transformers model in the app process, and
ClamsGGUFPromptableApp (experimental) runs a GGUF
model in a llama-server process that the app starts and owns. Both
share the promptable runtime parameters, the model parameter
derived from analyzer_versions, and the output format. This page
lists where they differ. For how to declare each, see
HuggingFace Promptable Apps and GGUF Promptable Apps (experimental).
The primary target is NVIDIA GPUs with CUDA: the container images ship the latest release of each backend, built with CUDA support.
HF ( |
GGUF ( |
|
|---|---|---|
Inference engine |
|
|
Python extra |
|
|
Container image |
|
|
Model id in |
|
|
Model files |
the repository snapshot, loaded with |
one GGUF file (or its shards) and, for vision input, one
|
Hardware |
NVIDIA GPUs that the latest |
NVIDIA GPUs that llama.cpp’s CUDA build supports, including older ones: tested on Maxwell. Falls back to CPU. |
Model placement |
one device (the first GPU, or CPU), unless |
the server places what fits on the visible GPUs and keeps the rest in system memory |
Hardware settings |
class attributes ( |
|
Prompts run together |
|
the server’s slot count, fixed when the server starts (one
recommended); no |
Memory for one request |
grows with |
fixed when the server starts; how the slots share the context depends on the llama.cpp release |
Prompt too large |
out-of-memory error |
context-size error (an error view naming the context size) |
Production mode |
workers by CPU count and |
one worker, never replaced
( |
|
GPU name, total, available and peak memory |
GPU name and total memory only |
Audio input |
supported, if the model takes audio |
not supported |
Status |
stable |
experimental |
Two differences matter most when moving an app from one backend to the other.
Who sets the batch size¶
An HF app takes parallelPrompts with each request and stacks that
many prompts into one forward pass. A GGUF app sends as many prompts
at a time as llama-server has slots, and the server decodes them
together. The slot count is a server setting, fixed when the server
starts; see GGUF Promptable Apps (experimental) for the recommended value. An app
moved to the GGUF backend must stop reading
parameters['parallelPrompts'] and stop passing parallel_prompts to
generate_batched().
Outputs differ between backends¶
A GGUF file is a converted, usually quantized, copy of the original model, and llama.cpp computes with different kernels. The same model gives different outputs on the two backends, even at temperature 0. With more than one slot, GGUF outputs can also shift slightly with the other prompts decoded at the same time. Compare outputs before you replace an HF app with a GGUF one.