> For the complete documentation index, see [llms.txt](https://docs.degirum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.degirum.com/hailo/basics/specifying-a-model/inference-setup.md).

# Inference setup

*Estimated read time: 2 minutes*

## Inference setup—pick your scenario

This page focuses on two `ModelSpec` parameters:

* **`zoo_url`**: where the model is stored (cloud vs. local)
* **`inference_host_address`**: where the model runs (`"@cloud"` vs. `"@local"`)

Pick the setup that matches where you want inference to run and where your models live.

{% hint style="info" %}
AI Server setups—like custom endpoints and multi-model hosting—are covered in the Advanced topics section.
{% endhint %}

### Cloud inference

**Cloud zoo** → **cloud runtime**

**Use when**: You want zero local setup—everything runs in the cloud.

{% code overflow="wrap" %}

```python
from degirum_tools import ModelSpec

spec = ModelSpec(
    model_name="yolov8n_coco--640x640_quant_hailort_multidevice_1",
    zoo_url="degirum/hailo",  # cloud model zoo
    inference_host_address="@local",  # inference executes on your machine
    model_properties={"device_type": ["HAILORT/HAILO8L", "HAILORT/HAILO8"]},
)
model = spec.load_model()
```

{% endcode %}

### Local inference with cloud zoo

**Cloud zoo** → **local runtime**

**Use when**: You have local hardware but prefer to fetch models from the cloud.

{% code overflow="wrap" %}

```python
from degirum_tools import ModelSpec

spec = ModelSpec(
    model_name="yolov8n_coco--640x640_quant_hailort_multidevice_1",
    zoo_url="degirum/hailo",  # fetch artifacts from cloud
    inference_host_address="@local",  # inference executes on your machine
    model_properties={"device_type": ["HAILORT/HAILO8L", "HAILORT/HAILO8"]},
)
model = spec.load_model()
```

{% endcode %}

### Local inference with local zoo

Local zoo → local runtime

**Use when**: You want offline operation and predictable model behavior. Use `ModelSpec.ensure_local()` to download and store the model locally, then switch the `ModelSpec` to local before loading.

{% code overflow="wrap" %}

```python
from degirum_tools import ModelSpec

spec = ModelSpec(
    model_name="yolov8n_coco--640x640_quant_hailort_multidevice_1",
    zoo_url="degirum/hailo",  # start from cloud reference
    inference_host_address="@local",  # inference executes locally
    model_properties={"device_type": ["HAILORT/HAILO8L", "HAILORT/HAILO8"]},
)

# One-time (while online): download/verify artifacts and update spec to local zoo.
spec.ensure_local()

# After this, loading uses the local zoo (offline-friendly).
model = spec.load_model()
```

{% endcode %}

{% hint style="info" %}

* Once loaded, model objects are callable: `model(x)` ≡ `model.predict(x)`
* Public model zoos generally don't require a token; private ones do.
* For advanced setups (e.g., using AI Server or hosting your own model zoo), see Advanced topics.
  {% endhint %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.degirum.com/hailo/basics/specifying-a-model/inference-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
