Skip to main content

llama_cpp_bindings/
lib.rs

1#![cfg_attr(
2    not(test),
3    deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
4)]
5
6pub mod batch_add_error;
7pub mod chat_message_parse_outcome;
8pub mod context;
9pub mod error;
10pub mod eval_multimodal_chunks_params;
11pub mod extract_reasoning_markers_from_probe_renders;
12pub mod extract_tool_call_markers_from_haystack;
13pub mod ffi_error_reader;
14pub mod ffi_status_is_ok;
15pub mod ffi_status_to_i32;
16pub mod ggml_time_us;
17pub mod gguf_context;
18pub mod gguf_context_error;
19pub mod gguf_type;
20pub mod grammar_matcher;
21pub mod ingest_outcome;
22pub mod ingest_prompt_chunk;
23pub mod invalid_numa_strategy;
24pub mod json_schema_to_grammar;
25pub mod llama_backend;
26pub mod llama_backend_device;
27pub mod llama_backend_device_type;
28pub mod llama_backend_numa_strategy;
29pub mod llama_batch;
30pub mod llama_time_us;
31pub mod llama_token_attr;
32pub mod llama_token_attrs;
33pub mod llama_token_attrs_from_int_error;
34pub mod llguidance_sampler;
35#[cfg(feature = "dynamic-backends")]
36pub mod load_backends;
37#[cfg(feature = "dynamic-backends")]
38pub mod load_backends_error;
39#[cfg(feature = "dynamic-backends")]
40pub mod load_backends_from_path;
41pub mod log_options;
42pub mod marker_kind;
43pub mod mask_outcome;
44pub mod max_devices;
45pub mod mlock_supported;
46pub mod mmap_supported;
47pub mod model;
48pub mod mtmd;
49pub mod raw_chat_message;
50pub mod resolved_tool_call_markers;
51pub mod sampled_token;
52pub mod sampled_token_classifier;
53pub mod sampled_token_section;
54pub mod sampling;
55pub mod send_logs_to_log;
56pub mod streaming_json_probe;
57pub mod streaming_markers;
58pub mod timing;
59pub mod token;
60pub mod tool_call_format;
61pub mod tool_call_marker_pair;
62pub mod tool_call_template_overrides;
63
64pub use error::{
65    ApplyChatTemplateError, ChatTemplateError, DecodeError, EmbeddingsError, EncodeError,
66    EvalMultimodalChunksError, GrammarError, JsonSchemaToGrammarError, KvCacheSeqAddError,
67    KvCacheSeqDivError, LlamaContextLoadError, LlamaCppError, LlamaLoraAdapterInitError,
68    LlamaLoraAdapterRemoveError, LlamaLoraAdapterSetError, LlamaModelLoadError, LogitsError,
69    MarkerDetectionError, MetaValError, ModelParamsError, NewLlamaChatMessageError,
70    ParseChatMessageError, Result, SampleError, SamplerAcceptError, SamplingError,
71    StringToTokenError, TokenSamplingError, TokenToStringError,
72};
73
74pub use chat_message_parse_outcome::ChatMessageParseOutcome;
75pub use eval_multimodal_chunks_params::EvalMultimodalChunksParams;
76pub use llama_backend_device::{LlamaBackendDevice, list_llama_ggml_backend_devices};
77pub use llama_backend_device_type::LlamaBackendDeviceType;
78pub use llama_cpp_bindings_types::{
79    BracketedJsonShape, KeyValueXmlTagsShape, PairedQuoteShape, ParsedChatMessage, ParsedToolCall,
80    ReasoningMarkers, TokenUsage, TokenUsageError, ToolCallArgsShape, ToolCallArguments,
81    ToolCallMarkers, ToolCallValueQuote, XmlTagsShape,
82};
83pub use raw_chat_message::RawChatMessage;
84pub use sampled_token::SampledToken;
85pub use sampled_token_classifier::SampledTokenClassifier;
86pub use sampled_token_section::SampledTokenSection;
87
88pub use ffi_status_is_ok::status_is_ok;
89pub use ffi_status_to_i32::status_to_i32;
90pub use ggml_time_us::ggml_time_us;
91pub use ingest_prompt_chunk::ingest_prompt_chunk;
92pub use json_schema_to_grammar::json_schema_to_grammar;
93pub use llama_time_us::llama_time_us;
94pub use max_devices::max_devices;
95pub use mlock_supported::mlock_supported;
96pub use mmap_supported::mmap_supported;
97
98pub use log_options::LogOptions;
99pub use send_logs_to_log::send_logs_to_log;