---
name: plugsky-strategy
slug: plugsky--plugsky-strategy
description: "Plugsky AI outage/rescue strategy, free-user isolation, caps, paid routing, and model-chain fixes. WHEN: plugsky strategy, outage fallback, rescue lanes, free user isolation, paid user service, model chain, caps, concurrency, JSON mode, large output."
collection: Plugsky
category: Platform Ops
license: Plugsky
source: https://plugsky.com/skills
install: "Download the Plugsky skills pack (see below)"
---

# plugsky-strategy

Plugsky AI outage/rescue strategy, free-user isolation, caps, paid routing, and model-chain fixes. WHEN: plugsky strategy, outage fallback, rescue lanes, free user isolation, paid user service, model chain, caps, concurrency, JSON mode, large output.

## Install

```bash
Download the Plugsky skills pack (see below)
```

## Skill

# Plugsky AI — Strategy & Operations (living doc)

Last updated: **2026-11-06** (Round 21). Full audit: `Plugsky/docs/ops/audit-skills.md` and `PLUGSKY-FULL-AUDIT-2026-10-27.md`.

## 1. Free-user isolation (HARD RULE)

- Free accounts may use **only** the two free Plugsky models: `plugsky-micro`, `plugsky-lite` (both map to `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning`).
- Free users **never** cascade onto paid NVIDIA peers, generic fallbacks, or paid rescue lanes.
- Free users **never** touch second-provider rescue (OpenCode/OpenRouter/Groq/BytePlus/LLM7/Ollama).
- Enforced in `ChatService.php`: free plan → `$cascade = [nano-omni]` (blocking + streaming); `paidUser=false` skips `trySecondProvider`.
- Free caps: daily 150 req (50 new), 100k tokens (25k new), global 1M tokens, 60 global RPM, concurrency 2 (1 new).

## 2. Paid-user experience

- Paid users get NVIDIA primary first, then class-preserving NVIDIA backups, then the rescue chain.
- **Class contract:** a frontier request may receive a professional engine under the published failover policy, but never a silent entry/free downgrade. If everything in-class is at capacity, return a clean retryable 503 rather than a weak answer.
- Paid rescue prefers **paid lanes for premium classes**. Free lanes are used when class, quality, tool/JSON support, and legal terms allow it.
- Memory/context is preserved: rescue receives the full request body (messages/tools/response_format).
- No per-request switch disables failover. Each response exposes the served upstream in `x_plugsky_served_model` and `X-Plugsky-Served-Model`.

## 3. Caps table (fair-use / rescue)

| Plan | Free daily req | Free daily tokens | Rescue call cap | Rescue USD cap |
|---|---|---|---|---|
| free (new) | 50 | 25k | 50 | $0.50 |
| free (verified) | 150 | 100k | 100 | $1.00 |
| trial | 300 | 200k | 200 | $2.00 |
| hobby | 2,000 | 1M | 500 | $3.00 |
| starter | 10,000 | 5M | 1,000 | $5.00 |
| builder | 50,000 | 20M | 2,000 | $8.00 |
| scale/enterprise | soft unlimited | soft unlimited | 5,000 | $12/$25 |

Env keys:

- `FAIRUSE_FREE_DAILY`, `FAIRUSE_FREE_NEW_DAILY`, `FAIRUSE_FREE_TOKENS`, `FAIRUSE_FREE_NEW_TOKENS`, `FAIRUSE_FREE_GLOBAL_TOKENS`, `FAIRUSE_FREE_GLOBAL_RPM`
- `FAIRUSE_PAID_CONCURRENT` (default **12**), `FAIRUSE_PAID_WAIT_SECONDS` (0.5)
- `OPENCODE_DAILY_GLOBAL_CAP`, `OPENCODE_DAILY_USER_CAP`, `OPENCODE_DAILY_USD_CAP`, `OPENCODE_DAILY_USER_USD_CAP`
- `RESCUE_TIER_USD_*` per provider.

## 4. Routing changes applied (2026-10-27)

- **JSON mode stays on the NVIDIA primary.** JSON requests never skip the primary; `salvageJson()` accepts objects only, matching `response_format: json_object`. A 6K JSON request returned **200 in 4.9s** on NVIDIA ultra, class 3.
- **Large-output requests skip a cooling primary.** With `max_tokens > 8192` and input `< 16000`, go straight to rescue instead of spending 15–20s on a saturated cascade. A controlled 12K-input/12K-cap request returned **200 in 12s**, served by `last-resort/deepseek-v4.1-flash`.
- **OpenCode gets a 45s slice for large output** (12s normal). This fixed user 5187's 58s failure (ultra 429 → minimax 16s → OpenCode 30s → BytePlus 10s).
- **Fast-fail overrides:** gpt-oss 9s, mistral-nemotron 8s, ultra-550b 10s; cascade attempt cap 15s.
- **Paid 429 cooldown 120s; paid breaker 20 failures / 15 min → 60s.** JSON/fastlane temperature 0.
- **Rescue guard probes paid OpenCode `deepseek-v4.1-flash`**, not the retired `longcat-2.5-preview-free`. A free-model 429 no longer closes the paid OpenCode provider.
- **Concurrency:** the package default is **12**. Users 1745 and 5187 had manual Redis overrides of **5** with no TTL, set during the 2026-10-24 saturation. Both were deleted on 2026-10-27; 5m/15m paid errors stayed at 0. If 429s spike, re-add **8** and document it.

## 5. Rescue lane order (paid)

1. NVIDIA primary + class-preserving cascade (backup + peers + tail).
2. Free rescue lanes where class/quality/legal allow: OpenCode Go/Zen free, OpenRouter free, Groq, BytePlus free, Cloudflare, LLM7, Ollama, FreeLLMAPI, TokenHarbor, Gemini.
3. Cheapest paid rescue lane matching context (class distance + price), e.g. BytePlus paid, OpenCode paid `deepseek-v4.1-flash`, last-resort DeepSeek.
4. GPU Share (`plugsky-gpu-27b`) when a worker is online and the request shape fits.

**Healthy lanes are used, not ignored.** 24h production evidence:

| Lane | Calls | State |
|---|---:|---|
| NVIDIA ultra | 10,605 | primary |
| NVIDIA nano-omni | 9,129 | primary entry/vision |
| Last-resort DeepSeek | 7,806 | paid last resort |
| OpenCode `beam-free` | 1,864 | healthy free rescue |
| OpenCode `deepseek-v4.1-flash` | 864 | healthy paid rescue |
| Groq | 728 (+65 fallback) | healthy |
| Cloudflare | 674 | healthy when not limited |
| FreeLLMAPI | 506 | self-hosted, healthy |
| OpenRouter | 23 | free; paid credits exhausted |
| BytePlus | 305 | healthy paid rescue |
| GPU Share | 403 | `plugsky-gpu-27b` |

Why a healthy lane is not used for every request:

1. Class contract: no silent downgrade for frontier traffic.
2. Tool/JSON/vision support varies by model.
3. Free-tier retention and no-training terms are weaker than paid routes.
4. Free lanes 429 in waves; a healthy probe is not unlimited concurrency.

Lane state at the 09:49 guard run: **OpenCode ok, OpenRouter ok, BytePlus ok, Groq ok, FreeLLM ok**; Zen 429, BytePlus Coding quota until **2026-11-08**, Cloudflare 429, LLM7 429, Ollama 429, TokenHarbor 429, Gemini credit exhausted.

## 6. Model/engine counting (do not confuse 39 with 49/51)

- **51 rows** = **40 public-alias rows + 11 direct upstream-engine rows** in `model_health_status`.
- **39/39** is the public-alias health check subset, not the 51-row table.
- The 49/51 screenshot meant 40 aliases + 9 engines healthy. The **final browser check was 50/51 = 40/40 aliases + 10/11 engines**; the final suite snapshot was 49/51 (9/11); earlier in the same audit it read **47/51 = 39/40 aliases + 8/11 engines**. The count moves with the probe window.
- Rows observed non-OK at some point: `openai/gpt-oss-20b`, `meta/llama-3.2-11b-vision-instruct`, `google/diffusiongemma-26b-a4b-it`, `stepfun-ai/step-5-preview` (all non-primary) and `plugsky-parse` (document-parsing specialist, not chat).
- Admin now shows **Alias routes serving** and **engines** separately. Never present the 51-row union as 51 independent chat models.
- No new engine was added: 6 unregistered candidates probed, **4 × 404, 2 × timeout**. A broken catalogue row is not an improvement.

## 7. Memory/context

Rescue receives the **same body** (messages/tools/response_format), so task history continues. Verified by a two-turn recall test.

## 8. Verification checklist

