Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>Photon — AI Coding AgentNew to Visual Studio Code? Get it now.
Photon — AI Coding Agent

Photon — AI Coding Agent

Photon AI

| (0) | Free
Local-first AI coding agent for Ollama, llama.cpp, and BYOK cloud models — adaptively tuned so small local LLMs run reliably on everyday laptops.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Photon

Local-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.

Version License: Proprietary VS Code


Table of Contents

  • Overview
  • Demo & Screenshots
  • Why Photon
  • Highlights in v0.1.0
  • Interaction Modes
  • Slash Commands & VS Code Integration
  • Built-in Tools & MCP
  • Architecture
  • Supported Providers & Models
  • Installation & Quick Start
  • Configuration Reference
  • Privacy, Security & Data Isolation
  • Troubleshooting & Bug Reports
  • License

Overview

Most 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 (Qwen 2.5 Coder, Gemma 4, Qwen 3 / 3.5, Phi-4 Mini, DeepSeek R1, DeepSeek-Coder-V2-Lite) via Ollama and llama.cpp, while also providing a dedicated high-throughput Cloud Engine for BYOK frontier providers (Claude, OpenAI, Gemini, NVIDIA NIM, OpenRouter, OpenCode Zen, Blackbox AI, and custom OpenAI-compatible endpoints).

For full documentation and IDE setup guides, see getphoton.in/docs.


Demo & Screenshots

Live Agent File Edit & Checkpoint Modes, Cloud Toggle & Soft Light Theme
Live Agent File Edit Demo Modes, Cloud Toggle & Themes Demo

Why Photon

  • 100% Local & Offline by Default: Code, conversation history, project memory, and vector embeddings stay on your machine in Local mode.
  • Inverse Cognitive Scaffolding: Smaller models automatically receive richer step-by-step guidance, phase-specific worked examples, and state cards, while frontier models receive lean, low-overhead prompts.
  • Hardware-Aware Context & VRAM Guardrails: Profiles CPU cores, free/total RAM (reserving a 22.5% OS/IDE buffer), and GPU VRAM to pick safe context ceilings and warn before high context settings trigger disk swapping.
  • Dual Tool Protocol (photon-block + Compact Native JSON): Supports both a fault-tolerant flat block syntax (TOOL_NAME / BEGIN_ARG / [TOOL]) and pruned native function schemas (>40% lighter on local VRAM), backed by a live Reliability Governor that auto-recovers or downgrades protocols mid-turn if a model stumbles.
  • Zero Silent Cloud Escalation: Local and Cloud modes operate as explicit, independent stacks — Photon never silently sends local code to a cloud API. Opt-in Hybrid mode (photon.adaptive.hybridPlanExecute, off by default) explicitly discloses that it sends your prompt and up to 2,800 characters of project outline (file paths and symbol names) to your enabled Cloud model for planning while keeping file reads and edits local.

Highlights in v0.1.0

