{"slug": "cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability", "title": "Cosmicgpt – A GPT-in-space simulator to research SpaceX AI satellite viability", "summary": "A new open-source simulator called Cosmicgpt models how space radiation, including cosmic-ray bit flips and other faults, affects GPT inference on satellites. The tool injects single-event effects into model weights, activations, and KV cache across orbits like LEO and SAA, generating reports on failure modes and output degradation. It aims to help research the viability of running AI models on SpaceX satellites.", "body_md": "Simulate what happens to GPT inference under space conditions — cosmic-ray bit flips and other radiation-induced faults corrupting a model's weights, activations, KV cache, and output.\n\nSee what radiation does to an AI model's output: a [single-run report](https://davedx.github.io/cosmicgpt/report.html)\nand an [environment comparison](https://davedx.github.io/cosmicgpt/comparison.html).\n\nSee [DESIGN.md](/davedx/cosmicgpt/blob/main/DESIGN.md) for goals and the conditions we model, and\n[ARCHITECTURE.md](/davedx/cosmicgpt/blob/main/ARCHITECTURE.md) for the technical design.\n\nThe end-to-end loop covers the full **Single-Event-Effect taxonomy** across three\ncorruptible **regions**, with faults either hand-specified or derived from a physical\n**radiation environment**: build a seeded [nanoGPT](/davedx/cosmicgpt/blob/main/src/cosmicgpt/model/nanogpt.py)\n(with a real KV cache), generate a clean baseline, get faults (manual or from the\n[flux scheduler](/davedx/cosmicgpt/blob/main/src/cosmicgpt/environment/scheduler.py)), inject them (weight mutations,\nactivation forward-hooks, KV-cache mutations), regenerate with the same sampling seed,\nand diff.\n\nFault kinds (`--kind`\n\n): **SEU** (single bit flip), **MBU** (multi-bit upset),\n**STUCK_AT** (cell pinned 0/1), **SEL** (latch-up — a whole tensor zeroed),\n**SET** (transient activation glitch), **SEFI** (NaN/garbage cascade).\nRegions (`--region`\n\n): **weight**, **activation** (incl. `lm_head`\n\n→ logits), **kv_cache**.\nEnvironments (`--orbit`\n\n): **LEO, SAA, POLAR, GEO, INTERPLANETARY, SOLAR_STORM**, with an\noptional solar-flare **burst window** raising λ(t) mid-inference.\n\nEvery run also reports a **failure mode** (silent_correct / subtle_wrong / repetition /\ngarbage / nan_garbage / crash), **time-to-failure**, and **mean KL divergence** of the\noutput distribution, and can emit a per-step [ RunTrace](/davedx/cosmicgpt/blob/main/src/cosmicgpt/eval/trace.py)\nJSON (the data the upcoming visualizations consume).\n\n```\n# physically-derived faults from an orbit (flux scaled so a short run shows effects)\ncosmicgpt run --orbit SAA --flux-mult 1e4 --tokens 120\n# a mission with a mid-inference solar flare\ncosmicgpt run scenarios/mission_solar_storm.yaml\n# write a self-contained HTML report (token diff + degradation timeline + raster)\ncosmicgpt run --orbit SOLAR_STORM --flux-mult 1e4 --report report.html\n# regenerate a report from a saved trace — no re-inference\ncosmicgpt report runs/storm/trace.json -o report.html\n# compare conditions side by side (View C)\ncosmicgpt compare --orbits LEO,SAA,SOLAR_STORM -o comparison.html\n```\n\nReports are **fully self-contained** (inline CSS + inline SVG, no external assets, no\nmatplotlib) so they're emailable and archivable.\n\n```\npython -m venv .venv && source .venv/bin/activate\npip install -e \".[dev]\"\n\n# run the smallest scenario (SEU)\ncosmicgpt run scenarios/walking_skeleton.yaml\n\n# drive the taxonomy directly\ncosmicgpt run --kind SEFI --n-flips 1 --tokens 120 --fault-seed 3\ncosmicgpt run --kind SEL  --n-flips 8 --tokens 100\n\n# verify the bit-flip foundation + injection mechanisms\npytest\n```\n\n- Single faults on\n**low-impact sites**(biases, low mantissa bits) are routinely*masked*— realistic: most cosmic-ray hits do nothing visible. **Exponent/sign** flips and**SEL** are far more destructive than mantissa flips.**SET**(transient activation glitch) is gentle: without persistence it affects one step, and only if it lands on the emitted position.- The model now has a real\n**KV cache**(`--region kv_cache`\n\n): a strike there is mutated once but*persists*, because every later token re-reads the corrupted entry through attention. Region is independent of fault kind —`--region weight|activation|kv_cache`\n\n. **A single short inference in LEO is essentially fault-free** at realistic upset rates; meaningful corruption needs the SAA, a solar storm, or long exposure. With a flare**burst window**, divergence visibly begins right when the flux spikes.\n\nThe model is a small, seeded, **randomly-initialized** char-level GPT, so the baseline\ntext is gibberish — but that's fine for the skeleton: the point is to demonstrate the\nfault-injection loop and that flips (especially in the float **exponent**) measurably\ncorrupt the output. Train a coherent model later via `scripts/train_tiny.py`\n\n(roadmap).\n\n```\nsrc/cosmicgpt/\n  model/        nanogpt.py (+KV cache), adapter.py, sites.py   # model + fault registry\n  faults/       bitops.py, types.py, injector.py               # taxonomy + injection\n  environment/  flux.py, presets.py, scheduler.py              # scaled-physical flux\n  eval/         runner, metrics, classify, trace               # loop + metrics + RunTrace\n  viz/          svg, diffview, timeline, report                # inline-SVG/HTML reports\n  config.py, cli.py\nscenarios/      walking_skeleton.yaml, sefi_cascade.yaml, mission_solar_storm.yaml\ntests/          test_bitops, test_injection, test_kvcache, test_scheduler, test_eval, test_viz\n```\n\nSee [ARCHITECTURE.md §11](/davedx/cosmicgpt/blob/main/ARCHITECTURE.md). Next (step 6): mitigation wrappers\n(ECC / TMR voting / scrubbing / NaN guards) with cost-benefit experiments, then a\npluggable larger-GPT backend to test whether findings generalize.", "url": "https://wpnews.pro/news/cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability", "canonical_source": "https://github.com/davedx/cosmicgpt", "published_at": "2026-06-17 15:09:47+00:00", "updated_at": "2026-06-17 15:22:49.068731+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-research", "ai-safety", "ai-infrastructure"], "entities": ["Cosmicgpt", "SpaceX", "nanoGPT", "LEO", "SAA", "GEO", "SOLAR_STORM", "INTERPLANETARY"], "alternates": {"html": "https://wpnews.pro/news/cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability", "markdown": "https://wpnews.pro/news/cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability.md", "text": "https://wpnews.pro/news/cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability.txt", "jsonld": "https://wpnews.pro/news/cosmicgpt-a-gpt-in-space-simulator-to-research-spacex-ai-satellite-viability.jsonld"}}