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

# Self-host AI compute

> Operate your own remote parsing and AI compute server, including model routes, authentication, and TLS.

Run a remote compute endpoint on infrastructure you operate with `chowder.serve()`. This advanced guide covers server setup, inference routes, and network access. The calling application keeps its in-process SQL engine and offloads supported parsing and AI operations to your server.

For fully managed AI compute, use Chowder Cloud. [Connect to remote AI compute](https://docs.chowder.ai/guides/remote-compute.md) covers the client settings for either deployment.

Use the same Chowder version on the client and server.

## Start a loopback server

Loopback binds may run without TLS or authentication for local development:

```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
import chowder

chowder.serve(location="grpc://127.0.0.1:8816")
```

`chowder.serve()` blocks the calling thread. Run it in a dedicated process.

Connect from another process:

```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
import chowder

SQL = """
SELECT
    source,
    page_number,
    content
FROM read_documents('hf://buckets/chowderai/chowder-demo/pdf/data/att-management-discussion-and-analysis-2020.pdf')
LIMIT 5
"""

engine = chowder.Engine(location="grpc://127.0.0.1:8816")

relation = engine.sql(SQL)
result = relation.to_arrow_table()

print(result)

engine.close()
```

For this query, the client reads the matching files and sends bounded file data to the server for parsing.

## Configure AI routes

Remote parsing works without an external inference tier. Remote AI functions require the server operator to configure the matching endpoint. Set these variables in the server environment before starting or restarting `chowder.serve()`:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
export CHOWDER_INFER_BOOLEAN_INFERENCE_URL="http://127.0.0.1:8081"
export CHOWDER_INFER_INFERENCE_URL="http://127.0.0.1:8082"
export CHOWDER_EMBED_INFERENCE_URL="http://127.0.0.1:8083"
export CHOWDER_EMBED_INFERENCE_DIM="1024"
export CHOWDER_EMBED_INFERENCE_PROMPT_CONTRACT="qwen3-vl-chat-v1"
```

Each endpoint must be a llama.cpp, vLLM, or supported hosted inference server. Optional `_INFERENCE_MODEL_NAME`, `_INFERENCE_MODEL_HASH`, and `_INFERENCE_CONCURRENCY` suffixes describe the served model and bound batch concurrency. Without `_INFERENCE_MODEL_HASH`, inference still works, but results aren't cached.

By default, the server forwards `CHOWDER_FLIGHT_TOKEN` to the inference endpoints. Set `CHOWDER_INFERENCE_API_KEY` to use a separate key.

Set `CHOWDER_TRANSCRIBE_INFERENCE_URL` plus its required model name and hash to proxy audio and video transcription. Otherwise, transcription uses the server's local typed runtime configuration.

> [!NOTE]
>
> Client prompts and documents transit the Chowder server. The server forwards requests to its configured inference tier. Include both systems in your security and data-governance boundary.

## Bind to a network interface

For a non-loopback bind, configure the server account key and TLS certificate:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
export CHOWDER_FLIGHT_TOKEN="replace-with-a-long-random-secret"
export CHOWDER_FLIGHT_TLS_CERT="/etc/chowder/tls/server.crt"
export CHOWDER_FLIGHT_TLS_KEY="/etc/chowder/tls/server.key"
```

Start the server with a TLS location:

```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
import chowder

chowder.serve(location="grpc+tls://0.0.0.0:8816")
```

The server still reads `CHOWDER_FLIGHT_TOKEN`; this is separate from the client-facing name. For a direct connection, set the client’s `CHOWDER_API_TOKEN` to the same account key. Do not put the key in SQL or source code.

Connect from the client:

```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
import chowder

SQL = """
SELECT 1 AS ready
"""

engine = chowder.Engine(location="grpc+tls://compute.example.com:8816")

relation = engine.sql(SQL)
result = relation.to_arrow_table()

print(result)

engine.close()
```

The server refuses an anonymous non-loopback bind. Clients also refuse to send credentials to a plaintext non-loopback endpoint by default. Use TLS for network connections.

## Trusted-network escape hatch

`CHOWDER_ALLOW_INSECURE_BIND=1` permits a non-loopback plaintext bind. Use it only on a network whose transport security and access control you already trust. Clients must opt in to the same policy before sending credentials over plaintext.

## Connect applications to your server

Give clients the endpoint and an appropriate account credential. They can set `CHOWDER_API_URL` and `CHOWDER_API_TOKEN`, then opt in with `Engine(remote=True)` or `CHOWDER_REMOTE=1`. See [Connect to remote AI compute](https://docs.chowder.ai/guides/remote-compute.md) for endpoint precedence and local overrides.

For the division between client-side SQL execution and server-side AI processing, see [Architecture](https://docs.chowder.ai/concepts/architecture.md#application-and-compute-boundaries).


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