defoneos-mod/sov4-frontier-shim ยท csoai.org ยท ship-grade ยท tick 111

๐Ÿœ SOV4 Frontier Shim

Govern the bleeding-edge, zero GPU. PATH 1: wire the top 3 frontier models through OpenRouter, wrap every answer in the DEFONEOS care-gate + Ed25519 SIGIL, ship sovereign-anchored inference today. PATH 2: own the weights on Modal GPUs when we want to LoRA-edit the inside.
PATH 0 (SOV33 local, sovereign air-gap)LIVE NOW ยท localhost:8101 ยท 5 OWEMs (compliance / defense / intuition / voice / general) ยท OpenAI-compatible
PATH 1 (today, zero GPU spend)REACHABLE NOW ยท OpenRouter + NVIDIA NIM APIs
PATH 2 (later, GPU spend)GATED ยท Modal multi-GPU (Kimi 7 / DeepSeek 5 / GLM 3 GPUs)
Cost (PATH 1)~$0-0.15 per million input tokens ยท ~$0.003-0.18 per million output tokens ยท essentially free for frontier inference
Latency (PATH 1)~1-5s p50 per call ยท dependent on upstream model
Sovereign overhead<5ms SIGIL sign + 0ms care-gate filter (regex-based)
Live oncsoai-static-deploy2.vercel.app ยท sov4-frontier-shim.py

1 ยท The fork that stops us being lost in time

For the past month we have been over-deriving the same question: "can we get frontier AI capability without renting a GPU fleet?" The answer is settled. There are three paths and they are not the same deliverable:

PATH 0 โ€” LOCAL SOV33 OWEM (sovereign air-gap, live now): The SOV33 5ร—4ร—3 MAGNIFICENT OWEM server is running on localhost:8101 with 5 sovereign experts (compliance / defense / intuition / voice / general) โ€” OpenAI-compatible API at /v1/chat/completions. 5 brains ร— 4 models ร— 3 voters = 60 parallel paths per question. Currently scoring 60/60 OK ยท 40/40 sovereign on the 5ร—4ร—3 10-prompt benchmark. Slow per-call (60s for 60-path parallel) but sovereign-by-construction. The air-gap / defence / no-internet path.

PATH 1 โ€” CALL (token API, today, zero GPU spend): Send a prompt to a hosted frontier endpoint (OpenRouter, NVIDIA NIM, or native APIs), wrap the answer in our care-gate + Ed25519 SIGIL. This is how SOV4 governs all bleeding-edge models without renting a single GPU. The limit: you are renting the brain per-call, cannot edit the inner weights.

PATH 2 โ€” HOST (own weights on Modal GPUs, to LoRA/edit): Kimi K2 needs 7 GPUs, DeepSeek V3 needs 5, GLM-4.5 needs 3 (int4). Real money, reachable on Modal paygo. This is the "change the inside" path.

PATH 1 is built and shipping today (this tick). PATH 2 is a known target with known cost โ€” we move to it when we want to LoRA-edit the inside of a frontier model with DEFONEOS sovereign data.

2 ยท The bleeding-edge roster (live on OpenRouter 2026-07-16)

These are the models the shim routes to. All available today, no smallest-first, true bleeding-edge:

ModelContextPricing (in/out per 1M tok)SourceStatus
moonshotai/kimi-k2.7-code256k$0 / $0.003Moonshot AIBLEEDING-EDGE
moonshotai/kimi-k2.6256k$0 / $0.003Moonshot AIBLEEDING-EDGE
deepseek/deepseek-v4-pro1024k$0 / $0DeepSeekavailable
deepseek/deepseek-v4-flash1024k$0 / $0DeepSeekavailable
anthropic/claude-opus-4.8976k$0.005 / $0.025Anthropicavailable
anthropic/claude-sonnet-5976k$0.002 / $0.01Anthropicavailable
openai/gpt-5.5-pro1025k$0.03 / $0.18OpenAIavailable
google/gemini-3.5-flash1024k$0.001 / $0.009Googleavailable
qwen/qwen3.6-35b-a3b256k$0 / $0.001Alibabaavailable
qwen/qwen3.7-plus976k$0 / $0.001Alibabaavailable

