# Serving an ML Model

You can deploy a trained ML model to handle prediction requests.

To serve an ML model, follow these steps:

1. Log in to the Aizen Jupyter console. See [Using the Aizen Jupyter Console](/docs/getting-started/using-the-aizen-jupyter-console.md).
2. Set the current working project.

   <pre data-overflow="wrap"><code>set project &#x3C;project name>
   </code></pre>
3. Register the trained ML model that you want to deploy:

   <pre data-overflow="wrap"><code>list trained-models &#x3C;ML model name>
   register model &#x3C;ML model name>,&#x3C;run id>,PRODUCTION
   list registered-models
   </code></pre>

   See [Training Commands](/docs/model-building-commands/training-commands.md).
4. Configure a prediction deployment using the `configure prediction` command.

   <pre data-overflow="wrap"><code>configure prediction
   </code></pre>
5. In the notebook, you will be guided through a template form with boxes and drop-down lists that you can complete to configure the deployment. You must specify the prediction deployment name and select the ML model name and registered version.
6. Serve the model using the `start prediction` command. This command will schedule a job to deploy the model. Optionally, you may configure resources for the job by running the `configure resource` command. If you do not configure resources, default resource settings will be applied.

   <pre data-overflow="wrap"><code>configure resource
   start prediction &#x3C;prediction deployment name>
   </code></pre>
7. Check the status of the prediction deployment job and obtain the prediction URL:

   <pre data-overflow="wrap"><code>status prediction &#x3C;prediction deployment name>
   </code></pre>
8. Your application may send prediction REST requests to the URL displayed in the status output. Additionally, you may use the `test prediction` command to auto-send a few prediction REST requests to your ML model being served.

   <pre data-overflow="wrap"><code>test prediction &#x3C;prediction deployment name>
   </code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aizen-corp.gitbook.io/docs/managing-ml-workflows/serving-an-ml-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
