Photon Technical Documentation

Architecture, multi-IDE installation, local runtime tuning, built-in tools, Model Context Protocol (MCP) security, and configuration reference for Photon v0.1.0.

01 • QUICK START

Up and running in two minutes

STEP 1 — LOCAL RUNTIME
Install Ollama or llama.cpp

Install Ollama (or run llama-server) and pull a hardware-matched coding model:

ollama pull qwen2.5-coder:7b
# Optional offline RAG index:
ollama pull nomic-embed-text
STEP 2 — INSTALL EXTENSION
Load into your preferred IDE

Install 1-click in VS Code or Cursor, via VS Marketplace / Open VSX, or by CLI:

code --install-extension getphoton.photon-ai
cursor --install-extension getphoton.photon-ai
antigravity-ide --install-extension getphoton.photon-ai
STEP 3 — ONBOARDING WIZARD
Profile hardware & start

Open Photon from the sidebar Activity Bar. The 2-step Setup Wizard senses your GPU/RAM, detects installed models, or connects optional BYOK cloud keys.

Zero account or sign-in required
02 • IDE & EDITOR COMPATIBILITY

One editor-independent core, native across IDEs

Photon's production agent engine (src/core/) contains zero editor imports (enforced at build time). The host adapter targets the open Extension Host ^1.90.0 specification with no Microsoft-proprietary API lock-in—feature-detecting optional host surfaces so every compatible IDE runs the full sidebar UI, checkpoints, diagnostics, encrypted SecretStorage, and MCP tools cleanly.

IDE / Environment Installation Method Verified Capabilities
Cursor 1-click URI or cursor --install-extension getphoton.photon-ai Full sidebar Webview, Agent/Plan/Chat, live diagnostics, checkpoints, MCP, OS SecretStorage
Antigravity IDE Open VSX or antigravity-ide --install-extension getphoton.photon-ai Full sidebar Webview in Antigravity IDE (Code-OSS 1.107+), Agent/Plan/Chat, diagnostics, checkpoints, MCP, SecretStorage
Visual Studio Code 1-click URI, Marketplace, or code --install-extension getphoton.photon-ai Full sidebar Webview + optional @photon native Chat Participant
Windsurf Open VSX or windsurf --install-extension getphoton.photon-ai Full sidebar Webview, Agent/Plan/Chat, live diagnostics, checkpoints, MCP, OS SecretStorage
VSCodium & Code-OSS 1.90+ Open VSX or codium --install-extension getphoton.photon-ai Works in VSCodium, Positron, Trae, and code-server without Microsoft proprietary APIs or telemetry
Standalone Browser Workbench npm run workbench (optional PHOTON_WORKSPACE_ROOT) Serves Photon's full runtime & React UI at http://localhost:4321 alongside Neovim, Zed, JetBrains, or CLI workflows
03 • ADAPTIVE INTELLIGENCE ARCHITECTURE

How Photon makes 2B–16B local models reliable

Hardware-Truthful KV-Cache & VRAM Sizing

Cross-platform hardware profiling (nvidia-smi, Windows Registry qwMemorySize, macOS system_profiler, Linux DRM) measures CPU cores, Apple Silicon unified memory, free RAM, and GPU VRAM. Photon reserves a 22.5% OS/IDE RAM buffer plus 0.5 GB VRAM, computing exact model weight + KV-cache budgets from 8k to 256k before swapping can occur.

Inverse Cognitive Scaffolding

Smaller quantized models (2B–8B) automatically receive tighter sampling temperatures, phase-pruned worked examples, and working-memory state cards. Larger local models (14B–32B+) and frontier cloud APIs receive minimal, low-overhead system prompts and parallel read-only tool execution waves.

Dual Tool Protocol & Tolerant Parser

Supports both Photon-Block (flat unescaped multiline code bodies via TOOL_NAME / BEGIN_ARG) and >40%-pruned compact native JSON schemas. The multi-dialect parser recovers fenced blocks, XML <tool_call>, split JSON objects, and 30+ parameter synonyms (filepath → path).

Live Reliability Governor & Capability Passport

Monitors turns across Rungs 0–4 for parse errors, tool narration leaks, duplicate calls, or compiler regressions—injecting targeted examples or switching failing native JSON models to Photon-Block mid-turn. Empirical outcomes are saved locally per (model, quantization, runtime) in the Capability Passport and calibrated via Photon Bench v5.

04 • INTERACTION MODES, SLASH COMMANDS & 17 TOOLS

Modes, checkpoints, and built-in developer tools

Chat Mode (100-step cap)

Strictly read-only repo & web inspection; outputs copyable code blocks without mutating disk.

Plan Mode (150-step cap)

Read-only exploration + 2–4 clarifying questions when ambiguous + structured Markdown blueprints.

Agent Mode (200-step cap)

