Detect active AI models in VS Code for git attribution
VS Code extension that detects and classifies which AI model GitHub Copilot or other AI extensions are currently using, from native VS Code storage.
Why it matters
Enable developers to properly attribute code contributions by identifying which AI model (Claude, GPT, or Gemini) is actively generating code through VS Code Copilot in real-time.
Outcomes
What it gets done
Detect the active AI model being used by VS Code Copilot
Identify whether Claude, GPT, or Gemini is generating code
Enable proper git commit attribution based on model detection
Monitor AI model usage in real-time via Chat Participant API
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/mcp-vscode-ai-model-detector | bash Overview
Vscode Ai Model Detector
A VS Code extension that detects and classifies the AI model currently active in GitHub Copilot or another AI extension, reading directly from VS Code's native SQLite storage and cross-referencing a registry of 41+ known model IDs for vendor, family, and capability metadata. Use it when a tool or developer workflow needs to know exactly which AI model is powering the current VS Code chat session, for logging, attribution, or capability-aware tooling, rather than assuming a default.
What it does
A VS Code extension that provides real-time detection and classification of the AI model currently active in GitHub Copilot or other AI-powered extensions. Rather than guessing or relying on a static default, it reads VS Code's own SQLite state database directly to identify exactly which model is in use, then cross-references a dynamic registry of 41+ model IDs spanning OpenAI, Anthropic, Google, and other vendors to return the model's family, vendor, capabilities, and context window.
When to use - and when NOT to
Use it when a tool, script, or workflow needs to know with high confidence which AI model actually generated a piece of output in VS Code - for attribution logging, capability-aware automation that behaves differently depending on the active model's context window or features, or simply monitoring model changes as a developer switches between them during a session. It requires GitHub Copilot or another extension using VS Code's Chat Participant API to actually be active, there is no model to detect otherwise, and works with VS Code Stable, Insiders, or VSCodium installations specifically, so behavior on other editors or Copilot integrations outside VS Code is out of scope.
Inputs and outputs
No configuration is required for basic use; detection works automatically once installed. The extension exposes a programmatic API: detectCurrentModel() returns the current model's identifier and metadata, startModelMonitoring(intervalMs) begins polling for model changes at a given interval and returns a session ID to later stop with stopModelMonitoring(sessionId), and getModelCapabilities(modelId) looks up a specific model's capabilities by ID. Each returned ModelInfo includes id, display name, vendor, family, maxTokens, an array of capabilities, and an optional version and accuracy level.
Integrations
Detection works by querying VS Code's own state.vscdb SQLite storage for the chat.currentLanguageModel.panel key, parsing the model identifier, normalizing dots versus hyphens, and matching it against the model registry - the same model ID formats used in VS Code's own vscode-copilot-chat configurationService.ts, so detected IDs stay aligned with what Copilot itself reports internally. The registry covers OpenAI's GPT-4.1, GPT-4o mini, GPT-5, GPT-5 mini, and GPT-5-Codex, plus its O1, O1 mini, and O3 mini reasoning models; Anthropic's Claude 3.5 and 3.7 Sonnet, Haiku 4.5, Opus 4 and 4.1, and Sonnet 4 and 4.5; Google's Gemini 2.5 Pro, 2.0 Pro Experimental, and 2.0 Flash; plus DeepSeek Chat and Grok Code Fast 1 - the named entries in the README's own model table, out of the 41+ IDs the dynamic registry tracks in total.
Who it's for
Extension developers and tooling authors who need programmatic, high-confidence knowledge of which AI model is active in a VS Code session, for attribution, logging, or capability-aware behavior. The project is MIT licensed.
Source README
VS Code AI Model Detector
A Visual Studio Code extension that provides real-time detection and classification of AI models used in GitHub Copilot and other AI-powered extensions. Supports accurate model identification using VS Code's native storage and settings.
Features
- ๐ Real-Time Model Detection: Accurately identifies current AI model from VS Code's application storage
- ๐ง Dynamic Model Registry: Supports 41+ model IDs across major AI providers
- โก High Performance: Direct integration with VS Code's SQLite storage
- ๐ Comprehensive Classification: Detects model family, vendor, and capabilities
- ๐ Live Updates: Monitor model changes in real-time
- ๐ฏ High Confidence Detection: Uses actual VS Code settings and Chat Participant API
- ๐ก๏ธ Multi-Installation Support: Works with VS Code Stable, Insiders, and VSCodium
Supported Models
Source: Model IDs and formats match official VS Code Chat Model enums from microsoft/vscode-copilot-chat configurationService.ts
OpenAI GPT Series
- GPT-4.1 (2025-04-14) (VS Code Chat Model)
- GPT-4o mini (VS Code Chat Model)
- GPT-5 (VS Code Chat Model)
- GPT-5 mini (VS Code Chat Model)
- GPT-5-Codex (VS Code Chat Model)
OpenAI O-Series
- O1 (VS Code Chat Model)
- O1 mini (VS Code Chat Model)
- O3 mini (VS Code Chat Model)
Anthropic Claude Series
- Claude 3.5 Sonnet (VS Code Chat Model)
- Claude 3.7 Sonnet (VS Code Chat Model)
- Claude Haiku 4.5 (VS Code Chat Model)
- Claude Opus 4 (VS Code Chat Model)
- Claude Opus 4.1 (VS Code Chat Model)
- Claude Sonnet 4 (VS Code Chat Model)
- Claude Sonnet 4.5 (VS Code Chat Model)
Google Gemini Series
- Gemini 2.5 Pro (VS Code Chat Model)
- Gemini 2.0 Pro Experimental (VS Code Chat Model)
- Gemini 2.0 Flash (VS Code Chat Model)
Other Models
- DeepSeek Chat (VS Code Chat Model)
- Grok Code Fast 1 (VS Code Chat Model)
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "AI Model Detector"
- Click Install
Or install from VS Code Marketplace: AI Model Detector Extension
Usage
Basic Detection
const detector = vscode.extensions.getExtension('thisis-romar.vscode-ai-model-detector');
const api = await detector.activate();
const result = await api.detectCurrentModel();
console.log('Current Model:', result.currentModel);
Monitor Model Changes
// Start monitoring with 5 second intervals
const sessionId = await api.startModelMonitoring(5000);
// Later, stop monitoring
await api.stopModelMonitoring(sessionId);
Get Model Capabilities
const modelInfo = await api.getModelCapabilities('claude-3.5-sonnet');
console.log('Capabilities:', modelInfo.capabilities);
How It Works
Model Detection Process
- Queries VS Code's SQLite storage database (
state.vscdb) - Looks for
chat.currentLanguageModel.panelkey - Parses model identifier to determine family and provider
- Cross-references with dynamic registry of 41+ models
- Returns comprehensive model information with high confidence
Dynamic Registry
- Real-time updates for new model versions
- Format normalization (dots vs hyphens)
- Comprehensive metadata including:
- Token limits
- Special capabilities
- Context windows
- Model families
- Vendor information
Model Metadata
Each detected model includes:
interface ModelInfo {
id: string; // Unique model identifier
name: string; // Display name
vendor: ModelVendor; // OpenAI, Anthropic, Google, etc.
family: ModelFamily; // GPT, Claude, Gemini, etc.
maxTokens: number; // Maximum context length
capabilities: ModelCapability[]; // Supported features
version?: string; // Model version if available
accuracy?: string; // Detection accuracy level
}
Configuration
No configuration required for basic usage. The extension automatically detects models from VS Code's native storage.
Requirements
- Visual Studio Code >= 1.85.0
- GitHub Copilot extension (for Copilot model detection)
- Active AI extension using VS Code's Chat Participant API
Attribution
This project follows the GIT-ATT-001 v1.1.0 standard for AI attribution. All commits should include proper AI attribution blocks:
AI-Attribution:
- Model: <model-id> (Vendor)
- Session: <chat-session-uuid or manual-commit-timestamp>
- Context: <development context>
Co-authored-by: <Platform-Name> (<model-id>) <admin+llm-[normalized-id]@emblemprojects.com>
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.