Fail-Safe Checkpoints & Cumulative Rollback

  • Lazy Pre-Mutation Snapshots: Automatically snapshots original file state right before any write_file, edit_file, append_file, or move_path mutation executes. Read-only turns incur zero disk overhead.
  • Reverse-Chain Multi-Turn Rollback: Restores modified files to their exact pre-mutation bytes and cleanly deletes newly created files across multiple turns.
  • Two Recovery Modes: Revert & Rewind Chat (restores disk files, rewinds chat history, and places your original prompt back into the Composer ready to edit) or Files Only (restores disk state while keeping chat history intact).
  • Interactive Revert Modal: Sequential checkpoint numbering (Checkpoint #1, #2, …) accessible via inline turn pills, /revert, /revert <num>, or /rewind.
Inline Tool Execution & Checkpoint Pill Interactive Revert Modal
Inline Tool Execution & Checkpoint Revert to Checkpoint Modal

Intelligent Context Compaction

  • Automatic 75% Threshold: Projects incoming prompt + tool overhead before each turn and automatically compacts older turns once context pressure reaches 75% of the active window, plus mid-turn overflow recovery.
  • Ground-Truth Fact Retention: Preserves the original task anchor, user constraints, verified modified/inspected files, command execution outcomes, and open todos while summarizing older dialogue.
  • Manual Compaction: Trigger anytime via /compact [optional focus] or the Composer's Context & Runtime meter.

Real-Time Hardware & Cloud Cost Telemetry

  • Live Local Gauges: Real-time GPU utilization, temperature, VRAM allocation, system RAM, active resident Ollama models (with 1-click VRAM unload), and smoothed tok/s speed tracking.
  • Cloud Usage & Cost Calculator: Tracks exact input, output, cached, and schema-saved tokens with per-model USD cost estimates and cache-hit rates across Claude, OpenAI, Gemini, DeepSeek, Grok, and custom overrides.
Real-Time GPU, VRAM & Model Compatibility Telemetry
Real-Time Hardware & Telemetry

Adaptive Void Black & Soft Light UI

  • Refined Dual Themes: Frosted #181818 Soft Dark theme with an animated aurora hero, plus a high-contrast warm-stone Soft Light theme (Auto (VS Code), Soft Dark, Soft Light).
  • Narrow Sidebar Ready: Engineered to stay crisp and readable down to 300px VS Code Activity Bar sidebars.
  • Guided Setup Wizard: First-run onboarding senses installed local runtimes/models, recommends hardware-matched models with 1-click ollama pull progress bars, or tests and connects cloud API keys.
Void Black Hero Soft Light Theme Guided Setup Wizard
Void Black Theme Soft Light Theme Guided Setup Wizard

Interaction Modes

Switch modes anytime from the Composer dropdown without losing session history or Maintained Project Context:

Mode Purpose File Mutations & Terminal Safety Step Ceiling
Chat Read-only Q&A, codebase inspection, and live web lookup; outputs copyable code snippets instead of editing disk No 100 steps
Plan Read-only codebase exploration, 2–4 clarifying questions when ambiguous, and structured Markdown architecture plans No 150 steps
Agent Autonomous multi-file editing, terminal command execution, diagnostics verification, and MCP tool invocation Yes (Approval-gated by default) 200 steps

Slash Commands & VS Code Integration

Composer Slash Commands

Type / in the Composer input to open the keyboard-navigable command menu:

Command Action
/revert Opens the interactive Checkpoint Revert Modal.
/revert <num> Rolls back directly to Checkpoint #<num> and rewinds chat.
/rewind Instantly rolls back the latest mutating turn and restores your prompt.
/compact [focus] Compacts conversation history to free up context tokens (with optional focus topic).
Keyboard-Navigable Slash Command Menu
Slash Commands Menu

Command Palette & @photon Chat Participant

  • Photon: Open Chat (photon.openChat) — Focuses the Photon sidebar view (also bound to the VS Code Status Bar indicator).
  • Photon: New Chat (photon.newSession) — Starts a fresh session.
  • Photon: Refresh Ollama Models (photon.refreshModels) — Re-scans local and configured models.
  • Photon: Run Machine + Model Diagnostics (photon.runDiagnostics) — Writes redacted hardware, model, and runtime diagnostics to the Photon Output channel.
  • @photon — Send prompts and #file / image references directly from VS Code's native Chat panel into Photon.

Built-in Tools & MCP

Photon ships with 17 built-in tools (automatically mapped to industry-standard native tool aliases in Cloud mode) plus Model Context Protocol (MCP) support:

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-click ollama pull with ETA, VRAM residency control (keepAlive), and local RAG embeddings (nomic-embed-text).
  • llama.cpp (http://localhost:8080) — Managed llama-server startup, 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
Local & Cloud Providers Project Context & Memory

Installation & Quick Start

Prerequisites

  • VS Code 1.90.0 or 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: false so 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, and photon.providers.custom) are marked "scope": "machine" so cloned repositories cannot override them via .vscode/settings.json.
  • Workspace Path Containment: resolveInWorkspace blocks 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.autoApprove is enabled, Photon applies a best-effort heuristic denylist (scanning for chaining &&/|/$(), caret/Base64/EncodedCommand obfuscation, privilege escalation, and destructive patterns such as rm -rf, rd /s, find -delete, git reset --hard, git branch -D, and force push) to force explicit single-turn confirmation (Always allow is disabled). Because regex guards are not an OS sandbox and cannot intercept every scripting language flag (e.g., python -c or node -e), leave autoApprove off when working with untrusted prompts, and note that workspace scripts like npm test require approval rather than being unattended-allowlisted.
  • SSRF & Secret Scrubbing: web_fetch and 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, Bearer tokens, 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 Diagnostics from 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).

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft