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

# Configuration Reference

> Complete Hydra configs and environment variables for all CLaaS backends and eval

# Configuration Reference

Exhaustive reference for every Hydra config field and environment variable across all CLaaS backends and the eval harness. For getting-started guides, see the individual backend pages.

## Local Backend

See [Local GPU Backend](/training/local) for setup instructions.

### Hydra Config (`claas/core/configs/local.yaml`)

```yaml theme={null}
defaults:
  - _core_local_schema
  - _self_

mode: local
feedback_log_dir: ./data/feedback
lora_root: /loras
storage_backend: local_fs
allowed_init_base_models:
  - Qwen/Qwen3-8B
vllm_base_url: http://127.0.0.1:8000
feedback_lock_timeout_s: 120.0
feedback_wake_on_failure: true
feedback_min_free_vram_gb: 20.0
feedback_sleep_verify_timeout_s: 30.0
feedback_drain_timeout_s: 30.0
base_model_id: Qwen/Qwen3-8B
attn_implementation: flash_attention_2
completion_cache_size: 100
```

### Environment Variables

These correspond to the `LocalConfig` dataclass fields and Docker Compose `.env` variables.

| Variable                          | Default                 | Description                                                   |
| --------------------------------- | ----------------------- | ------------------------------------------------------------- |
| `TELEGRAM_BOT_TOKEN`              | *(required)*            | Bot token from [@BotFather](https://t.me/BotFather)           |
| `HF_TOKEN`                        | —                       | HuggingFace token for gated models                            |
| `MODEL`                           | `Qwen/Qwen3-8B`         | Base model ID                                                 |
| `MAX_MODEL_LEN`                   | `32768`                 | Max sequence length for vLLM                                  |
| `GPU_MEMORY_UTILIZATION`          | `0.70`                  | GPU VRAM fraction for vLLM                                    |
| `LORA_NAME`                       | `openclaw/assistant`    | LoRA adapter identity                                         |
| `CLAAS_API_PORT`                  | `8080`                  | Host port for CLaaS API                                       |
| `OPENCLAW_PORT`                   | `18789`                 | Host port for OpenClaw gateway                                |
| `CLAAS_DISTILL_EXECUTION_MODE`    | `local`                 | Training engine                                               |
| `CLAAS_BASE_MODEL_ID`             | `Qwen/Qwen3-8B`         | Base model for LoRA training                                  |
| `CLAAS_LORA_ROOT`                 | `/loras`                | Root directory for LoRA adapter storage                       |
| `CLAAS_STORAGE_BACKEND`           | `local_fs`              | Storage backend: `local_fs`, `modal_volume`, or `tinker_json` |
| `CLAAS_ALLOWED_INIT_BASE_MODELS`  | `Qwen/Qwen3-8B`         | Comma-separated allowlist for `/v1/lora/init`                 |
| `CLAAS_COMPLETION_CACHE_SIZE`     | `100`                   | Completion cache entries to retain                            |
| `FEEDBACK_LOG_DIR`                | `./data/feedback`       | Directory for structured feedback JSON logs                   |
| `VLLM_BASE_URL`                   | `http://127.0.0.1:8000` | vLLM server URL                                               |
| `VLLM_API_KEY`                    | `sk-local`              | API key for vLLM authentication                               |
| `CLAAS_ATTN_IMPLEMENTATION`       | `flash_attention_2`     | Attention backend (`sdpa`, `flash_attention_2`)               |
| `FEEDBACK_LOCK_TIMEOUT_S`         | `120`                   | Per-LoRA lock timeout in seconds                              |
| `FEEDBACK_WAKE_ON_FAILURE`        | `true`                  | Wake vLLM if the distill step fails                           |
| `FEEDBACK_MIN_FREE_VRAM_GB`       | `20`                    | Minimum free VRAM (GB) before training starts                 |
| `FEEDBACK_SLEEP_VERIFY_TIMEOUT_S` | `30`                    | Timeout (s) waiting for vLLM to sleep                         |
| `FEEDBACK_DRAIN_TIMEOUT_S`        | `30`                    | Timeout (s) draining vLLM queue before sleep                  |

***

## Tinker Backend

See [Tinker SDK Backend](/training/tinker) for setup instructions.

### Hydra Config (`claas/core/configs/tinker.yaml`)

```yaml theme={null}
defaults:
  - _core_tinker_schema
  - _self_

mode: tinker
feedback_log_dir: ./data/feedback
lora_root: /loras
storage_backend: local_fs
allowed_init_base_models:
  - Qwen/Qwen3-8B
vllm_base_url: http://127.0.0.1:8000
tinker_base_model: Qwen/Qwen3-30B-A3B
tinker_state_path: /data/tinker_state.json
completion_cache_size: 100
```

### Environment Variables

These correspond to the `TinkerConfig` dataclass fields and Docker Compose `.env.tinker` variables.

| Variable                         | Default                      | Description                                          |
| -------------------------------- | ---------------------------- | ---------------------------------------------------- |
| `TELEGRAM_BOT_TOKEN`             | *(required)*                 | Bot token from [@BotFather](https://t.me/BotFather)  |
| `TINKER_API_KEY`                 | *(required)*                 | API key for Tinker SDK                               |
| `MODEL`                          | `Qwen/Qwen3-30B-A3B`         | Base model ID (Tinker name)                          |
| `LORA_NAME`                      | `openclaw/assistant`         | LoRA adapter identity                                |
| `CLAAS_API_PORT`                 | `8080`                       | Host port for CLaaS API                              |
| `OPENCLAW_PORT`                  | `18789`                      | Host port for OpenClaw gateway                       |
| `TINKER_PROXY_PORT`              | `8000`                       | Host port for Tinker inference proxy                 |
| `FEEDBACK_BATCH_SIZE`            | `4`                          | Samples per feedback batch before triggering distill |
| `CLAAS_DISTILL_EXECUTION_MODE`   | `tinker`                     | Training engine                                      |
| `CLAAS_LORA_ROOT`                | `/loras`                     | Root directory for LoRA adapter storage              |
| `CLAAS_STORAGE_BACKEND`          | `local_fs`                   | Storage backend (use `tinker_json` for Tinker)       |
| `CLAAS_ALLOWED_INIT_BASE_MODELS` | `Qwen/Qwen3-8B`              | Comma-separated allowlist for `/v1/lora/init`        |
| `CLAAS_COMPLETION_CACHE_SIZE`    | `100`                        | Completion cache entries to retain                   |
| `FEEDBACK_LOG_DIR`               | `./data/feedback`            | Directory for structured feedback JSON logs          |
| `CLAAS_TINKER_API_KEY`           | *(required)*                 | Tinker SDK API key                                   |
| `CLAAS_TINKER_BASE_MODEL`        | `Qwen/Qwen3-30B-A3B`         | Hosted model for distillation                        |
| `CLAAS_TINKER_STATE_PATH`        | `~/.claas/tinker_state.json` | Local path for Tinker LoRA state file                |
| `VLLM_BASE_URL`                  | `http://127.0.0.1:8000`      | URL of the Tinker inference proxy                    |
| `VLLM_API_KEY`                   | `sk-local`                   | API key for inference proxy                          |

***

## Modal Backend

See [Modal Cloud Backend](/training/modal) for setup instructions.

### Hydra Config (`claas/core/configs/modal.yaml`)

```yaml theme={null}
defaults:
  - _core_modal_schema
  - _self_

mode: modal
feedback_log_dir: ./data/feedback
lora_root: /loras
storage_backend: modal_volume
allowed_init_base_models:
  - Qwen/Qwen3-8B
vllm_base_url: http://127.0.0.1:8000
feedback_lock_timeout_s: 120.0
feedback_wake_on_failure: true
feedback_min_free_vram_gb: 20.0
feedback_sleep_verify_timeout_s: 30.0
feedback_drain_timeout_s: 30.0
completion_cache_size: 100
```

### Environment Variables

These correspond to the `ModalConfig` dataclass fields.

| Variable                          | Default                 | Description                                    |
| --------------------------------- | ----------------------- | ---------------------------------------------- |
| `HF_TOKEN`                        | —                       | HuggingFace token for gated models             |
| `CLAAS_DISTILL_EXECUTION_MODE`    | `modal`                 | Training engine                                |
| `CLAAS_BASE_MODEL_ID`             | `Qwen/Qwen3-8B`         | Base model for LoRA training                   |
| `CLAAS_LORA_ROOT`                 | `/loras`                | Root directory for LoRA adapter storage        |
| `CLAAS_STORAGE_BACKEND`           | `modal_volume`          | Storage backend (use `modal_volume`)           |
| `CLAAS_ALLOWED_INIT_BASE_MODELS`  | `Qwen/Qwen3-8B`         | Comma-separated allowlist for `/v1/lora/init`  |
| `CLAAS_COMPLETION_CACHE_SIZE`     | `100`                   | Completion cache entries to retain             |
| `FEEDBACK_LOG_DIR`                | `./data/feedback`       | Directory for structured feedback JSON logs    |
| `VLLM_BASE_URL`                   | `http://127.0.0.1:8000` | vLLM server URL (within Modal)                 |
| `VLLM_API_KEY`                    | `sk-local`              | API key for vLLM authentication                |
| `FEEDBACK_LOCK_TIMEOUT_S`         | `120`                   | Per-LoRA lock timeout in seconds               |
| `FEEDBACK_WAKE_ON_FAILURE`        | `true`                  | Wake vLLM if the distill step fails            |
| `FEEDBACK_MIN_FREE_VRAM_GB`       | `20`                    | Minimum free VRAM (GB) before training starts  |
| `FEEDBACK_SLEEP_VERIFY_TIMEOUT_S` | `30`                    | Timeout (s) waiting for vLLM to sleep          |
| `FEEDBACK_DRAIN_TIMEOUT_S`        | `30`                    | Timeout (s) draining vLLM queue before sleep   |
| `CLAAS_HF_SECRET_NAME`            | —                       | Name of Modal Secret containing HF credentials |

***

## Eval Harness

See [Configuration & Running](/eval/running) for setup instructions.

### Hydra Config (`claas/eval/configs/base.yaml`)

```yaml theme={null}
mode: tinker
claas_url: http://localhost:8080
base_model: Qwen/Qwen3-30B-A3B

preferences:
  - no_emoji
  - concise
  - identity

metrics:
  - logprob
  - compliance
  - general
  - collapse

collapse_steps: [0, 5, 10, 15, 19]
plots: true

num_steps: 20
batch_size: 4
steps_per_batch: 1
feedback_repetitions: 1
seed: 42
lora_id_prefix: eval
output_dir: ./data/evals

openclaw_url: http://localhost:18789
```

### Config Fields

| Field                  | Type          | Default                                    | Description                                               |
| ---------------------- | ------------- | ------------------------------------------ | --------------------------------------------------------- |
| `mode`                 | `str`         | `tinker`                                   | Execution backend: `local`, `tinker`, or `modal`          |
| `claas_url`            | `str`         | `http://localhost:8080`                    | CLaaS API endpoint                                        |
| `base_model`           | `str`         | `Qwen/Qwen3-30B-A3B`                       | Base model for LoRA init (use Tinker name in Tinker mode) |
| `preferences`          | `list[str]`   | `[no_emoji, concise, identity]`            | Preferences to train and evaluate                         |
| `metrics`              | `list[str]`   | `[logprob, compliance, general, collapse]` | Metrics to evaluate per step                              |
| `num_steps`            | `int`         | `20`                                       | Number of feedback steps per preference                   |
| `batch_size`           | `int`         | `4`                                        | Samples per feedback batch                                |
| `steps_per_batch`      | `int`         | `1`                                        | Gradient updates per batch                                |
| `feedback_repetitions` | `int`         | `1`                                        | Times to repeat feedback string per sample                |
| `collapse_steps`       | `list[int]`   | `[0, 5, 10, 15, 19]`                       | Steps where collapse metric runs                          |
| `plots`                | `bool`        | `true`                                     | Generate matplotlib plots                                 |
| `seed`                 | `int`         | `42`                                       | Random seed for reproducibility                           |
| `lora_id_prefix`       | `str`         | `eval`                                     | Prefix for eval LoRA adapter IDs                          |
| `output_dir`           | `str`         | `./data/evals`                             | Directory for eval output                                 |
| `openclaw_url`         | `str \| null` | `http://localhost:18789`                   | OpenClaw gateway URL (null = use CLaaS proxy directly)    |

### Environment Variables (Secrets)

Secrets are resolved from environment variables at runtime, not stored in config files.

| Variable                         | Required for     | Purpose                                      |
| -------------------------------- | ---------------- | -------------------------------------------- |
| `CLAAS_TINKER_API_KEY`           | Tinker mode      | Tinker SDK authentication                    |
| `CLAAS_TINKER_BASE_MODEL`        | Tinker mode      | Must match `base_model` in config            |
| `CLAAS_DISTILL_EXECUTION_MODE`   | API server       | `tinker`, `local`, or `modal`                |
| `CLAAS_ALLOWED_INIT_BASE_MODELS` | API server       | Comma-separated allowed models for LoRA init |
| `VLLM_API_KEY`                   | Local mode       | vLLM server auth token                       |
| `OPENCLAW_GATEWAY_TOKEN`         | OpenClaw mode    | Auth token for OpenClaw gateway              |
| `GEMINI_API_KEY`                 | `general` metric | Gemini-based capability evaluation           |
