1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Safe model inference API for the stable vllm.cpp C boundary.
//!
//! # Entry points
//!
//! Resolve a Hub model with [`HuggingFaceModel`] (default `main`, or an explicit
//! revision), then create an [`Engine`] with [`Engine::load`] or configure native
//! model settings through [`EngineBuilder`]. [`SamplingParams`] owns sampling,
//! stop-string, [`StructuredOutput`] settings, and an optional host-side logits
//! processor for completion calls. The engine provides
//! blocking completion, streaming, raw-JSON chat, and [`Engine::submit`] for a
//! concurrent [`Request`]. Enable `serde` for `serde_json::Value` chat helpers.
//!
//! # Ownership and callbacks
//!
//! [`Engine`] is a cloneable RAII owner; clones share one reference-counted
//! native engine. Rust copies completion, stream, chat, and error text before
//! native storage is freed or reused. Blocking callbacks may borrow caller data.
//! Their panics are caught before the C boundary and resumed after the native
//! call returns. Custom logits processors are `Send + Sync`, may run concurrently
//! on native worker threads, and report contained panic through
//! [`Error::LogitsProcessorPanicked`].
//!
//! A [`Request`] retains its engine and asynchronous callback until native
//! free/join completes. Requests are `Send` but intentionally not `Sync`, while
//! engines are `Send + Sync`. Asynchronous callbacks run on a native delivery
//! thread, must be `Send + 'static`, and surface panic through
//! [`Error::CallbackPanicked`]. ABI version 10 forbids waiting for or freeing a
//! request from its callback thread; callback-thread drop delegates ownership to
//! a cleanup reaper instead.
//!
//! # ABI, linking, and deployment
//!
//! Engine loading requires the linked native library's ABI to equal
//! [`expected_abi_version`] before versioned structs cross FFI. [`version`] copies
//! the linked library's diagnostic version string. The default
//! `bundled` feature builds the pinned native source. `system` selects a
//! caller-provided installation, `dynamic-link` selects shared linking, and
//! `serde` adds typed JSON helpers. The non-optional `hf-hub` dependency provides
//! synchronous, cache-aware model retrieval without an async runtime. CUDA,
//! CUTLASS, Triton AOT, Vulkan, Metal, and external MLX features are experimental
//! bundled build configuration.
//!
//! Dynamic linking does not deploy `libvllm.so` or `libvllm.dylib`; applications
//! must make it and its runtime dependencies visible through the platform loader,
//! such as `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, or an application-owned rpath.
//! The supported runtime tier is native Linux x86_64 CPU.
//! Accelerator features are build/configuration surfaces with known runtime
//! blockers, not complete accelerator runtime support.
pub use ;
pub use ;
pub use ;
pub use HuggingFaceModel;
pub use ;
pub use ;
/// Returns the compile-time C ABI expected by this crate.
pub const
/// Returns the C ABI reported by the linked vllm.cpp library.
///
/// Engine loading compares this value for exact equality before passing any
/// versioned native struct.
/// Copies the version string reported by the linked vllm.cpp library.
///
/// This diagnostic does not replace [`abi_version`]: callers must still use the
/// numeric ABI for compatibility decisions.