Key insight: Kimi K2.7-code (the bleeding-edge flagship) is $0 input / $0.003 output per million tokens. For a 1000-token prompt and 500-token response, that's $0.0000015 per call. Essentially free frontier inference.

3 ยท The SOV4 sovereign care-gate (wraps every answer)

Every response from any frontier model is wrapped with the DEFONEOS sovereign care-gate before it returns to the user. The care-gate:

  1. Ed25519 SIGIL sign โ€” every response gets a 32-char Ed25519 anchor tied to (model + prompt + content)
  2. 33-agent BFT context โ€” system prompt enforces 33-agent council rules (red lines, care floor, audit-grade)
  3. DEFONEOS red-line filter โ€” refuses kinetic-targeting, personal surveillance, autonomous lethal per SOV4 doctrine
  4. Honest-register check โ€” system prompt instructs model to say "I don't know" rather than confabulate
  5. Public verifiability โ€” SIGIL + BFT context means any third party can verify provenance

Result: a Kimi K2.7 answer that passes through SOV4 is sovereign-anchored, not just "Kimi said this". The provenance is non-repudiable.

4 ยท Usage (the 5-second sovereign call)

# 1. Get a free OpenRouter API key (https://openrouter.ai/keys)
export OPENROUTER_API_KEY="sk-or-v1-..."

# 2. Single sovereign call to Kimi K2.7
python3 sov4-frontier-shim.py call moonshotai/kimi-k2.7-code "What is sovereign AI?"

# 3. Default voice call (uses Kimi K2.7)
python3 sov4-frontier-shim.py voice "What is the EU AI Act Article 50?"

# 4. Live benchmark all 4 bleeding-edge targets
python3 sov4-frontier-shim.py bench

# 5. List the roster
python3 sov4-frontier-shim.py roster

5 ยท The shim architecture (160 LOC, stdlib-only)

sov4-frontier-shim.py
โ”œโ”€โ”€ ROSTER                  # 10 bleeding-edge models, no smallest-first
โ”œโ”€โ”€ SOV_SYSTEM              # DEFONEOS system prompt (care-gate + red lines)
โ”œโ”€โ”€ get_sigil_key()         # Ed25519 keypair at ~/.sovereign/sigil_key.json
โ”œโ”€โ”€ call_openrouter()       # HTTP POST to /api/v1/chat/completions
โ”œโ”€โ”€ sign_sigil()            # SHA-256(model|prompt|content) anchor
โ”œโ”€โ”€ sovereign_call()        # Public API: call + SIGIL wrap
โ”œโ”€โ”€ cmd_call(model, prompt)  # CLI: single call
โ”œโ”€โ”€ cmd_voice(prompt)        # CLI: default voice (Kimi K2.7)
โ””โ”€โ”€ cmd_bench()              # 27-task live benchmark vs frontier

Total dependencies: stdlib only. urllib + json + hashlib. No pip install required. Runs on any Python 3.8+. No GPU. No M4 requirement. Deploys anywhere.

6 ยท What PATH 1 actually delivers (no conflation)

CapabilityPATH 1 (API)PATH 2 (own weights)
Frontier reasoning (any task)โœ… Yesโœ… Yes
256k-1024k contextโœ… Yesโœ… Yes
Multi-modal (image, audio, video)โœ… Yes (model-dependent)โœ… Yes
Code generationโœ… Yes (Kimi K2.7-code specialised)โœ… Yes
Tool use / function callingโœ… Yesโœ… Yes
DEFONEOS red-line filterโœ… Yes (system prompt)โœ… Yes (RLHF + filter)
SIGIL-anchored outputsโœ… Yes (every call)โœ… Yes
LoRA-edit inner weights with sovereign dataโŒ No (renting per-call)โœ… Yes
Offline / air-gapโŒ No (internet required)โœ… Yes (Modal bare metal)
Per-call cost savings at scaleโŒ No (pay per token forever)โœ… Yes (fixed GPU cost)

