Safety Engine Serialization#

bool trt_edgellm::safety::builder::saveSafetyEngineArtifacts(
std::filesystem::path const &enginePath,
std::string_view engine,
std::string_view companion,
SafetyMetadataWriter const &writeMetadata,
std::initializer_list<std::string_view> optionalMetadata
) noexcept#

Save a nonempty engine/companion pair with staged metadata. Stages writes before replacing existing files and rolls back publication failures. The output directory must not be modified concurrently or consumed during publication. Declared optional metadata filenames absent from staging are removed transactionally; other files are untouched.

bool trt_edgellm::safety::builder::buildAndSerializeSafetyEngine(
nvinfer1::IBuilder &builder,
nvinfer1::INetworkDefinition &network,
nvinfer1::IBuilderConfig &config,
std::filesystem::path const &enginePath,
SafetyMetadataWriter const &writeMetadata,
std::initializer_list<std::string_view> optionalMetadata = {}
) noexcept#

Build Safety artifacts with TensorRT 11.3 or later.