25 ยท Fallbacks & elasticity โ what happens when a piece is missing¶
Status: ๐ข Built. Ladders, cooldowns and the retry policy are generated and tested. What the lights mean
Rule: no single missing component stops you from using SecuRAX; it degrades, tells you, and ./securax up repairs it.
Rows marked โ
are exercised end-to-end by the sandbox (python3 sandbox/run.py); ๐ = covered by unit tests only; โ = documented, not automatable.
| Layer | If it's missing / broken | What SecuRAX does instead | Proof |
|---|---|---|---|
| Cloud model (Gemini/Groq/OpenRouter/โฆ) down, rate-limited, key dead | Router walks the ladder: next free cloud โ private local model | โ
key_wiring_and_failover |
|
| All cloud down / no internet | Private local model (CPU) answers; nothing leaves the machine | โ
local_model_answers |
|
| Local model not downloaded yet | Cloud ladder answers; model pulls in the background | โ | |
| Local model + cloud all down | Clean 502 (no hang); recovers when any layer returns | โ
self_healing |
|
| Router (LiteLLM) or gateway container dies | ./securax up restores it and waits for READY |
โ
self_healing |
|
| Ollama dies | Cloud ladder still answers | โ
self_healing |
|
| Llama Guard enabled but never installed | Auto-switched OFF (announced); built-in rails keep enforcing | โ
incident_stale_llama_guard |
|
python3 missing / config generator fails |
Shipped baseline config used; user told why | โ
blockers_are_explained |
|
| Docker "created a directory" at the config mount | Detected, removed, file regenerated | โ
blockers_are_explained |
|
| Port 8080/8088/3000 already taken | Named before start-up, with the command to find the owner | โ
blockers_are_explained |
|
| Image build fails / offline | Retry without rebuild โ retry core-only services | ๐ start-up chain in securax up |
|
Dirty checkout blocks git pull |
./securax update restores the generated file first |
โ
update_from_dirty_checkout |
|
| Low disk (<8 GB free) | Warning before pulling images/models | ๐ | |
| Docker not running | Plain-English fix steps; the installer puts Docker Engine inside Ubuntu, so there is no Desktop integration to switch on | โ (needs real Windows) | |
| Windows-drive slowness | Installer puts the repo on WSL's own disk; launcher prefers it | โ | |
| Open WebUI / Command Center / Guiding Map down | Gateway API + ./securax say/ask CLI still work; dots on the hub show state |
โ
ui_guiding_map_and_hub |
| Stage above the seed is asleep / never grown | Nothing runs and nothing is billed; waking restores data (laptop: volumes + secrets in the backup; cloud: vault, data disk, tenant keys) | โ
lifecycle_sprout, prove.py |
| Cloud apply interrupted / bad plan | Cloud commands plan only without --apply; hibernate/wake is one boolean on the same code; seed bank is never destroyed by sleep | โ
lifecycle_cloud_is_safe |
Elastic resources¶
On every ./securax up, autosize reads what Docker can actually use (inside WSL2 that VM cap is the real limit, not your laptop's RAM) and sets:
| Docker sees | Local chat model | Ollama RAM cap | Lite mode |
|---|---|---|---|
| < 7 GB | qwen2.5:0.5b | 45 % of it (min 1.8 GB) | on |
| 7 โ 12 GB | qwen2.5:1.5b | 45 % | on |
| 12 โ 20 GB | qwen2.5:1.5b | 45 % | off |
| โฅ 20 GB | qwen2.5:7b | 45 % (max 12 GB) | off |
CPU threads = cores โ 1 (min 2). Raise the WSL memory (%UserProfile%\.wslconfig) and restart โ it uses the extra automatically; no config edit.
Overrides: LOCAL_MODEL_PIN=1 (keep your model), SECURAX_LITE_PIN=1, SECURAX_AUTOSIZE=0 (hands control back). Preview without starting: ./securax size.
The honest limits¶
- A CPU-only 1.5B model answers in ~10โ60 s and is not a frontier model. Free cloud keys are the speed path (
./securax keys); local is the guaranteed floor. - Free-tier quotas and model lineups change often; if a provider 404s,
./securax doctorshows the real error and./securax providers addre-points it.
Failing over fast (router retry policy)¶
A rung that cannot answer now is skipped instead of being retried:
| Error | Retries on the same rung | When the rung is cooled down (skipped for 60 s) |
|---|---|---|
| Rate limit (free-tier quota, 429) | 0: straight to the next rung | on the 2nd hit |
| Timeout | 0 | on the 2nd hit |
| Bad or expired key | 0 | at once |
| Request rejected (bad request, content policy) | 0 | normal threshold |
| The provider's own server error (5xx) | 1 | normal threshold |
Generated into the router config by local/compose/gen_litellm_config.py. A test pins the policy.