Cortheon
The lightweight runtime enables small-scale local models to achieve performance close to that of state-of-the-art models by executing a verified parallel consensus mechanism.
Introduction
Improves frozen local models on official competition math (MathArena/aime_2025, 30/30) to 25/30 (83.3%) on 3-bit GLM-5.3-Flash-TFQ3 (+30.0 pts vs Vanilla 16/30, paired +10 / −1, exact McNemar p = 0.0117*, replicated identically on all 30/30 problems; +20.0 pts over compute-matched Maj@8 at *faster* wall-clock 107.8s vs 110.0s and *fewer* calls 7.67 vs 8.00; pooled 3-model baseline 51/90 → 72/90, +24 / −3, p = 4.92e-05), and on official oracle-free competitive coding (LiveCodeBench v6 Hard, 32 paired AtCoder ABC Hard problems, GLM-5.3-Flash-TFQ3) by +34.4 points (12/32 → 23/32 = 71.9%) — reaching ZERO REGRESSIONS vs Vanilla (+11 / −0, exact McNemar p = 0.00098***) with CodeForge v8's sound brute-force counterexample fuzzer (8.28 calls) and matching 23/32 at 6.19 avg calls (+12 / −1, p = 0.0034**, +5 / −0 over best4_sample, +7 / −0 over CodeForge v6) with CodeForge v7. Smaller BigCodeBench-Hard slices (10–30 tasks) remain positive (+3.3 to +10.0 pts) but statistically underpowered per run (p = 0.625–1.0).
Zero weight updates. Zero cloud APIs. Works with TensorFold, oMLX, Ollama, llama.cpp (including native reasoning_budget_tokens + loopback proxy bypass — PRs #12 & #13 by @DonnieFi), vLLM, SGLang, mlx-lm, and LM Studio (including automatic reasoning-model headroom, enable_thinking=False routing, scratchpad commit recovery, and non-dict /v1/models capabilities handling — PR #2 by @SelfHostedSI, PR #11 by @ivanfioravanti), with an OS-level sandbox (sandbox-exec on macOS / bwrap on Linux) enabled by default.
Quick Start (60 Seconds)
# 1. Install Cortheon
git clone https://github.com/ashhart/Cortheon.git && cd Cortheon
uv venv .venv && uv pip install --python .venv/bin/python -e .
# 2. Verify your local backend, OS sandbox, and solvers in 2 seconds
.venv/bin/cortheon doctor --url http://127.0.0.1:8080/v1
# 3. Install /cortheon commands & register the native MCP server across your coding harnesses
.venv/bin/cortheon install-commands --harness all
.venv/bin/cortheon install-mcp --harness all --url http://127.0.0.1:8080/v1
# 4. Start the universal proxy + Live Web Cockpit at http://127.0.0.1:18652/ui
.venv/bin/cortheon proxy --upstream http://127.0.0.1:8080/v1 --port 18652 --streams 4 --record-flywheel
Then use /cortheon inside your coding harness
Open OMP, Pi, OpenCode, Claude Code, or Cursor and type:
/cortheon 7 servers sit in a ring (0..6). A token starts at server 1 (already visited) and moves +1 mod 7 w.p. 2/3 or -1 mod 7 w.p. 1/3, except at server 0 it teleports uniformly to one of 0..6. Find the exact rational expected ticks until all 7 servers are visited.
Or run a live side-by-side Vanilla vs Cortheon race on your own model:
.venv/bin/cortheon duel --url http://127.0.0.1:8080/v1 --preset ring
.venv/bin/cortheon showdown --url http://127.0.0.1:8080/v1
- Full harness configs (OMP, Pi, OpenCode, Claude Code, Cursor, TensorFold Native,
tmuxcockpit):GETTING_STARTED.md - 8 copy-paste challenge prompts with mechanically verified ground truths:
CHALLENGE_PROMPTS.md - Security & OS sandbox threat model:
SECURITY.md
Measured Results (Reproducible, Paired Statistics & Compute-Matched Ablation)
Reproduce from a fresh clone: runpython -m bench.fetch_datasetsto download official datasets intobench/datasets/, thenpython -m bench.stats --dir resultsto recompute every confidence interval and exact McNemar p-value directly from the committed per-problem JSONs inresults/. SeeBENCHMARKS.mdfor full details.
1. Compute-Matched 6-Arm Ablation on Full Official MathArena/aime_2025 (30/30, GLM-5.3-Flash-TFQ3)
To isolate whether gains come from extra compute (Maj@4 / Maj@8), from Python execution alone (pal_b1), from parallel execution consensus (cortheon_w1), or from Wave-2 falsification (cortheon_full), all 6 arms were run cleanly on all 30 official AIME 2025 problems (0 timeouts, 8/8 streams completed on every Maj@8 problem) with exact per-problem token, call, and latency logging (results/official_aime2025_ablation_glm53.json):
| Arm | Accuracy k/30 [95% Wilson CI] | Avg Wall | Avg Calls | Avg Total Tok | Paired vs maj4_prose | Paired vs maj8_prose |
|---|---|---|---|---|---|---|
vanilla_b1 *(single prose call)* | 16/30 (53.3%) [36.1, 69.8] | 45.4s | 1.00 | 2,781 | +0.0 pts (p=1.00) | −10.0 pts (p=0.453) |
maj4_prose *(compute-matched B=4 prose voting)* | 16/30 (53.3%) [36.1, 69.8] | 75.2s | 4.00 | 6,504 | Baseline | −10.0 pts (p=0.375) |
maj8_prose *(compute-matched B=8 prose voting)* | 19/30 (63.3%) [45.5, 78.1] | 110.0s | 8.00 | 13,314 | +10.0 pts (p=0.375) | Baseline |
pal_b1 *(single Python PAL script, effort=low)* | 8/30 (26.7%) [14.2, 44.5] | 19.4s | 1.00 | 1,425 | −26.7 pts (p=0.0215*) | −36.7 pts (p=0.0034**) |
cortheon_w1 *(B=4 PAL early-abort, no Wave 2)* | 19/30 (63.3%) [45.5, 78.1] | 63.4s (0.58× Maj@8) | 4.07 | 6,547 (0.49× Maj@8) | +10.0 pts (+5/−2, p=0.453) | +0.0 pts (+4/−4, p=1.00) |
cortheon_full *(Wave 1 + Wave 2, effort=low)* | 21/30 (70.0%) [52.1, 83.3] | 147.9s | 6.23 | 14,396 (1.08× Maj@8) | +16.7 pts (+8/−3, p=0.227) | +6.7 pts (+7/−5, p=0.774) |
cortheon_full *(v2 default tb=700/950, prior 30/30)* | 24/30 (80.0%) [62.7, 90.5] | 175.8s | 7.20 | 13,700 (1.03× Maj@8) | +26.7 pts (+11/−3, p=0.057) | +16.7 pts (+7/−2, p=0.180) |
reasonforge_v5 *(Fast Pair + Executable TIR Self-Repair)* | 25/30 (83.3%) [66.4, 92.7] | 107.8s (1.63× faster than v2!) | 7.67 (< Maj@8) | 15,721 (1.18× Maj@8) | +30.0 pts (+10/−1, p=0.0117*) | +20.0 pts (+8/−2, p=0.109) |
What the ablation proves honestly:
- Plain
Maj@4prose voting added0.0points (16/30 → 16/30) at2.34×tokens. Scaling toMaj@8(13,314tok,110.0s,8.00calls) reached19/30but still suffered severe correlated wrong-answer collapses (7/8voted wrong onAIME25_27andAIME25_29,6/8onAIME25_14,5/8onAIME25_18). - A Python sandbox alone (
pal_b1) performed significantly *worse* than Vanilla andMaj@8(8/30 = 26.7%,p = 0.039vs Vanilla,p = 0.0034vsMaj@8) because single-shot model scripts frequently crash or time out on Olympiad problems. - Parallel execution consensus (
cortheon_w1) matchedMaj@8(19/30) at HALF the tokens (6,547vs13,314=0.49×) and1.74×faster wall time (63.4svs110.0s), while beating same-tokenMaj@4(6,504tok) by+10.0points. ReasonForge v5(Executable TIR Self-Repair + Unanchored 50-digitmpmath/numpyWave 2/3,results/official_aime2025_reasonforge_v5_glm53.json) hit a new all-time local 3-bit record of25/30 (83.3%)while cutting average wall time1.63×vsv2(175.8s → 107.8s): beatingvanilla_b1andMaj@4by+30.0 pts(+10/−1,p = 0.0117*), beatingcortheon_w1with zero regressions (+6/−0,p = 0.0313*), beatingMaj@8by+20.0 pts(+8/−2) at *faster* wall time (107.8svs110.0s) and *fewer* LLM calls (7.67vs8.00), and solvingAIME25_10(81),AIME25_14(60), andAIME25_25(907) wherev2failed.- Live 30/30
SpecVerify(inkling-2-mini18.8 GiB drafter →glm-5.3-flash-tfq3verifier,results/official_aime2025_spec_verify_inkling_glm53.json): Reached20/30 (66.7%)[48.8, 80.8]— bypassing the big verifier completely on9/30 (30.0%)problems at9/9 (100.0%)drafter precision (0false accepts), cutting big-model calls42.9%vsMaj@8(4.57vs8.00,11,879vs13,314big tok) and26.7%vscortheon_full(effort=low) (17.5%fewer big tok; paired+2/−3,p=1.00). *(Wall time averaged253.4sbecause the BF16 looped drafter ran at ~10 tok/s; quantized 50–100+ tok/s drafters or metered cloud verifiers get the full latency/cost win.)*
Where Verification Works vs. Where It Doesn't (Honest Boundary): Cortheon's gains do not require a benchmark oracle — on AIME 2025 it never sees an answer key and synthesizes its own Python/SymPy/Z3 checkers. However, it *does* require a problem with executable or formal invariants. On a 12-task internal ablation of pure open-ended engineering/security prose advice (GLM-5.3-Flash-TFQ3),Maj@4self-consistency (11/12) outperformed multi-stage adversarial prose falsification (9/12,vanilla_b110/12). We reverted that prose-falsification experiment rather than shipping a regression — use Cortheon where execution can genuinely falsify wrong hypotheses, not for subjective prose generation.
2. Compute-Matched CodeForge v7 & v8 Ablation on Official LiveCodeBench v6 Hard (32/32 Paired ABC Hard, GLM-5.3-Flash-TFQ3)
Every arm ran oracle-free on the exact same 32 official AtCoder ABC Hard problems (abc387_f–abc398_d, ~42 hidden judge tests each, 0 hidden tests ever seen at solve time) with full per-problem token, call, and latency logging (results/official_lcb_v6_hard_ablation_glm53.json, results/official_lcb_v6_hard_codeforge_v8_glm53.json):
| Arm | Accuracy k/32 [95% Wilson CI] | Avg Wall | Avg Calls | Avg Total Tok | Paired vs vanilla | Paired vs codeforge_v7 |
|---|---|---|---|---|---|---|
vanilla *(single call, tb=1500)* | 12/32 (37.5%) [22.9, 54.8] | 74.9s | 1.00 | 5,770 | Baseline | −34.4 pts (+12/−1, p=0.0034**) |
codeforge_v6 *(prior architecture)* | 16/32 (50.0%) [33.6, 66.4] | 272.4s | 17.00 | 41,936 | +12.5 pts (+7/−3, p=0.344) | −21.9 pts (+7/−0, p=0.0156*) |
best4_sample *(compute-matched B=4 public-sample)* | 18/32 (56.2%) [39.3, 71.8] | 112.4s | 3.81 | 11,398 | +18.8 pts (+10/−4, p=0.180) | −15.6 pts (+5/−0, p=0.0625) |
codeforge_v7 *(sample-first 4-slot + early-abort + TLE rank)* | 23/32 (71.9%) [54.6, 84.4] | 165.3s | 6.19 | 18,563 | +34.4 pts (+12/−1, p=0.0034**) | Speed / call-efficiency leader |
codeforge_v8 *(+ inline TIR repair + sound brute-force fuzzer)* | 23/32 (71.9%) [54.6, 84.4] | 244.9s | 8.28 | 25,158 | +34.4 pts (+11/−0, p=0.00098***) | +0.0 pts (+1/−1, p=1.00) |
- Why
CodeForge v7&v8flipped the ablation: On this exact 32-problem set, leanbest4_sample(18/32,3.81calls) originally beatCodeForge v6(16/32,17.00calls). Dedicating all 4 Wave-1 slots to diverse implementations whenever verbatim I/O samples exist, executing viaasyncio.wait(FIRST_COMPLETED)with early-abort, and ranking fastO(N log N)runtime tiers ahead of shorterO(N^2)TLE candidates jumped pass rate by+21.9 ptsover v6 (+7/−0,p=0.0156*) while cutting calls2.75×(17.00 → 6.19) and tokens2.26×(41,936 → 18,563).CodeForge v8adds inline Wave-1 TIR sample-diff self-repair and a sample-gated sound-oracle brute-force counterexample fuzzer, wiping outv7's lone regression (abc394_f→ AC 43/43) for zero regressions vs Vanilla (+11/−0,p = 0.00098***) and rescuing hidden-test bugs live onabc393_eandabc398_d(8.28avg calls).
3. Official External Benchmarks Across 3 Frozen Local Model Families
Computed directly from results/ via python -m bench.stats --dir results (enable_memory=False, force_mode=None):