PhotonLocal-first agentic coding for VS Code — engineered so compact 2B–16B local LLMs reliably inspect, edit, and verify real codebases on consumer hardware, with direct BYOK frontier cloud models a single toggle away. Table of Contents
OverviewMost AI coding extensions are designed around 200k-context cloud APIs and treat local LLMs as an afterthought — stuffing thousands of tokens of rigid JSON schemas into a 4 GB–8 GB laptop GPU until small models hallucinate arguments, overflow VRAM, or stall. Photon is built from the ground up around the memory limits, KV-cache math, and tool-calling behaviors of compact local models ( For full documentation and IDE setup guides, see getphoton.in/docs. Demo & Screenshots
Why Photon
Highlights in v0.1.0Fail-Safe Checkpoints & Cumulative Rollback
Intelligent Context Compaction
Real-Time Hardware & Cloud Cost Telemetry
Adaptive Void Black & Soft Light UI
Interaction ModesSwitch modes anytime from the Composer dropdown without losing session history or Maintained Project Context:
Slash Commands & VS Code IntegrationComposer Slash CommandsType
Command Palette &
|
| Tool | Category | Description |
|---|---|---|
read_file |
Files | Line-numbered file slicing (start_line / end_line), binary NUL-byte rejection, and UTF-8 BOM preservation. |
edit_file |
Files | Atomic find-and-replace with CRLF/LF preservation, gutter/whitespace tolerance, and pre-mutation checkpointing. |
write_file |
Files | Atomic file creation/overwrite with workspace boundary enforcement and checkpointing. |
append_file |
Files | Appends content to existing or new workspace files without full-file rewrites. |
move_path |
Files | Renames or moves files/directories within the workspace while preventing silent overwrites. |
list_dir |
Search | Lists directory entries (folders first), excluding build/cache folders (node_modules, dist, .git). |
find_files |
Search | Fast workspace glob and substring file discovery. |
search_code |
Search | Workspace-wide regex and literal code search with file/line reporting. |
code_outline |
Search | Extracts top-level functions, classes, interfaces, and type declarations. |
get_diagnostics |
Verify | Reads live VS Code compiler, typechecker, and linter diagnostics. |
run_command |
Terminal | Executes workspace shell commands with chaining/obfuscation analysis and destructive-command approval locks. |
query_project_context |
Memory | Queries Photon's maintained symbol index, file summaries, and cross-turn handoff notes. |
update_project_context |
Memory | Records persistent architectural notes and decisions for the workspace. |
todo_write |
Workflow | Maintains structured task checklists (pending, in_progress, done, blocked). |
think |
Workflow | Scratchpad reasoning tool for structured step planning on compact models. |
web_search |
Web | Live web search via DuckDuckGo (HTML/Lite/Instant) and Google with weather/currency fast paths. |
web_fetch |
Web | Fetches and cleans public https:// pages with DNS-pinned SSRF protection across every redirect hop. |
MCP Integration (.vscode/mcp.json): Supports both stdio (sanitized environment variable allowlist + command allowlist) and http/sse (DNS-pinned remote endpoints) with config SHA-256 trust fingerprinting and persistent or session-scoped approval in Settings → Advanced.
Architecture
src/
├── core/ # Pure TypeScript engine (zero 'vscode' imports — enforced at build time)
│ ├── adaptive/ # Hardware/VRAM profiler, KV-cache planner, Auto-Mode router, Capability Passport
│ ├── agent/ # Local Unified Engine, Cloud Engine, 75% Compactor, Error Recovery
│ ├── bench/ # Photon Bench v5 (throughput, block & native tool-call reliability)
│ ├── checkpoints/ # Lazy pre-mutation snapshots & reverse-chain rollback engine
│ ├── context/ # Maintained Project Context & cross-model turn handoff
│ ├── index/ # Sliding-window code chunker & offline Ollama vector store
│ ├── intelligence/ # Task analyzer, Inverse Scaffolding policy, narration/deflection guards
│ ├── llm/ # Provider adapters (Ollama, Anthropic, Gemini, OpenAI-compatible) & catalogs
│ ├── prompts/ # Budgeted Local & Cloud system prompt builders
│ ├── protocol/ # Tolerant Photon-Block parser & compact/native tool serializers
│ └── tools/ # 17 built-in tools, path/command security, DNS-pinned MCP client
├── photon-core/ # Tool execution pipeline & event-sourced loop primitives
├── host/ # VS Code integration (PhotonController, ChatViewProvider, SecretStorage, watchers)
└── shared/ # Dependency-free protocol & domain types shared with the React webview
webview-ui/ # React 18 + Vite UI (Void Black & Soft Light design system)
Supported Providers & Models
Local Runtimes (Offline)
- Ollama (
http://localhost:11434) — Process start/stop, disk & live model sensing, 1-clickollama pullwith ETA, VRAM residency control (keepAlive), and local RAG embeddings (nomic-embed-text). - llama.cpp (
http://localhost:8080) — Managedllama-serverstartup, port-conflict recovery, and per-model CLI flag builder (-c,-ngl,--fit,-fa,-ctk,-ctv). - LM Studio & vLLM — Local runtime detection and OpenAI-compatible connection presets.
Cloud Frontier Providers (BYOK)
- Anthropic Claude:
claude-sonnet-4-5,claude-opus-4-1,claude-haiku-4-5,claude-sonnet-4,claude-3-7-sonnet(with ephemeral system/tool prompt caching) - OpenAI:
gpt-5,gpt-4.1,gpt-4o,gpt-4o-mini,o3,o4-mini - Google Gemini:
gemini-2.5-pro,gemini-2.5-flash,gemini-2.5-flash-lite,gemini-2.0-flash - NVIDIA NIM:
deepseek-ai/deepseek-r1,qwen/qwen2.5-coder-32b-instruct,meta/llama-3.3-70b-instruct - OpenRouter, OpenCode Zen, Blackbox AI, & Custom Endpoints (
Groq,DeepSeek,Mistral,Together,xAI Grok 4, or any OpenAI-compatible URL)
All API keys are stored exclusively in VS Code SecretStorage — never written to settings.json, project files, or logs.
| Local Runtime Detection & Cloud Providers | Maintained Project Context & Handoff Memory |
|---|---|
![]() |
![]() |
Installation & Quick Start
Prerequisites
- VS Code
1.90.0or newer - Ollama (recommended for local mode) — ollama.com
Recommended starter local models:
# Sweet-spot 7B local coding (6–8 GB VRAM)
ollama pull qwen2.5-coder:7b
# Compact multimodal & reasoning (4–6 GB VRAM)
ollama pull gemma4:e4b
# Lightweight 3B coding (4 GB VRAM / CPU-friendly)
ollama pull qwen2.5-coder:3b
# Optional: Offline workspace semantic RAG embeddings
ollama pull nomic-embed-text
Install
Install Photon (getphoton.photon) from the Visual Studio Marketplace or Open VSX Registry, or download from getphoton.in.
Open VS Code, click the Photon icon in the Activity Bar, complete the 2-step Setup Wizard (Local or Cloud), and start building.
Configuration Reference
Configure via Photon's in-app Settings panel or VS Code Settings (Ctrl+, / Cmd+, → Photon):
| Setting | Default | Description |
|---|---|---|
photon.interfaceMode |
"local" |
Active execution stack: "local" (Ollama / llama.cpp) or "cloud" (direct BYOK APIs) |
photon.defaultMode |
"chat" |
Default interaction mode ("chat", "plan", "agent") |
photon.defaultModel |
"" |
Default selected model (empty = best/first available) |
photon.adaptive.enabled |
true |
Auto-tune context window, prompt scaffolding, and tool protocol to hardware + model |
photon.adaptive.freeze |
false |
Freeze live Reliability Governor escalations and Capability Passport priors |
photon.intelligence.level |
"auto" |
Guidance preset ("auto", "max", "high", "medium", "low") |
photon.tools.autoApprove |
false |
Auto-approve non-destructive file edits and allowlisted commands |
photon.ollama.baseUrl |
"http://localhost:11434" |
Ollama server URL |
photon.ollama.keepAlive |
"-1" |
Keep active local model resident in VRAM ("-1", "30m", "2h", or "") |
photon.ollama.preloadOnStartup |
true |
Warm-load the selected local model in the background on startup |
photon.llamacpp.baseUrl |
"http://localhost:8080" |
llama-server base URL |
photon.bench.autoRun |
false |
Run Photon Bench automatically on un-benchmarked local models in the background |
photon.webSearch.provider |
"duckduckgo" |
Live search provider ("duckduckgo", "google", "none") |
photon.index.enabled |
false |
Enable offline local vector indexing for workspace RAG |
photon.index.embeddingModel |
"nomic-embed-text" |
Local Ollama embedding model used for workspace indexing |
Team-shared model defaults can also be checked into .photon/config.json (created via Settings → General → Project Config; autoApprove in repo configs is ignored by design).
Privacy, Security & Data Isolation
- Strict Stack Separation: Local mode executes 100% on-device. Cloud mode transmits prompts and relevant code context strictly to the user-enabled BYOK endpoint — with zero proxy servers and zero silent Local-to-Cloud fallback. If you explicitly opt into Hybrid mode (
photon.adaptive.hybridPlanExecute, off by default), Photon sends only your task prompt and up to 2,800 characters of project outline (file paths and symbol names) to your enabled Cloud model for step planning, while all file reads and edits stay local. - Workspace Trust & Machine-Scoped Settings: Photon declares
untrustedWorkspaces.supported: falseso it remains disabled in VS Code Restricted Mode until you trust the folder. Security-sensitive settings (photon.tools.autoApprove,photon.ollama.baseUrl,photon.llamacpp.baseUrl, andphoton.providers.custom) are marked"scope": "machine"so cloned repositories cannot override them via.vscode/settings.json. - Workspace Path Containment:
resolveInWorkspaceblocks lexical traversal (..), Windows UNC/cross-drive escapes, and symlinks pointing outside the workspace root. - Terminal & Destructive Action Guards (Best-Effort): Interactive user approval is the primary safety control for shell execution. When
photon.tools.autoApproveis enabled, Photon applies a best-effort heuristic denylist (scanning for chaining&&/|/$(), caret/Base64/EncodedCommandobfuscation, privilege escalation, and destructive patterns such asrm -rf,rd /s,find -delete,git reset --hard,git branch -D, and force push) to force explicit single-turn confirmation (Always allowis disabled). Because regex guards are not an OS sandbox and cannot intercept every scripting language flag (e.g.,python -cornode -e), leaveautoApproveoff when working with untrusted prompts, and note that workspace scripts likenpm testrequire approval rather than being unattended-allowlisted. - SSRF & Secret Scrubbing:
web_fetchand remote MCP transports validate DNS resolution and pin connections to block localhost, RFC1918 private, and link-local IPs across redirects. Session persistence and diagnostics automatically redact API keys,Bearertokens, and credentials.
Troubleshooting & Bug Reports
- Inspect Runtime Logs: Open the Photon Output channel in VS Code (
View → Output, then select Photon from the dropdown) to see provider connection details, adaptive decisions, and runtime errors. - Run Built-in Diagnostics: Run
Photon: Run Machine + Model Diagnosticsfrom the Command Palette (Ctrl+Shift+P/Cmd+Shift+P) to write a redacted hardware, model, and runtime report to the Photon Output channel. - Report an Issue & Documentation: Photon collects zero telemetry or crash reports. If you run into a bug, please post in the Marketplace Q&A tab with the relevant Output channel snippet, or check getphoton.in/docs for setup and troubleshooting guides.
License
Photon is proprietary, closed-source software. Copyright (c) 2024-2026 Rahul. All rights reserved. Use is governed by the Photon Proprietary Software License Agreement (LICENSE, bundled with the extension). Bundled third-party open-source components are listed in THIRD_PARTY_NOTICES.md (also bundled with the extension).










