# Prepare a GenAI model using a Jupyter notebook Use a Qualcomm-provided Jupyter notebook to prepare, optimize, and deploy large language models (LLMs) on Qualcomm platforms in an interactive and step-by-step environment. The Jupyter notebooks offer full transparency and customization during model preparation and execution. The following image shows the three stages and notebooks typically covered by the Jupyter notebooks: model preparation, model conversion, and model execution.  The following table summarizes the Jupyter notebook workflow for GenAI models. This workflow is applicable for multiple categories of GenAI models, including LLM and vision models. Note For more Jupyter notebook examples, go to [Qualcomm Package Manager](https://qpm.qualcomm.com/#/main/home), select **Tools**, and search for **Generative AI Tutorials**.  | Step | Objective | Details | Artifacts generated | | --- | --- | --- | --- | | Notebook 1 | Adapt and optimize the Hugging Face PyTorch model for Qualcomm hardware. |
Load base model from HuggingFace.
Apply AIMET Transformation for – Graph Optimizations, Computing encodings using techniques like Sequential MSE, and AdaRound.
Export optimized model to ONNX format along with AIMET encodings. AI Hub path simplifies the workflow by hosting pre-computed encodings from this step on cloud platforms.
Onnx models
AIMET encodings
Profiling reports
Use Qualcomm AI Runtime SDK tools to generate serialized binaries from Onnx models generated in Notebook 1.
Create context binaries for prompt and token generation.
Validate model conversion with profiling metrics.
Transfer binaries and configuration files to the target device.
Use Genie-CLI or QAIRT runtime APIs for inference.
Validate performance (latency, throughput), and accuracy.