vllm_cpp_sys/lib.rs
1//! Raw FFI declarations for the stable vllm.cpp C API.
2//!
3//! The checked-in bindings are generated from `vllm.cpp/include/vllm.h` and
4//! expose that header's 19-symbol C boundary, versioned structs, constants, and
5//! callback signatures. They target ABI version 10 from pinned vllm.cpp commit
6//! `34aedfbe8ed9779697905541a62e2160ccfd9c05`. This exported ABI is narrower than
7//! the broader native C++ implementation and does not expose undocumented
8//! vllm.cpp internals.
9//!
10//! # Safety
11//!
12//! The declarations are intentionally raw. Callers must uphold every pointer,
13//! lifetime, aliasing, thread, callback, and NUL-termination contract from the C
14//! header. They must check returned status values, copy thread-local error text
15//! before another API call on that thread, and release engines, requests,
16//! completions, and allocated strings with their matching `vllm_*_free`
17//! functions. In particular, ABI version 10 prohibits waiting for or freeing a
18//! request from that request's callback thread. Prefer the safe `vllm-cpp` crate
19//! unless direct ABI access is required.
20//!
21//! # Build and link modes
22//!
23//! The default `bundled` feature compiles and statically links the packaged
24//! pinned source. `system` links a caller-provided compatible installation, and
25//! `dynamic-link` selects the platform `libvllm` shared library in either source
26//! mode. Dynamic consumers must deploy that library and its dependencies through
27//! the platform loader. CUDA, external CUTLASS, Triton AOT, Vulkan, Metal, and
28//! external MLX features are experimental bundled build configuration and require
29//! their documented targets and native inputs.
30//!
31//! Native Linux x86_64 CPU is the supported runtime tier. Building the bundled
32//! source requires CMake 3.24 or newer, a build tool, C11 and C++20 compilers,
33//! and a linker/C++ standard library. Documentation builds skip native
34//! compilation; that does not validate a runtime library or accelerator.
35
36#![allow(non_camel_case_types, non_upper_case_globals)]
37
38include!("bindings.rs");