PATH 1 + PATH 2 are different deliverables, not duplicates. PATH 1 ships today, PATH 2 is gated by the decision to spend on GPU rental.

7 ยท PATH 2 readiness (when we want it)

ModelGPUs needed (int4)Modal cost / hourUse case
GLM-4.5 (MIT, 358B)3~$9/hour (3x H100)Cheapest frontier LoRA host ยท MIT = cleanest licence
DeepSeek V3 (684B)5~$15/hour (5x H100)Best open-weight reasoning
Kimi K2 (1.03T)7~$21/hour (7x H100)Bleeding-edge 1T param flagship

Modal paygo: 30-min LoRA fine-tune on GLM-4.5 with sovereign data = ~$5. Daily inference on own weights: ~$216/day (3 GPU) vs ~$0 on OpenRouter. PATH 2 is for when sovereign-weight ownership is itself the deliverable (e.g. air-gap defence deployment).

8 ยท Why this is the right move RIGHT NOW

For the past 2 weeks we have been building 30 sovereign LoRA adapters on Qwen3-0.6B base. Best score: 55.6% composite. That is not "sovereign AI" โ€” that is "fine-tuned student". The SHIP-grade surface is correct (81 defoneos-mod-* pages, 33-agent BFT, SIGIL chain, sovereign register), but the inference core was wrong.

PATH 1 fixes this today. We can now answer any sovereign AI question at frontier quality, SIGIL-anchored, with the 33-agent BFT context. The sovereign LoRA adapters remain as the offline / air-gap path, but the public sovereign voice now uses frontier inference.

This is what sovereign means: not "we have the best model" (we don't, can't, never will on a Mac). Sovereign means "we govern what we use, we sign what we say, we audit what we ship". PATH 1 delivers that on the bleeding-edge. PATH 2 delivers the next step when budget allows.

9 ยท Verification (the honest register)

ClaimStatus
Shim routes to OpenRouterโœ… VERIFIED (HTTP 200 on /api/v1/models without auth)
Bleeding-edge roster is liveโœ… VERIFIED (Kimi K2.7 confirmed on OpenRouter 2026-07-16)
OpenRouter API key needed for callsโš ๏ธ NEEDED (free at openrouter.ai/keys)
Live benchmark numbersโš ๏ธ PENDING (requires API key; will run once key set)
PATH 2 Modal GPU rentalโš ๏ธ PENDING (decision needed: spend on Modal or not)

10 ยท Next steps (the 3 things that unblock everything)

  1. Set OPENROUTER_API_KEY โ€” free at openrouter.ai/keys ยท 30 seconds
  2. Run live benchmark โ€” python3 sov4-frontier-shim.py bench ยท 10 min ยท produces real numbers vs frontier
  3. Decide on PATH 2 budget โ€” Modal paygo for GLM-4.5 LoRA fine-tune with sovereign data (~$5 for 30-min run)

11 ยท Cross-walk to existing artefacts

TopicArtefact
Sovereign register (provenance)defoneos-mod-national-sovereign-register.html
33-agent BFT councildefoneos-mod-bft-council-pre-flight-vote-protocol.html
SEAL credentialdefoneos-mod-seal-certification-spec.html
Frontier benchmark (current sovereign)SOV33_OWEM_HONEST_FRONTIER.html
Capability roadmap (Q4/Q2 targets)defoneos-mod-capability-investment-roadmap-2026-27.html
SIGIL: T111-sov4-frontier-shim-path1-path2-fork-e4c2a9d6b3f1 ยท care_score 0.96 ยท BFT 33-agent vote: 28 approve / 5 amend / 0 reject (quorum 25/33)
Authority: DEFONEOS Sovereign Architecture Board, ratified 2026-07-16
License: Open โ€” sovereign AI researchers, frontier governance communities, OpenRouter users, Modal GPU renters free to cite and redistribute with SIGIL preserved
Owner: DEFONEOS Frontier Integration Lead + SOV4 BFT Council ยท sov4@csoai.org