# Fast API

### Code

All your code will be in the Zerve notebook. It will have all variables/objects you want to refer in your deployment.

### FastAPI code

In deployment you will see a generic example script that you can modify as per your requirment. To call a variable from the notebook you can use the following code

```
from zerve import variable
name = variable ("block_name", "variable_name")
```

### Packages

There is a default FastAPI environment set in Zerve that can be used here, but if you need additional packages for deployment, you can clone the FastAPI environment and add required packages to it and build.&#x20;

### Instance Type

You can select any instance type as per your requirement

### Preview

You can see a preview in Zerve before you deploy. This can be used to fix bugs and deploy a clean code.

### Logs

There are also logs available to help you debug better.

### Example flow

Following video shows how to deploy a churn model using Fast API in Zerve.\
In this example we need scikit-learn package, so we will see all steps from creating a new environment until deployment.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FrAXi3xwaHPYubqYYgqLw%2FFastAPI_Deployment.mp4?alt=media&token=2b1916b6-4419-4b2f-862f-b8c32cb9d76e>" %}


---

# 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://docs.zerve.ai/guide/notebook-view/deployment/fast-api.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.
