Repository navigation
v3.1.0: native video input and fast_forward
Native video input
A video now reaches the model as a video. MediaInput::Kind::Video carries the sampled frames of one clip with their timestamps, and MtmdSource lays them out exactly as llama.cpp's own video helper does: frames marked mergeable, timestamp text only where the interval asks for it, so video-capable projectors such as Qwen-VL fuse adjacent frames in pairs. The tokens match the server's video path chunk for chunk, and a committed reference tokenization pins that parity in the integration suite. Frames of one clip share one size and increasing timestamps; optional notes join the timestamp text without disturbing fusion. Containers are refused: the caller decodes the clip, and the engine never needs ffmpeg at runtime. MTMD_VIDEO stays off.
What this buys: on Qwen3.5-4B the same sixteen frames cost 775 tokens as a video against 1,338 as separate images, and the model sees motion, because the projector was built to read frames this way.
fast_forward
fast_forward(parent, child) makes a child's state its parent's. The parent keeps its handle, its place in the tree and its steer callback; everything that follows the child's tokens moves, sampler and grammar included; no KV cells move and cells_used is unchanged. With fork and prune it gives every branch a checkpoint it can keep or discard while siblings and descendants run on. It is refused, with nothing changed, unless the child was forked from this parent, the parent has neither decoded nor changed since, and the child has no children and is not poisoned.
Two facts ship with it. BranchState::revision counts every change to the state a fast-forward would move, and fork_revision records the parent's at fork time. BranchState::poisoned marks a branch whose failed decode left its KV ahead of its books; in a decode_scatter across branches, partial describes the operation and poisoned names the branches that were hurt. Prune and replay.
Also
branch::reseed_sampler(handle, seed)reseeds a stochastic chain and records the seed it sets, soset_sampler_paramscompares against the chain as it is.merge_logitschecks every expert before writing; a refused merge changes nothing.- CI runs the branch, fork-fidelity and decode-failure cases under AddressSanitizer on SmolLM2 and on Qwen3.5-4B with its projector.
tests/fixtures/video: a generated clip, its frames, and the helper's own tokenization as the reference.
Engine: llama.cpp b11559. Ships with lloyal-ai 1.19.0, alongside lloyal.node 4.1.0 and hdk v6.1.0-rig.
What's Changed
- feat(mtmd): native video input by @lloyal-research in #50
Full Changelog: v3.0.0...v3.1.0