Approval-gated multi-file creation/edits, terminal commands, live IDE diagnostics, and MCP tools.

/revert — interactive Checkpoint Revert Modal /revert <n> — jump to Checkpoint #n /rewind — undo latest mutating turn & restore prompt /compact [focus] — compact history (auto-runs at 75%)
Category Built-in Tools (17 Total) Safety & Engineering Guarantees
Files (5) read_file, edit_file, write_file, append_file, move_path Line-sliced reads, CRLF & UTF-8 BOM preservation, binary NUL rejection, lazy pre-mutation snapshots (≤2 MB/file, 50 MB cap).
Search & Outline (4) list_dir, find_files, search_code, code_outline Auto-ignores node_modules/dist/.git; extracts top-level functions, classes, interfaces, and types.
Verify & Shell (2) get_diagnostics, run_command Reads live IDE compiler/linter errors; scans shell commands for chaining, Base64/caret obfuscation, and destructive flags.
Memory & Flow (4) query_project_context, update_project_context, todo_write, think Maintains cross-turn symbol summaries, architectural decisions, structured checklists, and compact-model reasoning scratchpads.
Live Web (2) web_search, web_fetch DuckDuckGo & Google search; HTTPS page extraction with DNS-pinned SSRF protection across every redirect hop.
MCP Servers .vscode/mcp.json (stdio, http, sse) Sanitized subprocess env allowlists, DNS-pinned remote transports, and SHA-256 config trust fingerprinting.
05 • RUNTIMES, HARDWARE SIZING & BYOK CLOUD

Recommended local models by GPU & Cloud BYOK

Hardware-Matched Local Model Guide

4 GB VRAM / CPU Laptopqwen2.5-coder:3b · phi4-mini
4–6 GB VRAM (Vision + Reason)gemma4:e4b
6–8 GB VRAM (Sweet Spot)qwen2.5-coder:7b
12–16+ GB / Apple Siliconqwen2.5-coder:14b · qwen3 · deepseek-r1
Offline Semantic RAG Indexnomic-embed-text

Local Runtimes: Ollama (localhost:11434) and managed llama-server (localhost:8080 with automatic -c, -ngl, --fit, -fa, -ctk, -ctv tuning), plus LM Studio and vLLM detection.

Direct BYOK Cloud & Opt-in Hybrid Mode

Connect direct API keys for Anthropic Claude (with ephemeral system/tool prompt caching), OpenAI, Google Gemini, NVIDIA NIM, OpenRouter, OpenCode Zen, Blackbox AI, or custom OpenAI-compatible servers (Groq, DeepSeek, Mistral, Together, xAI).

OPT-IN HYBRID WORKFLOW (OFF BY DEFAULT)

Enabling photon.adaptive.hybridPlanExecute sends only your task prompt and up to 2,800 characters of project outline (file paths and symbol names—never file contents) to your enabled Cloud model to draft a step plan, then executes all file reads and edits locally on your GPU at $0.

06 • CONFIGURATION REFERENCE

Core settings & team project config

Configure via Photon's in-app Settings panel, your IDE settings (photon.*), or check shared model defaults into .photon/config.json (autoApprove in repository configs is ignored by design).

Setting Default Purpose
photon.interfaceMode"local"Active execution engine: "local" (offline) or "cloud" (direct BYOK).
photon.defaultMode"chat"Default workflow mode ("chat", "plan", "agent").
photon.adaptive.enabledtrueAuto-tune context ceiling, scaffolding level, and tool protocol to hardware + model.
photon.intelligence.level"auto"Scaffolding preset ("auto", "max", "high", "medium", "low").
photon.tools.autoApprovefalsePrompt before side effects when false; destructive terminal commands always require confirmation.
photon.ollama.keepAlive"-1"VRAM residency duration ("-1" resident, "30m", "2h", or "" server default).
photon.index.enabledfalseEnable 100% offline workspace vector indexing via photon.index.embeddingModel.
07 • PRIVACY, SECURITY & DATA ISOLATION

Zero silent cloud escalation & workspace containment

Strict Engine Isolation: Local mode runs 100% on-device. Cloud mode connects directly from your machine to your enabled provider with zero proxy servers and zero silent Local-to-Cloud fallback.
Workspace Path Containment: resolveInWorkspace blocks .. traversal, Windows UNC/cross-drive escapes, and symlinks resolving outside your workspace root.
Terminal & Destructive Locks: Commands are inspected for shell chaining, encoded obfuscation, privilege escalation, and destructive actions (rm -rf, git reset --hard), disabling Always allow on high-risk operations.
SSRF & Secret Scrubbing: Remote fetches and MCP transports pin DNS resolution to block localhost/RFC1918 private IPs across redirects; API keys stay in OS/editor SecretStorage and are redacted from logs.