Expand description
Per-model limits for media and requests, and the record a node keeps of them.
What a client needs to fit images, audio (or a video’s frames and soundtrack) to one model: the context the model runs with, images per request and what one costs, audio length and what it costs, and the largest request. Every field is absent when it isn’t known, never defaulted, so a client can say what is missing instead of guessing.
ModelLimits: the figures, withor(operator settings over measured ones),tightestand cost helpers. With theagentfeature they convert to and fromweirdnet_agent::MediaLimits, which catalog entries carry.from_projector: what a llama.cpp projector’s header (mmproj) says images and audio cost, for the projector types whose costs follow from the header alone.measure: read a model’s GGUF (and its projector) when it loads, with the context the node runs it at, into aLimitsRecord;ModelStore::record_limitskeeps it next to the model’s files andStoredModel::limitsreads it back.
Costs from headers follow llama.cpp’s mtmd (2026-11): a flag such as --image-max-tokens
changes them, so a node that passes one sets the result over the header’s with
ModelLimits::or.
Structs§
- Limits
Record - A model’s limits as a node found them when it loaded the model, kept next to its files
(
ModelStore::record_limits). Unknown fields are kept inextraand written back. - Model
Limits - Media and request limits for one model. See the module docs.
Enums§
- Limit
Source - How a
LimitsRecord’s figures were found.
Constants§
- LIMITS_
FILE - The limits record’s name inside a safetensors or MLX model directory.
- LIMITS_
FORMAT LimitsRecord::format.- LIMITS_
SUFFIX - The name a GGUF model’s limits record gets next to its first file:
<file>.limits.json. - WHISPER_
CHUNK_ SECONDS - Seconds of audio llama.cpp’s Whisper-style encoders take at a time (3000 mel frames at 16 kHz with a 160-sample hop); longer audio is cut into pieces this long, the last one padded.
Functions§
- from_
projector - What image and audio inputs cost, from a projector’s header, for the projector types whose
costs follow from the header alone (as llama.cpp’s
mtmdcomputes them, 2026-11): - measure
- Reads a GGUF model (the first file of a split model) and its projector, if any, as a node
loads them, into a record: what the projector’s header says images and audio cost
(
from_projector), the context the node runs the model at (context_tokens, per slot;Nonewhen the caller doesn’t know it, never the trained context) and the trained context for reference. A speech model’s projector also gives its speech profile (LimitsRecord::speech, seespeech::from_gguf). Fails whenmodelis not a GGUF model orprojectornot a projector.