Configuration Appendix

English · 简体中文 · Back to installation

This appendix accompanies the [installation guide](INSTALL.md). Chapters A–I group runtime environment variables by topic; chapter J lists command-line flags. [Reading Conventions](#conventions) · [J. Command-Line Flags](#command-line) · [Model download settings](INSTALL.md#step-3)

A. Model and Capacity

B. Context and Reasoning History

C. Sampling

D. Speculative Decoding (MTP)

E. Action Grammar and Validation

F. Server Limits and Resources

G. KV Cache and Compute Backends

H. Tensor Parallelism (TP2)

I. Diagnostics and Auditing

## Reading Conventions **Scope and setting values** Environment variables are declared in [sash/config.py](../sash/config.py), and CLI flags in [sash/server.py](../sash/server.py); both languages share the same settings and defaults. For `python -m sash.server` flags with a matching environment variable, an explicit flag overrides the default supplied by that variable. After installation, run the following command from `server/`. See [startup examples](#startup-examples) for both modes: ```bash MODEL_PATH=/path/to/local/model MAX_LEN=131072 bash start.sh --port 8000 ``` **Reading the tables** - **Types**: `path` is a file or directory path, `int` an integer, `float` a floating-point number, `str` a string, and `bool` a boolean (`1` enables, `0` disables). - **Default `—`**: No fixed default. The value may be required or resolved at startup from the hardware or mode; see the row's description. - **Common and advanced**: Each chapter lists common settings before tuning or debugging settings. Normally, keep advanced defaults. All settings in the diagnostics chapter are advanced. ## A. Model and Capacity Checkpoint location, KV cache capacity and the context length used during fine-tuning. ### Common Settings
Setting Type Default Description
MODEL_PATH path — Local checkpoint directory (config.json, safetensors, tokenizer). Required to serve.
MAX_LEN int 131072 KV cache capacity in tokens.
### Advanced Settings
Setting Type Default Description
TRAIN_LEN int 131072 Context length the checkpoint was fine-tuned at; RoPE is in-distribution up to here. (advanced)
## B. Context and Reasoning History Action-frame windows, retained thoughts and cache maintenance. Frame counts here are distinct from the token capacity set by MAX_LEN. ### Common Settings
Setting Type Default Description
ACTION_WINDOW_FRAMES int — Frames kept in context, including the current one (default of --action-window-frames; 120 with reasoning, 135 with --no-reasoning).
REASONING_HISTORY_ROUNDS int 15 Thought rounds kept in the reasoning prefix (default of --reasoning-history-rounds).
FORCE_THINKING_STEPS int 120 Reasoning mode: force a thought on turn N when the preceding N-1 turns had none (default of --force-thinking-steps; matching ACTION_WINDOW_FRAMES gives pure sawtooth reset without sliding); <= 0 disables.
ASYNC_CONTEXT_COMPACT bool 1 Reasoning mode: run compaction, action-window sliding and MTP trimming after the response is sent.
### Advanced Settings
Setting Type Default Description
REASONING_REFRESH_EVERY int 0 Reasoning mode: flush all caches and rebuild the reasoning prefix every N thoughts; 0 disables. (advanced)
VISION_FEATURE_CACHE bool 0 Cache preprocessed frames and ViT features across turns. (advanced)
VISION_CACHE_MAX_ENTRIES int 32 Frames kept by VISION_FEATURE_CACHE. (advanced)
## C. Sampling Target-model temperature and top-p settings for thoughts and actions. You can try adjusting them yourself for better results in a particular game. Draft proposal temperatures are listed under [MTP](#mtp). ### Common Settings
Setting Type Default Description
REASONING_TEMPERATURE float 1.0 Target temperature inside thoughts.
REASONING_TOP_P float 0.95 Target top-p inside thoughts, in (0, 1].
ACTION_TEMPERATURE float 1.0 Target temperature for actions.
ACTION_TOP_P float 0.99 Target top-p for actions, in (0, 1]. Uses a register-resident sparse kernel over grammar-legal tokens when ACTION_GRAMMAR=1; setting both ACTION_TOP_P and REASONING_TOP_P to 1.0 takes the zero-sort fast path.
### Advanced Settings
Setting Type Default Description
PHASE_TOP_P_IMPL str auto Top-p kernel: auto, torch, segmented or bf16_histogram. (advanced)
## D. Speculative Decoding (MTP) Draft vocabularies, proposal temperatures, draft hops and MTP cache management. ### Common Settings
Setting Type Default Description
DRAFT_VOCAB path sash/assets/draft_vocab.json Shortlist vocabulary of the MTP draft head; 0/none/off uses the full vocabulary.
REASONING_DRAFT_VOCAB path sash/assets/reason_draft_vocab.json Draft shortlist used inside thoughts; skipped when the file is missing.
PHASE_ADAPTIVE_DRAFT bool 1 Switch between the action and reasoning draft shortlists by phase.
MTP_REASONING_TEMPERATURE float 0.75 Draft proposal temperature inside thoughts.
MTP_ACTION_TEMPERATURE float 1.0 Draft proposal temperature for actions.
MTP_REASONING_HOPS int 2 Draft hops per step inside thoughts: 2 or 3.
### Advanced Settings
Setting Type Default Description
MTP_ROLLBACK bool 1 Roll the MTP cache back over entries conditioned on rejected drafts. (advanced)
MTP_LOCAL_PREFILL bool 1 Prefill the MTP cache with the last MTP_LOCAL_MAX_CHUNK prompt tokens. (advanced)
MTP_LOCAL_MAX_CHUNK int 1024 Window of MTP_LOCAL_PREFILL. (advanced)
MTP_KV_LEN int 16384 MTP draft cache capacity in entries. (advanced)
## E. Action Grammar and Validation Grammar constraints during generation and retries when a reply has an invalid format. ### Common Settings
Setting Type Default Description
ACTION_GRAMMAR bool 1 Constrain action blocks with the GPU grammar.
ACTION_FORMAT_GUARD bool 1 Validate every reply's thought and action format and retry malformed ones.
MAX_DECODE_RETRIES int 8 Retry budget of ACTION_FORMAT_GUARD per turn.
### Advanced Settings
Setting Type Default Description
GRAMMAR_SPARSE_HEAD bool 1 Evaluate only grammar-legal logits inside action blocks. (advanced)
MTP_ACTION_GRAMMAR bool 1 Apply the grammar to draft proposals as well. (advanced)
## F. Server Limits and Resources Request output limits, image-echo permissions, CPU threads and startup warmup. Host, port and session flags are listed in the [CLI reference](#command-line). ### Common Settings
Setting Type Default Description
SERVER_MAX_OUTPUT_TOKENS int 0 Upper bound applied to every request's max_tokens; 0 disables.
ALLOW_CONTEXT_IMAGE_ECHO bool 0 Allow include_reasoning_context_images to return raw base64 frames.
### Advanced Settings
Setting Type Default Description
OMP_NUM_THREADS int 8 CPU threads of torch and the image libraries. (advanced)
SKIP_ENGINE_WARMUP bool 0 Skip the startup Triton warmup (first requests will JIT-compile). (advanced)
## G. KV Cache and Compute Backends KV cache precision, attention backends and architecture-specific kernel switches. ### Common Settings
Setting Type Default Description
KV_CACHE_DTYPE fp8 | bf16 fp8 KV cache of the attention layers. fp8 uses the architecture's FP8 layout (paged on SM120 and other GPUs, contiguous on SM90); bf16 keeps contiguous BF16 keys and values on any GPU: higher precision, twice the KV memory, FlashAttention decode.
ATTENTION_BACKEND str — Prefill attention: fa3 (Hopper) or fa2. Default: fa3 on SM90, fa2 elsewhere.
### Advanced Settings
Setting Type Default Description
SM90_FA3_KV bool 1 SM90: contiguous FP8 KV cache with FA3 prefill. (advanced)
SM90_FP8_NSPLIT int — SM90: split-KV count of FP8 decode attention. Default: from SM count. (advanced)
FUSED_DECODE_NSPLIT int 32 Split count of the fused T=4 decode attention (non-SM90). (advanced)
UNIFIED_DECODE_GRAPH bool — Single CUDA graph per speculative step. Default: on for SM90. (advanced)
FUSED_FP8_DECODE bool — FP8xFP8 decode trunk with fused Split-K epilogues. Default: on for SM90. (advanced)
VIT_FP8_OPT bool — FP8 ViT blocks. Default: on for SM90. (advanced)
GDN_PREFILL_GVA bool 1 Grouped-value GDN prefill preprocessing. (advanced)
## H. Tensor Parallelism (TP2) GPU count, supported pairs and two-GPU execution options. TP_RANK is set by the runtime and should not be configured manually. ### Common Settings
Setting Type Default Description
TP_SIZE int 1 1 or 2 GPUs.
TP2_ALLOW_ANY_PAIR bool 0 Accept any peer-capable GPU pair (e.g. NVSwitch SXM5), not only NVLink-bridged NV12.
### Advanced Settings
Setting Type Default Description
TP2_ALLOW_PCIE_NV12_PAIR bool 0 Accept a PCIe pair reported as NV12. (advanced)
TP2_SHARD_VIT bool 0 Shard the ViT across both GPUs. (advanced)
TP2_P2P_STRICT_FENCE bool 0 Use system-scope fences in the P2P all-reduce. (advanced)
TP_RANK int 0 Set by the runtime for the Rank-1 worker; do not set. (advanced)
## I. Diagnostics and Auditing Advanced checks for post-warmup compilation, speculative decoding and vision-cache correctness. ### Advanced Settings
Setting Type Default Description
STRICT_NO_POST_WARMUP_JIT bool 0 Raise on any Triton compilation after warmup. (advanced)
SPEC_DIAG bool 0 Record per-hop speculative-decoding diagnostics. (advanced)
VISION_CACHE_AUDIT bool 0 Check every VISION_FEATURE_CACHE hit against an uncached ViT pass. (advanced)
## J. Command-Line Flags These flags work with `python -m sash.server` and can also be passed to `bash start.sh`. The examples below all use `start.sh`. ### Start with start.sh Run these commands from `server/` after installation; the saved model path is loaded automatically. Put sampling, mode and window flags after `bash start.sh`, then restart Server to apply changes. The examples use defaults; omit flags you do not need to change. Explicit sampling flags override the corresponding environment variables. **Reasoning: separate thought and action sampling** ```bash bash start.sh --reasoning \ --reasoning-temperature 1.0 --reasoning-top-p 0.95 \ --action-temperature 1.0 --action-top-p 0.99 \ --action-window-frames 120 --reasoning-history-rounds 15 \ --force-thinking-steps 120 --idle-reset-secs 3600 ``` This retains 15 thought rounds and at most 120 recent frames. `--force-thinking-steps 120` forces a thought after 119 consecutive turns without one; a thought or session reset restarts the count. Set it to `-1` to disable periodic forcing while allowing the model to choose when to think. **Instant: action-only mode** ```bash bash start.sh --no-reasoning \ --action-temperature 1.0 --action-top-p 0.99 \ --action-window-frames 135 --idle-reset-secs 3600 ``` Generate actions only, using action sampling settings. Retain the latest 135 frames and slide out older ones. Thought sampling settings do not participate in generation in this mode. `--action-window-frames` limits context frames, including the current one; it does not set the total test length. Use Client’s `--max-steps` for that. Instant does not accept `--force-thinking-steps` or `--reasoning-history-rounds`. **Change the port or model**: append `--port 8002` to either command and match that port in Client’s API URL. To override the model path or context capacity for one launch: ```bash MODEL_PATH=/path/to/model MAX_LEN=32768 \ bash start.sh --port 8002 --idle-reset-secs 3600 ``` ### Flag Reference
Flag Default Description
--reasoning-temperature FLOAT 1.0 Thought temperature; finite and positive. Overrides REASONING_TEMPERATURE.
--reasoning-top-p FLOAT 0.95 Thought top-p in (0, 1]. Overrides REASONING_TOP_P.
--action-temperature FLOAT 1.0 Action temperature; finite and positive. Overrides ACTION_TEMPERATURE.
--action-top-p FLOAT 0.99 Action top-p in (0, 1]. Overrides ACTION_TOP_P.
--reasoning / --no-reasoning --reasoning Select Reasoning with retained thought history, or Instant (actions only). See the startup examples above.
--action-window-frames N 120 / 135 Frames kept, including the current frame. Uses ACTION_WINDOW_FRAMES if set; otherwise 120 with reasoning or 135 without.
--reasoning-history-rounds N REASONING_HISTORY_ROUNDS (15) Thought rounds kept in the protected prefix; 0 keeps none. Reasoning mode only.
--force-thinking-steps N FORCE_THINKING_STEPS (120) Force a thought on turn N when the preceding N-1 turns had none. A thought or session reset restarts the count; 1 forces every turn, <= 0 disables. Reasoning mode only.
--host 0.0.0.0 Listen address.
--port 8000 Listen port.
--log-file PATH server.jsonl Structured JSONL log path; entries are appended.
--idle-reset-secs S 10 Reset the session after S seconds of inactivity; <= 0 disables idle resets.
--stateless off Reset the session before every request. Requires --no-reasoning.
--kv-window N MAX_LEN (131072) KV token window; evict the oldest turns when it is exceeded.
--run-note TEXT "" Free-text label recorded in the startup log.
--help / -h — Show command-line help and exit.