Skip to main content

logit_loom_llamacpp/
lib.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3#![doc = include_str!("../README.md")]
4#![forbid(unsafe_code)]
5
6mod activation;
7mod error;
8mod mechanics;
9mod model;
10mod sampler;
11mod session;
12mod speculation;
13mod steering;
14mod structured;
15
16pub use activation::{
17    ActivationCaptureOutput, ActivationConfiguration, ActivationProgramOutput,
18    LlamaCppTensorProfile,
19};
20pub use error::Error;
21pub use mechanics::{
22    OrdinaryTextMechanicsSnapshot, TextMechanicsCheckpoint, TextMechanicsExecutionOutput,
23    TextMechanicsOutput, TextMechanicsRequest, TextMechanicsResume, execute_text_mechanics,
24};
25pub use model::{
26    AuthorizedModelArtifact, DevicePolicy, MAX_TOKENIZATION_BYTES, Model, ModelOptions,
27    PreverifiedModelArtifact, Runtime, Tokenization,
28};
29pub use session::{GenerationOutput, PrefillOutput, Session, SessionOptions, StateSnapshot};
30pub use speculation::{
31    SpeculativeActivationOutput, SpeculativeActivations, SpeculativeCheckpointOutput,
32    SpeculativeCheckpointRequest, SpeculativeContinuationRequest, SpeculativeGenerationOutput,
33    SpeculativeRequest, SpeculativeSessionOptions, SpeculativeStateSnapshot, generate_speculative,
34    generate_speculative_checkpointed, resume_speculative, resume_speculative_checkpointed,
35    speculation_implementation_identity,
36};
37pub use steering::{
38    AuthorizedLoraArtifact, ControlVector, ControlVectorScope, LoraAdapter, LoraApplication,
39    LoraScope, SteeringScope,
40};
41pub use structured::{
42    ByteFeedback, ByteFeedbackCandidate, ByteFeedbackError, InstalledByteFeedback,
43    InstalledStructuredValidator, MAX_STRUCTURED_TOKENIZER_TABLE_BYTES,
44    MAX_STRUCTURED_VALIDATION_EVIDENCE_BYTES, StructuredAttemptOutput,
45    StructuredProjectionController, StructuredValidationContext, StructuredValidationOutcome,
46    StructuredValidator, StructuredValidatorError,
47};
48
49/// Exact native Rust binding version used by this adapter release.
50pub const LLAMA_CPP_BINDING_VERSION: &str = "llama-cpp-4:0.5.0+logit-loom-adr0002";
51/// Exact source revision of the reviewed native Rust binding successor.
52pub const LLAMA_CPP_BINDING_SOURCE_REVISION: &str = "f1c5dd05906a11aee5c2eaf1265851bf29752d67";
53/// Exact llama.cpp revision carried by the ADR 0002 binding successor.
54pub const LLAMA_CPP_REVISION: &str = "221f0f6356efe2260023208365705ec5d5a7c8f5";