--- title: "models.install" slug: "ai-models-install" updated: 2025-11-12T19:33:42Z published: 2025-11-12T19:33:42Z canonical: "docs.doc-know.com/ai-models-install" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.doc-know.com/llms.txt > Use this file to discover all available pages before exploring further. # models.install ### ai.models.install Initiates an asynchronous installation of a specified machine learning (ML) **model** from your app's [locker](http://docs.doc-know.com/v1/docs/app-locker). When installation completes, the model is stored inside the runtime's [cache](http://docs.doc-know.com/v1/docs/cache-intro) object using a provided **key**. The [Ux.ResourceReady](http://docs.doc-know.com/v1/docs/events) event is triggered so you can take action when your model becomes available. ### Input Parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | **token** | Text | Yes | Model's [locker](http://docs.doc-know.com/v1/docs/app-locker) token | | **key** | Text | Yes | Unique [cache](http://docs.doc-know.com/v1/docs/cache-intro) key where model will be stored | ### Returns No return value. ### Examples ``` // inside the Ux.Initialize script... // install model from app's locker using its token ai.models.install("TOKEN", "riskModel"); ``` ### Model Formats The following model formats are supported: | Name | Description | | --- | --- | | **javascript** | [JavaScript](https://www.bayesialab.com) model format | | **bayesialab** | [Bayesialab](https://www.bayesialab.com) model format | | **tf** * | [Tensor Flow](https://www.tensorflow.org/) model format | | **onnx** * | Open [ONNX AI](http://onnx.ai) CNN format | > Formats with an asterisk coming soon ### Remarks Use this function to install a previously trained machine learning (ML) model that you would like to use while your app is running. One common scenario is to install a model during initialization. Next, as a user interacts with your app in real time, gather their inputs (using the [Ux.Change](http://docs.doc-know.com/v1/docs/events) event) and run them through your model. Finally, display model results inside the attached insights panel or adjust your app's language output. Two-Step Process Installing models can be slow based on connection speeds and the size of the models being downloaded. As a result, downloading models requires a two-step process. First, you must initiate the installation from one script (typically [Ux.Initialize](http://docs.doc-know.com/v1/docs/events)). Second, you run the model (using [ai.models.run](http://docs.doc-know.com/v1/docs/ai-models-run)) after the installation completes from another script (typically [Ux.ResourceReady](http://docs.doc-know.com/v1/docs/events) or [Ux.Change](http://docs.doc-know.com/v1/docs/events)). By separating these steps, the user's experience remains fluid. Otherwise, the user interface would freeze until the installation completes, resulting in a poor user experience.