> ## 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.

# Configuration

> Configure Chowder with Python settings and environment variables.

Use typed Python configuration for an engine. Environment variables are process-wide settings for deployment policy, artifact downloads, caches, and child runtimes. They also configure the `chowder sql` CLI and the local MCP server, which create their own engines.

## Engine configuration

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

engine = chowder.Engine(
    cache_dir=".chowder-cache",
    embed_config=chowder.EmbedConfig(normalize=True),
    reader_config=chowder.ReaderConfig(source_concurrency=4),
    progress="auto",
)
```

For remote compute:

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

engine = chowder.Engine(
    remote=True,
    num_gpus=1,
    progress="json",
)
```

Set `CHOWDER_API_TOKEN` for the client credential. `remote=True` requires `CHOWDER_API_URL` unless you pass an explicit `location=`. `CHOWDER_REMOTE=1` enables remote compute for new engines when `remote` is omitted. `remote=False` overrides that environment switch and keeps an engine local.

The URL and token alone do not enable remote compute. `num_gpus` is remote-only and must be from 1 through 64. See [Connect to remote AI compute](https://docs.chowder.ai/guides/remote-compute.md) for client selection and endpoint precedence.

## Typed local runtime

`LocalRuntimeConfig` groups local backend settings for llama.cpp, ONNX Runtime, and transcription. Chowder manages which model runs for each operation; see [Models](https://docs.chowder.ai/concepts/models.md).

```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
runtime = chowder.LocalRuntimeConfig(
    llama_cpp=chowder.LlamaCppConfig(
        parallel=4,
        ctx_size=8192,
        gpu_layers="auto",
        flash_attn="auto",
    ),
    onnx_runtime=chowder.OnnxRuntimeConfig(
        providers=("CPUExecutionProvider",),
        intra_op_num_threads=4,
    ),
    transcription=chowder.LocalTranscriptionConfig(
        model="/models/ggml-small.en.bin",
        whisper_cpp=chowder.WhisperCppConfig(threads=4),
    ),
)

engine = chowder.Engine(local_runtime=runtime)
```

See [Python API](https://docs.chowder.ai/reference/python-api.md#typed-configuration) for every typed field.

## SQL session settings

Override the remote GPU request for later queries in the same session:

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
SET chowder.num_gpus = 4;
SHOW chowder.num_gpus;
RESET chowder.num_gpus;
```

`SET` requires remote compute; on a local engine it raises an error. `SHOW` and `RESET` run on any engine. On a remote engine, `SHOW` returns null until you `SET` a value, and `RESET` returns to the engine's `num_gpus` value.

## Progress

Set `progress=` or `CHOWDER_PROGRESS` to one of:

| Value | Behavior |
| - | - |
| `auto` | Choose notebook, terminal, or captured-output rendering. |
| `tty` | Force interactive terminal rendering. |
| `plain` | Plain text lines without terminal formatting. |
| `json` | JSON events on stderr, one per line. |
| `off` | Disable progress display. |

## Cache and source limits

| Variable | Default | Purpose |
| - | - | - |
| `CHOWDER_CACHE_DIR` | `~/.cache/chowder/results` | Durable result-cache root. `Engine(cache_dir=...)` wins. |
| `CHOWDER_CACHE_GB` | `8` | Result-cache budget in GiB. `0` means unbounded. |
| `CHOWDER_MODEL_CACHE_DIR` | `~/.cache/chowder/models` | Model artifact root and base for sibling runtime caches. |
| `CHOWDER_KNN_INDEX_CACHE_MB` | `512` | Memory budget for cached HNSW indexes, per engine, in MiB. |
| `CHOWDER_MAX_FILE_MB` | `500` | Per-source file-size ceiling for document and media readers. |
| `CHOWDER_MAX_CONCURRENT_PARSES` | `4` | Maximum documents parsed at once in a process. |
| `CHOWDER_SHARD_PAGES` | `5000` | Document shard size in pages. |
| `CHOWDER_TARGET_PARTITIONS` | Available cores | Number of parallel partitions for query execution. |
| `CHOWDER_KNN_JOIN_MODE` | `auto` | Execution mode for nearest-neighbor joins: `auto`, `exact`, or `approx`. |

`engine.clear_cache()` clears durable query results while preserving model and runtime artifacts. Pass `artifacts=True` for a full Chowder-owned artifact sweep.

See [Caching](https://docs.chowder.ai/concepts/caching.md) for what is reused and when changes cause work to run again.

## Timeouts and model residency

| Variable | Default | Purpose |
| - | - | - |
| `CHOWDER_AI_TIMEOUT_S` | `600` | Per-request ceiling, in seconds, for AI calls, including retries while a server starts. |
| `CHOWDER_MODEL_IDLE_S` | `120` | Seconds an idle local model stays loaded before Chowder unloads it. `0` keeps models loaded. |

## Runtime and deployment details

These controls are primarily for packaging, acceleration, and production deployment.

> [accordion] Managed artifacts
>
> | Variable | Purpose |
> | - | - |
> | `CHOWDER_ARTIFACT_SOURCE` | Override the root that supplies managed binaries and model artifacts. |
> | `CHOWDER_ARTIFACT_TOKEN` | Bearer token for a direct HTTPS artifact source. |
> | `CHOWDER_LLAMA_SERVER_BIN` | Explicit `llama-server` executable. |
> | `CHOWDER_MANAGED_LLAMA_BIN` | Opt out of the managed llama.cpp binary when set false. |
> | `CHOWDER_LLAMA_CUDA_BACKEND` | Explicit llama.cpp CUDA backend library. |
> | `CHOWDER_LLAMA_GPU` | Opt out of llama.cpp GPU offload when set false. |
> | `CHOWDER_WHISPER_RUNTIME_DIR` | Explicit complete whisper.cpp runtime bundle. |
> | `CHOWDER_MANAGED_WHISPER_RUNTIME` | Opt out of the managed whisper.cpp runtime when set false. |
> | `CHOWDER_WHISPER_CUDA_BACKEND` | Explicit whisper.cpp CUDA backend library. |
> | `CHOWDER_WHISPER_GPU` | Opt out of resolving the Whisper CUDA backend when set false. |
> | `CHOWDER_WHISPER_LANG` | Force a transcription language instead of auto-detection. |
>
> Use `LocalTranscriptionConfig` for the transcription model and `WhisperCppConfig` for threads and device behavior.

> [accordion] ONNX acceleration
>
> Use `OnnxRuntimeConfig` for explicit providers and session options. `CHOWDER_ACCEL` supplies the process-wide `auto`, `cpu`, `cuda`, or `coreml` policy when typed providers are absent.
>
> Inspect the resolved request and runtime state with:
>
> ```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
> print(engine.status()["local_runtime"])
> ```

> [accordion] Cloud credentials
>
> Chowder follows each provider's standard credential chain:
>
> * AWS environment credentials, profiles, SSO, ECS, or instance roles
> * Google Application Default Credentials
> * Azure environment credentials, `az login`, or managed identity
> * `HF_TOKEN` or an existing Hugging Face login
>
> Without credentials, Chowder reads S3, GCS, and Azure anonymously. Set `AWS_SKIP_SIGNATURE`, `GOOGLE_SKIP_SIGNATURE`, or `AZURE_SKIP_SIGNATURE` to `true` to force anonymous reads. See [Amazon S3](https://docs.chowder.ai/reference/sources/amazon-s3.md#authentication), [Google Cloud Storage](https://docs.chowder.ai/reference/sources/google-cloud-storage.md#authentication), and [Azure Blob Storage](https://docs.chowder.ai/reference/sources/azure-blob-storage.md#authentication).
>
> Do not place secrets in SQL text.

> [accordion] Remote compute
>
> | Variable | Purpose |
> | - | - |
> | `CHOWDER_REMOTE` | Client remote-compute opt-in when `Engine(remote=...)` is omitted; defaults off. |
> | `CHOWDER_API_URL` | Remote endpoint. Required when remote compute is enabled and `location=` is omitted. |
> | `CHOWDER_API_TOKEN` | Client credential when `token=` is omitted. |
> | `CHOWDER_FLIGHT_TOKEN` | Self-hosted server account key; direct clients use the same key via `CHOWDER_API_TOKEN`. |
> | `CHOWDER_FLIGHT_TLS_CERT` | Server TLS certificate chain. |
> | `CHOWDER_FLIGHT_TLS_KEY` | Server TLS private key. |
> | `CHOWDER_FLIGHT_TLS_ROOT` | Client trust root for a private CA. |
> | `CHOWDER_FLIGHT_MAX_MESSAGE_BYTES` | Maximum size of one Arrow Flight message the server accepts or sends, in bytes. Default: 64 MiB. It limits wire messages, not source files or model uploads. |
> | `CHOWDER_ALLOW_INSECURE_BIND` | Explicit trusted-network plaintext opt-in. |
> | `CHOWDER_INFERENCE_API_KEY` | Credential forwarded to a protected inference tier. |
>
> Served AI routes use the prefixes `CHOWDER_INFER_BOOLEAN`, `CHOWDER_INFER`, `CHOWDER_EMBED`, and `CHOWDER_TRANSCRIBE`. The `_INFERENCE_URL` suffix enables a route. 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 persistent result caching is disabled. Embedding additionally requires `_INFERENCE_DIM` and may set `_INFERENCE_PROMPT_CONTRACT`. Transcription requires both `_INFERENCE_MODEL_NAME` and `_INFERENCE_MODEL_HASH`, and may set `_INFERENCE_SPEECH_REGIONS` and `_INFERENCE_MEDIA_CONCURRENCY`.
>
> See [Connect to remote AI compute](https://docs.chowder.ai/guides/remote-compute.md) for client settings and [Self-host AI compute](https://docs.chowder.ai/guides/self-host-ai-compute.md) for server deployment. Use the same Chowder version on the client and server.


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