- `php -l` on touched files.
- `php bin/health-check.php --no-notify` → 0 broken aliases.
- `php bin/rescue-lane-guard.php` → expected lanes healthy; check `storage/health/rescue-lanes.json`.
- Paid chat test (key #8112) blocking + streaming → 200.
- JSON-mode test → valid object, stays on NVIDIA primary.
- Large-output test with a forced cooling primary → 200 within the paid window, served model reported.
- Vision alias test → 200.
- 12K artifact/chat test → no >60s paid request.
- `php bin/quality/paid-watch.php --quiet` → 5m/15m 0 paid terminal errors.
- `php bin/error-watch.php --quiet` → labels separate paid/free/fallback; no unexplained alert.
- Full suite: `bash bin/skills/run-all.sh` → **ALL SKILLS PASS**, paid **100/100**.

## 9. Known issues / next

- **GPU supply:** 1 online / 10 approved. Stage ads until 3+ workers heartbeat; re-check auto-approval and payouts.
- **OpenRouter** credits exhausted ($25.20/$25); paid spillover disabled.
- **BytePlus Coding** quota resets **2026-11-08**.
- **Gemini** credit exhausted.
- Free lanes: TokenHarbor weekly, Ollama monthly, Cloudflare/LLM7/Zen free limits — capacity, not code.
- 3 raw engines + `plugsky-parse` are broken; all non-primary.
- Privacy v1.1 needs legal review; free-tier retention wording is intentionally softened.
- Windows GPU worker is implemented but not hardware-tested.
- Research skill live-browse/citation verification is the remaining Phase-4 item.

## 10. Key files

- `src/Application/Inference/ChatService.php` — cascade, fair-use, rescue, large-output skip, 45s OpenCode slice.
- `src/Application/Inference/ModelLadder.php` — alias classes, cascade, fallback groups.
- `src/Application/Inference/RescuePolicy.php` — profiles, budgets, `allows()`.
- `src/Application/Inference/FreeTierGuard.php` — concurrency default and Redis overrides.
- `src/Infrastructure/Http/Upstream/OpencodeClient.php` — multi-provider rescue and paid/free gate.
- `bin/health-check.php` — alias watchdog (threshold 2).
- `bin/rescue-lane-guard.php` — lane probes and durable gates.
- `bin/quality/paid-watch.php`, `bin/error-watch.php` — paid/free windows.
- `.env` — keys/caps.

## 11. Commands

```bash
# Alias health (39 public aliases)
php bin/health-check.php --no-notify

# Rescue lanes
php bin/rescue-lane-guard.php
jq . storage/health/rescue-lanes.json

# Paid windows
php bin/quality/paid-watch.php --quiet
jq .windows storage/logs/paid-watch/latest.json

# Full suite
bash bin/skills/run-all.sh

# Reload after PHP changes
systemctl reload php8.4-fpm

# Clear model cooldowns
redis-cli -p 6390 --scan --pattern 'plugsky:cooldown:*' \
  | xargs -r redis-cli -p 6390 del
```

Blackhole drill: set `NVIDIA_BASE_URL=http://127.0.0.1:9/v1`, reload, test, restore. Run only in a quiet window; it affects all traffic.

## 2026-11-06 — security and smoothness strategy update

- **Security gate:** `bin/skills/run-all.sh` now includes `skill-security.sh`. Do not claim “all skills pass” without 0 security FAIL. The user-journey skill must have 0 FAIL; WARN from provider capacity is not a code failure.
- **Paid acceptance:** while `PAID_LANES_ENABLED=false`, paid acceptance is **WARN/Paused** — its score/failed checks are printed but do not fail the code suite. Do not re-enable paid lanes without approved budget and positive provider balances.
- **429 ≠ ok:** track success rate and 429 rate separately. The 2026-11-06 window had 55 paid 5xx but 11,061 429s; the customer impact was load-shedding, not a green service.
- **Fan-out:** one Hobby request can race 2–3 engines; 4 concurrent Hobby requests can make 8–12 upstream calls. Per-user concurrency does not bound aggregate NVIDIA load. Add global admission control/queueing before raising legacy limits.
- **Browser/MCP:** `/api/playground/browser` and the root Playwright/sudo wrapper stay disabled. Any re-enable requires non-root, sandbox, per-user sessions, no file/private-IP access, and no tenant `evaluate`/`exec`.
- **Admin keys:** no active admin API keys after the incident; new keys need expiry/IP allowlist/least privilege. Admin TOTP 2FA is still pending.

## Notes

Listed by Plugsky. Skill text and behaviour belong to the upstream author.
If you redistribute it, keep the upstream license and attribution.
