llama-cpp-sys-4 0.2.4

Low Level Bindings to llama.cpp
Documentation
Build #2995158 2026-03-10 20:07:21

# rustc version rustc 1.96.0-nightly (2d76d9bc7 2026-03-09)

# docs.rs version docsrs 0.0.0 (a68728e7 2026-03-08 )

# build log [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/llama-cpp-sys-4-0.2.4/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/llama-cpp-sys-4-0.2.4/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20260309-1.96.0-nightly-2d76d9bc7\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] [stdout] 6901972e74d1d48b09977d670311b998e356ce6dbce8553ebdd0d629407693db [INFO] running `Command { std: "docker" "start" "-a" "6901972e74d1d48b09977d670311b998e356ce6dbce8553ebdd0d629407693db", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Compiling llama-cpp-sys-4 v0.2.4 (/opt/rustwide/workdir) [INFO] [stderr] Documenting llama-cpp-sys-4 v0.2.4 (/opt/rustwide/workdir) [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5438:195 [INFO] [stderr] | [INFO] [stderr] 5438 | ...mplate. See more: https://github.com/ggml-org/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template\n @param tmpl A J... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] = note: `#[warn(rustdoc::bare_urls)]` on by default [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5438 | #[doc = " Apply chat template. Inspired by hf apply_chat_template() on python.\n\n NOTE: This function does not use a jinja parser. It only support a pre-defined list of template. See more: <https://github.com/ggml-org/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template>\n @param tmpl A Jinja template to use for this chat.\n @param chat Pointer to a list of multiple llama_chat_message\n @param n_msg Number of llama_chat_message in this chat\n @param add_ass Whether to end the prompt with the token(s) that indicate the start of an assistant message.\n @param buf A buffer to hold the output formatted prompt. The recommended alloc size is 2 * (total number of characters of all messages)\n @param length The size of the allocated buffer\n @return The total number of bytes of the formatted prompt. If is it larger than the size of buffer, you may need to re-alloc it and then re-apply the template."] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5604:116 [INFO] [stderr] | [INFO] [stderr] 5604 | ...The Curious Case of Neural Text Degeneration\" https://arxiv.org/abs/1904.09751\n Setting k <= 0 makes this a noop"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5604 | #[doc = " @details Top-K sampling described in academic paper \"The Curious Case of Neural Text Degeneration\" <https://arxiv.org/abs/1904.09751>\n Setting k <= 0 makes this a noop"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5608:118 [INFO] [stderr] | [INFO] [stderr] 5608 | ...The Curious Case of Neural Text Degeneration\" https://arxiv.org/abs/1904.09751"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5608 | #[doc = " @details Nucleus sampling described in academic paper \"The Curious Case of Neural Text Degeneration\" <https://arxiv.org/abs/1904.09751>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5612:59 [INFO] [stderr] | [INFO] [stderr] 5612 | #[doc = " @details Minimum P sampling as described in https://github.com/ggml-org/llama.cpp/pull/3841"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5612 | #[doc = " @details Minimum P sampling as described in <https://github.com/ggml-org/llama.cpp/pull/3841>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5616:87 [INFO] [stderr] | [INFO] [stderr] 5616 | #[doc = " @details Locally Typical Sampling implementation described in the paper https://arxiv.org/abs/2202.00666."] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5616 | #[doc = " @details Locally Typical Sampling implementation described in the paper <https://arxiv.org/abs/2202.00666.>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5624:99 [INFO] [stderr] | [INFO] [stderr] 5624 | #[doc = " @details Dynamic temperature implementation (a.k.a. entropy) described in the paper https://arxiv.org/abs/2309.02772."] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5624 | #[doc = " @details Dynamic temperature implementation (a.k.a. entropy) described in the paper <https://arxiv.org/abs/2309.02772.>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5628:52 [INFO] [stderr] | [INFO] [stderr] 5628 | #[doc = " @details XTC sampler as described in https://github.com/oobabooga/text-generation-webui/pull/6335"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5628 | #[doc = " @details XTC sampler as described in <https://github.com/oobabooga/text-generation-webui/pull/6335>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5633:116 [INFO] [stderr] | [INFO] [stderr] 5633 | ... paper \"Top-nσ: Not All Logits Are You Need\" https://arxiv.org/pdf/2411.07641"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5633 | #[doc = " @details Top n sigma sampling as described in academic paper \"Top-nσ: Not All Logits Are You Need\" <https://arxiv.org/pdf/2411.07641>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5637:70 [INFO] [stderr] | [INFO] [stderr] 5637 | #[doc = " @details Mirostat 1.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of word... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5637 | #[doc = " @details Mirostat 1.0 algorithm described in the paper <https://arxiv.org/abs/2007.14966.> Uses tokens instead of words.\n @param candidates A vector of `llama_token_data` containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.\n @param tau The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.\n @param eta The learning rate used to update `mu` based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause `mu` to be updated more quickly, while a smaller learning rate will result in slower updates.\n @param m The number of tokens considered in the estimation of `s_hat`. This is an arbitrary value that is used to calculate `s_hat`, which in turn helps to calculate the value of `k`. In the paper, they use `m = 100`, but you can experiment with different values to see how it affects the performance of the algorithm.\n @param mu Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (`2 * tau`) and is updated in the algorithm based on the error between the target and observed surprisal."] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5647:70 [INFO] [stderr] | [INFO] [stderr] 5647 | #[doc = " @details Mirostat 2.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of word... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5647 | #[doc = " @details Mirostat 2.0 algorithm described in the paper <https://arxiv.org/abs/2007.14966.> Uses tokens instead of words.\n @param candidates A vector of `llama_token_data` containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.\n @param tau The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.\n @param eta The learning rate used to update `mu` based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause `mu` to be updated more quickly, while a smaller learning rate will result in slower updates.\n @param mu Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (`2 * tau`) and is updated in the algorithm based on the error between the target and observed surprisal."] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5670:60 [INFO] [stderr] | [INFO] [stderr] 5670 | #[doc = " @details Lazy grammar sampler, introduced in https://github.com/ggml-org/llama.cpp/pull/9639\n @param trigger_patter... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5670 | #[doc = " @details Lazy grammar sampler, introduced in <https://github.com/ggml-org/llama.cpp/pull/9639>\n @param trigger_patterns A list of patterns that will trigger the grammar sampler. Pattern will be matched from the start of the generation output, and grammar sampler will be fed content starting from its first match group.\n @param trigger_tokens A list of tokens that will trigger the grammar sampler. Grammar sampler will be fed content starting from the trigger token included."] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5691:74 [INFO] [stderr] | [INFO] [stderr] 5691 | ...igned by p-e-w, as described in: https://github.com/oobabooga/text-generation-webui/pull/5677, porting Koboldcpp implementation... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5691 | #[doc = " @details DRY sampler, designed by p-e-w, as described in: <https://github.com/oobabooga/text-generation-webui/pull/5677>, porting Koboldcpp implementation authored by pi6am: https://github.com/LostRuins/koboldcpp/pull/982"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5691:188 [INFO] [stderr] | [INFO] [stderr] 5691 | ...ldcpp implementation authored by pi6am: https://github.com/LostRuins/koboldcpp/pull/982"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5691 | #[doc = " @details DRY sampler, designed by p-e-w, as described in: https://github.com/oobabooga/text-generation-webui/pull/5677, porting Koboldcpp implementation authored by pi6am: <https://github.com/LostRuins/koboldcpp/pull/982>"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: this URL is not a hyperlink [INFO] [stderr] --> /opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/llama-cpp-sys-4-ef8d86d89dea6e0d/out/bindings.rs:5704:1054 [INFO] [stderr] | [INFO] [stderr] 5704 | ....99)\n @param seed RNG seed\n\n ref: https://github.com/ggml-org/llama.cpp/pull/17927\n"] [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: bare URLs are not automatically turned into clickable links [INFO] [stderr] help: use an automatic link instead [INFO] [stderr] | [INFO] [stderr] 5704 | #[doc = " adaptive-p: select tokens near a configurable target probability over time.\n\n the adaptive-p sampler transforms the token probability distribution to favor tokens\n that fall near a user-configurable probability target.\n\n internally, the sampler maintains an exponential moving average of the *ORIGINAL*\n probabilities of selected tokens at each sampling step. it uses this EMA to compute an\n adapted target probability at each sampling step, thus maintaining the desired target\n probability over time.\n\n adaptive-p selects a token ID rather than just mutating candidates, so it must be last\n in the sampler chain (like mirostat, dist, greedy).\n\n only mild truncation before this sampler is recommended. we suggest applying min-p\n before adaptive-p as the only other active sampler in the chain.\n\n @param target select tokens near this probability (valid range 0.0 to 1.0; negative = disabled)\n @param decay EMA decay for adaptation; history ≈ 1/(1-decay) tokens (valid range 0.0 - 0.99)\n @param seed RNG seed\n\n ref: <https://github.com/ggml-org/llama.cpp/pull/17927>\n"] [INFO] [stderr] | + + [INFO] [stderr] [INFO] [stderr] warning: `llama-cpp-sys-4` (lib doc) generated 14 warnings (run `cargo fix --lib -p llama-cpp-sys-4` to apply 14 suggestions) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.80s [INFO] [stderr] Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/llama_cpp_sys_4/index.html [INFO] running `Command { std: "docker" "inspect" "6901972e74d1d48b09977d670311b998e356ce6dbce8553ebdd0d629407693db", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6901972e74d1d48b09977d670311b998e356ce6dbce8553ebdd0d629407693db", kill_on_drop: false }` [INFO] [stdout] 6901972e74d1d48b09977d670311b998e356ce6dbce8553ebdd0d629407693db