Action Builder#

class ActionBuilder#

Builder class for action expert TensorRT engines. Handles the complete process of building TensorRT engines from ONNX models for action experts used in multimodal models (e.g., Alpamayo 1).

Public Functions

ActionBuilder(
std::filesystem::path const &onnxDir,
std::filesystem::path const &engineDir,
ActionBuilderConfig const &config
)#

Constructor for ActionBuilder.

Parameters:
  • onnxDir – Directory containing the ONNX model and configuration files

  • engineDir – Directory where the built engine and related files will be saved

  • config – Configuration object specifying build parameters

~ActionBuilder() noexcept = default#

Destructor.

bool build()#

Build the TensorRT engine from the action expert ONNX. This method performs the complete build process including:

  • Loading and parsing the ONNX model

  • Setting up optimization profiles

  • Building the TensorRT engine

  • Copying necessary files to the engine directory

Returns:

true if build was successful, false otherwise

struct ActionBuilderConfig#

Configuration structure for action expert model building. Contains parameters needed to build the TensorRT engine from the action expert ONNX (e.g. Alpamayo 1 flow-matching decoder).

Public Functions

inline Json toJson() const#

Convert configuration to JSON format for serialization.

Returns:

JSON object containing all configuration parameters

inline std::string toString() const#

Convert configuration to human-readable string format.

Returns:

String representation of the configuration for debugging/logging

Public Members

int32_t maxBatchSize = {4}#

Maximum batch size for dynamic batch dimensions.

int32_t maxKVCacheCapacity = {0}#

Maximum KV cache capacity (must match the LLM engine’s maxKVCacheCapacity).

Public Static Functions

static inline ActionBuilderConfig fromJson(Json const &json)#

Create configuration from JSON format.

Parameters:

json – JSON object containing configuration parameters

Returns:

ActionBuilderConfig object with parsed parameters