A Kerbal Space Program mod that provides an in-game AI chat assistant. Works with OpenAI, Anthropic, Google Gemini, OpenRouter, DeepSeek, and any other OpenAI- or Anthropic-compatible LLM API. The provider is auto-detected from your Base URL.
ScreenRecord.mp4
- Terminal-style dark-themed chat interface
- LLM integration with streaming responses (token-by-token display)
- Game-aware tools — the AI can query live game data via function calling:
- Vessel part composition (names, counts, masses, resources)
- Vessel delta-v budget per stage (delta-v, TWR, ISP, burn time)
- Vessel orbit parameters (Ap/Pe, inclination, eccentricity, period)
- Vessel flight status (altitude, speed, G-force, electric charge, CommNet)
- Part details (description, cost, mass, category, resource capacities)
- Celestial body parameters (gravity, atmosphere, SOI, orbital data)
- Atmosphere profiles (pressure, temperature, density at multiple altitudes)
- Active and offered contracts (objectives, rewards, completion state)
- Available parts search (filtered by tech tree progress in Career/Science mode)
- Context-aware skills — automatically injects relevant domain knowledge into the AI based on your question:
- Orbital Mechanics: Hohmann transfers, gravity turns, inclination changes, rendezvous, aerobraking
- Rocket Design: staging, TWR guidelines, Tsiolkovsky equation, aerodynamic stability, engine selection
- Delta-v Budget: complete KSP delta-v map data, mission budgets, safety margins
- Contracts Guide: contract types (science gathering, part testing, rescue, satellite, survey, tourism), parameter requirements, completion tips
- Basic Game Control: keyboard controls, SAS/RCS, time warp, camera, EVA, editor shortcuts
- Settings panel to configure API endpoint, API key, and model
- Multi-provider support — Kerpilot auto-detects the protocol from the Base URL:
- OpenAI / OpenRouter / DeepSeek / Gemini (OpenAI endpoint) / local models — any OpenAI Chat Completions–compatible API
- Anthropic (native) —
api.anthropic.comand Anthropic-compatible proxies (e.g.*/anthropicpaths)
- Toolbar button and
Ctrl+Kkeyboard shortcut to toggle the window Ctrl+Cto interrupt an in-progress AI response- Press
Uparrow in an empty input field to recall your last message - Type
clearin the chat to reset conversation history - Draggable window
- Input lock prevents chat keystrokes from triggering vessel controls
- Available in Space Center, Flight, Map View, and VAB/SPH scenes (vessel tools work in both flight and editor)
Kerpilot is an AI chat assistant that provides information and guidance — it does not directly control the game. The following features are out of scope:
- Rocket autopilot / flight control — Kerpilot cannot execute maneuvers, hold attitude, or fly your vessel. For automated flight control, use MechJeb2.
- Rocket assembly — Kerpilot cannot place or modify parts in the VAB/SPH. It can advise on rocket design, but you build it yourself.
- Contract activation — Kerpilot cannot accept or decline contracts. It can show you available contracts and explain their requirements.
-
Clone the repository:
git clone https://github.com/FishwithCat/Kerpilot.git cd Kerpilot -
If your KSP is not at the default Steam location, set the
KSPROOTenvironment variable or pass-p:KSPRoot=...:export KSPROOT="/path/to/Kerbal Space Program"
-
Build:
dotnet build -c Release
The compiled DLL is automatically copied to
GameData/Kerpilot/Plugins/.
From release zip: Download the latest Kerpilot-vX.Y.Z.zip from Releases, extract it into your KSP GameData/ directory so the structure is GameData/Kerpilot/Plugins/Kerpilot.dll and GameData/Kerpilot/Skills/*.md.
For development: Symlink the GameData/Kerpilot folder into your KSP GameData directory:
ln -s "$(pwd)/GameData/Kerpilot" "/path/to/Kerbal Space Program/GameData/Kerpilot"Build a distributable zip for release:
dotnet msbuild Kerpilot.csproj -t:Package -p:Configuration=ReleaseOutput: dist/Kerpilot-vX.Y.Z.zip — users extract this into their KSP GameData/ folder.
- Launch KSP and enter Space Center or Flight
- Click the K toolbar button or press Ctrl+K to open the chat window
- Click the gear icon (⚙) in the header to open Settings
- Enter your API endpoint, API key, and model name (see provider examples below)
- Click Save, then Back to return to chat
- Type a message and press Send or Enter — the AI will respond with streamed tokens
| Provider | Base URL | Example model |
|---|---|---|
| OpenAI | https://api.openai.com/v1 |
gpt-4o, gpt-4 |
| Anthropic | https://api.anthropic.com |
claude-3-5-sonnet-latest, claude-3-7-sonnet-latest |
| OpenRouter | https://openrouter.ai/api/v1 |
anthropic/claude-3.5-sonnet, google/gemini-2.5-pro |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/openai |
gemini-2.5-pro, gemini-2.5-flash |
| DeepSeek (OpenAI) | https://api.deepseek.com/v1 |
deepseek-chat, deepseek-reasoner |
| DeepSeek (Anthropic) | https://api.deepseek.com/anthropic |
deepseek-chat |
The provider protocol is auto-detected: any URL containing api.anthropic.com or ending in /anthropic uses the Anthropic Messages API (x-api-key header, /v1/messages endpoint, native tool blocks). Everything else uses the OpenAI Chat Completions API.
The project includes a test suite that verifies tool availability, dispatch routing, JSON parsing, request body construction, and skill selection — all without requiring a running KSP instance.
Run the tests:
dotnet test tests/Kerpilot.Tests.csproj -c ReleaseThe project uses GitHub Actions for continuous integration and releases.
| Workflow | Trigger | What it does |
|---|---|---|
| CI | Push to main / PRs |
Build + run tests |
| Release | Push v* tag |
Build, package zip, create GitHub Release |
KSP reference assemblies are committed in libs/managed/ so CI works out of the box. To update them (e.g. after a KSP version change), run ./scripts/create-stubs.sh and commit the updated DLLs.
Creating a release:
git tag v0.1.0
git push origin v0.1.0Tags containing - (e.g. v0.2.0-beta) are marked as pre-releases.
- Fork the repository and create a feature branch from
main - Make sure your KSP install is set up for building (see Build)
- Make your changes and verify the build passes:
dotnet build -c Release
- Run the test suite:
dotnet test tests/Kerpilot.Tests.csproj -c Release - Test in-game with KSP 1.12.5
- Open a pull request against
main— CI will automatically build and run tests
- All UI is built programmatically with uGUI — no asset bundles or IMGUI
- Follow the terminal-style interface pattern (single rich-text log,
<color>tags,FormatLine()) - New tools go in
src/Tools/— add a JSON schema inToolDefinitions.csand implement inGameDataTools.cs - New skills: add a
.mdfile tosrc/Skills/with frontmatter (id,title,description) — copied toGameData/Kerpilot/Skills/at build time, loaded automatically at runtime - Add tests for new tools or skills in the
tests/project - Keep the mod lightweight — no external dependencies beyond KSP/Unity assemblies
