> For the complete documentation index, see [llms.txt](https://docs.zerve.ai/zerve-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerve.ai/zerve-docs/compute/compute-types.md).

# Compute types

The kinds of compute a block can run on, and when to use each.

Each block runs on a **compute type** you choose in the block's compute settings. Choosing the right one for each block makes it run reliably and cost less.

## Choosing a compute type

| Compute type              | Best for                                               | Maximum memory             | Maximum run time |
| ------------------------- | ------------------------------------------------------ | -------------------------- | ---------------- |
| **Lambda** (AWS Lambda)   | Most blocks: queries, light data processing, API calls | 10 GB                      | 15 minutes       |
| **Fargate** (AWS Fargate) | Long-running work, large datasets, heavier processing  | 120 GB, with up to 16 CPUs | 12 hours         |
| **GPU** (AWS SageMaker)   | Model training, deep learning, other GPU work          | Depends on the instance    | 12 hours         |

Each environment has a **default** compute type, used when a block doesn't specify one. A block can also inherit its project's compute settings.

{% hint style="warning" %}
**Lambda blocks stop after 15 minutes.** If a block times out or runs out of memory on Lambda, switch it to Fargate. This is the most common reason a block run fails.
{% endhint %}

## Lambda

Lambda starts quickly and suits most blocks.

| Limit               | Value      |
| ------------------- | ---------- |
| **Memory**          | 10 GB      |
| **Run time**        | 15 minutes |
| **Scratch storage** | 10 GB      |

Lambda can also run with a **fixed outbound IP address**, which you need if your database only accepts connections from approved IP addresses.

## Fargate

Fargate suits work that runs longer or needs more resources. Choose an instance size:

| Size         | CPU | Memory |
| ------------ | --- | ------ |
| **Small**    | 1   | 8 GB   |
| **Medium**   | 2   | 16 GB  |
| **Large**    | 4   | 30 GB  |
| **X-Large**  | 8   | 60 GB  |
| **XX-Large** | 16  | 120 GB |

| Setting             | Value                       |
| ------------------- | --------------------------- |
| **Scratch storage** | 20 to 200 GB, default 20 GB |
| **Run time**        | Up to 12 hours              |

If a Fargate block runs out of memory, choose a larger size in the block's compute settings.

## GPU

GPU runs a block on an AWS SageMaker GPU instance. See [GPUs](/zerve-docs/compute/gpus.md) for the instance types and settings, including what happens when GPUs are in short supply.

## Compute for self-hosted Zerve

When your organization runs Zerve in its own cloud or on its own infrastructure, more compute types can be available:

| Compute type   | Where it runs                                      |
| -------------- | -------------------------------------------------- |
| **Kubernetes** | Your own Kubernetes cluster                        |
| **Armada**     | Batch scheduling on your Kubernetes clusters       |
| **Cloud Run**  | Google Cloud Run Jobs in your Google Cloud account |

CPU, memory and scratch storage (up to 200 GB) are set per block, within the limits your administrators configure. See [Deployment options](/zerve-docs/self-hosting/self-hosting.md).

## Compute for deployments

Deployed apps and APIs run on their own compute, set up when you deploy. See [Deployments overview](/zerve-docs/ship-your-work/shipping.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zerve.ai/zerve-docs/compute/compute-types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
