# Runtime

The **HEAL Runtime** is an engine that sequentially processes a model inference pipeline, as defined in a [JSON-based transcript](/core-concepts-explained/transcript.md). This runtime is hardware-agnostic, delegating each operation to a provided device engine and abstracting execution to enable both software fallbacks and hardware acceleration.

The runtime reads an execution transcript (a list of operations) and executes them step-by-step. It handles memory references between host and device, dispatches each instruction to the correct function, and manages verification if required.

This allows for seamless execution of fully homomorphic encryption (FHE) workflows, including

* Moving data between the host and hardware (`host_to_device`, `device_to_host`)
* Executing tensor operations (e.g., `modmul`) on hardware
* Managing memory via named tensor references
* Logging performance and verification success

{% hint style="warning" %}
The runtime described here is used with sandbox transcripts in an isolated environment and is designed as a simplified version of the Lattica backend.\
However, any hardware that is compatible with this runtime is also compatible with the full Lattica backend. This ensures a smooth path from development and testing to full deployment.
{% endhint %}

***

## Call Format

```python
run_transcript(device_t_eng, transcript, verify=False)
```

### `device_t_eng`

The hardware abstraction interface knows how to run each function. \
This is the **bridge between the runtime and your implementation**.&#x20;

### `transcript`

JSON-based list of instructions. \
For full details, see the [*Transcript* ](/core-concepts-explained/transcript.md)page.

### `verify`

By default, **`verify=False`**, which means the runtime just runs the functions and assumes the hardware gives correct results.

If it is enabled, the runtime compares the actual result with the expected output (embedded in the transcript). If they don't match, it raises an error.

This is useful for debugging or validating your hardware functions.

***

## Output

At the end of execution:

* The runtime prints timing info
* You get logs for each step
* If verification is enabled, it confirms correctness

***


---

# 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://healdocs.lattica.ai/core-concepts-explained/runtime.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.
