# Building the QNN Gen AI Transformer Model Library

Building an example model library is optional.

In the case of the GenAITransformer backend, the model is composed of a single node for the entire inference.

Genie provides pre-built `libQnnGenAiTransformerModel.so` and `QnnGenAiTransformerModel.dll` libraries. The source
for these libraries is provided by `${QNN_SDK_ROOT}/examples/Genie/Model/model.cpp`. This section shows the user how
to compile this source into a model library consumable by the Genie.

**Model build on Linux host**

Open a command shell on Linux host and run:

${QNN_SDK_ROOT}/bin/x86_64-linux-clang/qnn-model-lib-generator \
      -c ${QNN_SDK_ROOT}/examples/Genie/Model/model.cpp \
      -o ${QNN_SDK_ROOT}/examples/Genie/Model/model_libs # This can be any path
    Copy to clipboard

This will produce the following artifacts:

- `${QNN_SDK_ROOT}/examples/Genie/Model/model_libs/aarch64-android/libqnn_model.so`
- `${QNN_SDK_ROOT}/examples/Genie/Model/model_libs/x86_64-linux-clang/libqnn_model.so`

- By default libraries are built for all targets. To compile for a specific target, use the `-t <target>` option with
    - `qnn-model-lib-generator`. Choices of &lt;target&gt; are aarch64-android and x86\_64-linux-clang.

Last Published: Jun 04, 2026

[Previous Topic
genie-app](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/source_code_examples_genie-app.md) [Next Topic
Genie Dialog](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/dialog_dialog.md)