Tool

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.

Works with vscodecopilotgitclaudegpt

46
Spark score
out of 100
Updated 8 months ago
Version 2.1.0

Add to Favorites

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

01

Detect the active AI model being used by VS Code Copilot

02

Identify whether Claude, GPT, or Gemini is generating code

03

Enable proper git commit attribution based on model detection

04

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.

Version
VS Code
License

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

OpenAI O-Series

Anthropic Claude Series

Google Gemini Series

Other Models

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "AI Model Detector"
  4. 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

  1. Queries VS Code's SQLite storage database (state.vscdb)
  2. Looks for chat.currentLanguageModel.panel key
  3. Parses model identifier to determine family and provider
  4. Cross-references with dynamic registry of 41+ models
  5. 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.