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.
Up and running in two minutes
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
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
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.
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 |
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.
Modes, checkpoints, and built-in developer tools
Strictly read-only repo & web inspection; outputs copyable code blocks without mutating disk.
Read-only exploration + 2–4 clarifying questions when ambiguous + structured Markdown blueprints.
Approval-gated multi-file creation/edits, terminal commands, live IDE diagnostics, and MCP tools.
| 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. |
Recommended local models by GPU & Cloud BYOK
Hardware-Matched Local Model Guide
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).
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.
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.enabled | true | Auto-tune context ceiling, scaffolding level, and tool protocol to hardware + model. |
| photon.intelligence.level | "auto" | Scaffolding preset ("auto", "max", "high", "medium", "low"). |
| photon.tools.autoApprove | false | Prompt 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.enabled | false | Enable 100% offline workspace vector indexing via photon.index.embeddingModel. |
Zero silent cloud escalation & workspace containment
resolveInWorkspace blocks .. traversal, Windows UNC/cross-drive escapes, and symlinks resolving outside your workspace root.rm -rf, git reset --hard), disabling Always allow on high-risk operations.SecretStorage and are redacted from logs.