> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# No Model Requests • AI Agent SDK

> no_model_requests: Block real model requests for the duration of the ``with`` block.

# no\_model\_requests

Function

> This function is defined in the [**guard**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/guard.md) module.

Block real model requests for the duration of the `with` block.

Composes with a suite-wide :func:`allow_model_requests` call and with other
`no_model_requests` blocks. Rather than saving and restoring the global
flag -- which lets an inner or cross-thread scope exiting first re-enable
requests while an outer scope is still open -- this increments a block
counter, so requests stay blocked until *every* open scope has exited::

with no\_model\_requests():
agent.start("hello")  # raises ModelRequestBlocked

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def no_model_requests() -> Iterator[None]
```

### Returns

**Returns** `Iterator[None]`

The result of the operation.

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/model_harness/guard.py#L140)**
>
> `praisonaiagents/model_harness/guard.py` at line 140


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.