# Chalk DataFrames Reference: Remote
source: https://docs.chalk.ai/dataframe-docs#section-remote

High-level interface for calling functions deployed on Chalk scaling groups.

[`Remote`](https://docs.chalk.ai/dataframe-docs#Remote) lets you invoke a deployed function by name from within a resolver or from client code. Two calling modes are supported:

- **Sync** (default) — calls the scaling group's gRPC endpoint directly via Velox and returns the result immediately.
- **Async** — routes the call through the function queue (fnq-server) and returns a [`FunctionCallHandle`](https://docs.chalk.ai/dataframe-docs#FunctionCallHandle) that you can `get()` later.

## `Remote`
source: https://docs.chalk.ai/dataframe-docs#Remote

Class

High-level interface for calling remote functions.

**Examples**

Direct call (scalar):

```python
remote = Remote(client)
fn = remote.function("add")
result = fn(1, 2)
```

Direct call from async code:

```python
fn = remote.function("add")
result = await fn(1, 2)
```

Generator (sync):

```python
fn = remote.function("count-up")
for batch in fn(5):
    print(batch)
```

Generator (async):

```python
fn = remote.function("async-count-up")
async for batch in fn(5):
    print(batch)
```

Deferred (any function type):

```python
handle = fn.defer(5)
result = handle.get()
for batch in handle.stream(): ...
```

### `Remote.scaling_group(uri, input_names, use_ssl)`
source: https://docs.chalk.ai/dataframe-docs#Remote.scaling_group

Connect to a scaling group by URI (low-level).

### `Remote.function(name, output_type)`
source: https://docs.chalk.ai/dataframe-docs#Remote.function

Look up a deployed function by name and return a callable.

The function's traits (sync/async, scalar/generator) are discovered from the catalog metadata. The calling convention mirrors Python:

- Scalar functions: `result = fn(args)` in sync code or `result = await fn(args)` in async code.
- `def f() -> Iterator`: `for x in fn(args): ...`
- `async def f() -> AsyncIterator`: `async for x in fn(args): ...`

Use `fn.defer(args)` for deferred execution via the function queue.

### `Remote.purge_all()`
source: https://docs.chalk.ai/dataframe-docs#Remote.purge_all

Drop pending items from every per-function queue for the tenant.

Returns `{function_name: items_removed}` for every queue that had at least one pending item. Empty queues are omitted from the dict. Already-popped (in-flight) calls continue to completion; only items still pending in the per-function Redis queues are removed.
