A comprehensive VS Code extension designed for developers to explore, test, and understand all available Language Model (LM) API models directly within their development environment. This powerful tool features a modern, modular architecture, an intuitive UI, complete API documentation, and robust error handling, making AI model integration seamless.
- Accelerate AI Development: Quickly discover and test models, reducing setup time.
- Deep Dive into LM APIs: Access comprehensive documentation and real-world examples.
- Troubleshoot with Ease: Identify unsupported models and API issues instantly.
- Streamlined Workflow: Copy API parameters and test responses with one click.
- Future-Proof Your AI Apps: Stay informed about model capabilities and compatibility.
- Automatic Discovery: Finds all available VS Code LM API chat models
- Smart Testing: Conditionally tests each model with a "hello" message to verify functionality, based on user choice after the premium request warning (starting June 4, 2025)
- Premium Request Awareness: Starting June 4, 2025, shows warning about GitHub Copilot premium request usage
- User Choice Options: Provides clear options to either test models (potentially consuming premium requests) or skip testing to avoid usage, especially relevant after the premium request warning date.
- Real-time Progress: Shows detailed progress with cancellation support
- Error Detection: Identifies and clearly displays unsupported models
- Model Metadata: Name, ID, vendor, family, version, max input tokens
- Capabilities: Support for image-to-text, tool calling, and other features
- Test Results: Complete request/response data for each model (when testing is performed)
- Support Status: Visual indicators (β /β/βοΈ) for model availability and testing status
- Premium Request Info: Clear indicators when testing was skipped to avoid premium usage
- Accordion Interface: Collapsible sections for organized information display
- VS Code Theme Integration: Automatic light/dark theme adaptation
- Copy to Clipboard: One-click copying with professional SVG icons and toast notifications
- Responsive Design: Adapts to different screen sizes with proper text handling
- LanguageModelChatRequestOptions: Full parameter documentation with examples
- Type Definitions: Detailed TypeScript interfaces and type information
- Model Options: Comprehensive coverage of temperature, tokens, penalties, and more
- Tool Integration: Documentation for function calling and tool modes
- XSS Protection: HTML escaping and safe JavaScript execution
- Cancellation Support: User-controllable operation cancellation
- Error Resilience: Graceful handling of model failures and API issues
- Memory Management: Proper resource cleanup and disposal with enhanced disposable safety
- Test Environment Safety: Robust error handling and cleanup in development/testing scenarios
- ModelService: Handles model discovery, testing, and data processing
- HtmlGenerator: Manages UI generation with accordion components
- Type Safety: Comprehensive TypeScript interfaces and type definitions
- Extensibility: Clean separation of concerns for future enhancements
- Smart Warning System: Starting June 4, 2025, shows informative dialog about GitHub Copilot premium request usage
- User Choice Options: When premium billing is active, choose how to proceed:
- "Test Models": Run full testing (consumes premium requests from your GitHub Copilot quota)
- "Skip Testing": Discover models without testing to avoid premium request usage
- "Learn More": Access official GitHub documentation about premium requests
- Visual Indicators: Clear status icons (βοΈ) and explanatory messages for skipped testing
- Transparent Usage: Always informed about when premium requests will be consumed
Recording.d.o.vscode-lm.Explorer.mp4
*(For best experience, view this video directly on GitHub or in a Markdown viewer that supports HTML video tags.)*
- Open VS Code Command Palette (
Ctrl+Shift+P
/Cmd+Shift+P
) - Run
AI Model Explorer: Discover & Test Available Models
- If prompted (after June 4, 2025), choose your preferred testing approach regarding premium requests
- Optionally, run
AI Model Explorer: Clear Cache and Discover Available Models
to force a fresh discovery and clear cached results. - Explore comprehensive AI model information and test results
- Premium Request Dialog: (After June 4, 2025) Choice between testing models or skipping to avoid premium usage. About premium request
- Model Overview Table: All available models with status indicators (β /β/βοΈ)
- API Documentation: Complete LanguageModelChatRequestOptions reference
- Model Details: Expandable accordion sections with:
- Model metadata and capabilities
- Live test results and response data
- Copy-to-clipboard functionality for easy integration
π Discovery: New to VS Code AI integration? Discover what models are available and working
π οΈ Development: Building AI-powered extensions? Get exact API parameters and test responses
π Troubleshooting: AI features not working? Test model compatibility and identify issues
π Comparison: Multiple AI providers? Compare capabilities and responses side-by-side
To access GitHub Copilot chat models through the VS Code Language Model API, you need:
- GitHub Copilot Subscription: Active GitHub Copilot Individual, Business, or Enterprise subscription
- GitHub Copilot Chat Extension: Install the "GitHub Copilot Chat" extension from the VS Code marketplace
- Authentication: Sign in to your GitHub account in VS Code
-
Install the GitHub Copilot Chat extension:
- Open VS Code Extensions view (
Ctrl+Shift+X
) - Search for "GitHub Copilot Chat"
- Install the official extension by GitHub
- Open VS Code Extensions view (
-
Sign in to GitHub:
- Open Command Palette (
Ctrl+Shift+P
) - Run
GitHub Copilot: Sign In
- Follow the authentication flow
- Open Command Palette (
-
Grant Language Model Access:
- The first time you run the extension's command (
AI Model Explorer: Discover & Test Available Models
), VS Code will prompt you to grant permission for this extension to access language models provided by GitHub Copilot Chat. You must click "Allow" for the extension to function correctly. - This prompt typically looks like: "The extension 'd.o. vscode-lm Explorer' wants to access the language models provided by GitHub Copilot Chat."
- The first time you run the extension's command (
-
Verify access:
- Run this extension's command
AI Model Explorer: Discover & Test Available Models
again. - You should now see GitHub Copilot models listed (e.g.,
copilot-gpt-4o
).
- Run this extension's command
- No models showing: Ensure you're signed in to GitHub and have an active Copilot subscription
- Authentication issues: Try
GitHub Copilot: Sign Out
then sign in again - Extension conflicts: Disable other AI extensions temporarily to test
The extension uses a clean, modular architecture for maintainability and extensibility:
src/
βββ extension.ts # Main extension entry point with command registration
βββ modelService.ts # Model discovery, testing, and data processing
βββ htmlGenerator.ts # UI generation with accordion components
βββ types.ts # TypeScript interfaces and type definitions
βββ test/ # Comprehensive unit and integration tests
- Handles model discovery, testing, and data processing. Includes a caching mechanism for models and test results to improve performance on subsequent runs.
fetchModels()
: Discovers available LM API modelsbuildModelSummary()
: Processes model metadata and capabilitiestestModels()
: Tests model functionality with progress reporting
generateHtml()
: Creates complete UI with accordion sections- Theme integration and responsive design
- Copy-to-clipboard functionality and toast notifications
ExtendedLanguageModelChat
: Enhanced model interface with capabilitiesModelExplorerData
: Data structure for UI generation- Complete TypeScript coverage for type safety
The extension includes comprehensive test coverage:
- 62 passing tests across unit and integration test suites
- Modular component testing for ModelService and HtmlGenerator
- Cancellation and error handling validation
- HTML security and XSS protection testing
- Disposable management and memory safety testing
Run tests with:
npm test
- VS Code with Language Model API support
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- GitHub Copilot Chat extension installed and authenticated
TODO: not published yet - this was only a test to try out how it works!
The easiest way to get started is to install the extension directly from the Visual Studio Code Marketplace:
- Open VS Code.
- Go to the Extensions view (
Ctrl+Shift+X
orCmd+Shift+X
). - Search for "d.o. vscode-lm Explorer".
- Click Install.
Install d.o. vscode-lm Explorer Now! (Link will be updated upon publication)
- Clone this repository
- Run
npm install
to install dependencies - Run
npm run compile
to build the extension - Press
F5
to launch a new Extension Development Host window
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project uses a GitFlow-inspired branching strategy with automated CI/CD:
dev
branch: All development work happens heremain
branch: Release-only branch with automated publishing- Feature branches: Created from and merged back into
dev
- Development: Work in
dev
branch or feature branches - Version Bump: Use release helper script:
npm run release:prepare # or for bash: npm run release:prepare:bash
- Create PR: From
dev
tomain
branch - Automated Release: Upon merge to
main
:- Creates GitHub release with auto-generated notes
- Publishes to VS Code Marketplace
- Tags version automatically
- Development CI: Runs tests and creates build artifacts for
dev
branch - Main Protection: Validates PRs to
main
(version bump, tests, builds) - Release Automation: Publishes to GitHub and VS Code Marketplace on
main
push
git clone <repository-url>
cd do-vscode-lm-explorer
npm install
npm run compile
npm run package # Build for production
npm run watch # Watch mode for development
npm run release:prepare
- Interactive version bump and release preparationnpm test
- Run test suitenpm run lint
- Code lintingnpm run check-types
- TypeScript type checking
For detailed CI/CD documentation, see .github/WORKFLOW_DOCUMENTATION.md
.
- Disposable Management: Fixed "DisposableStore already disposed" errors during test execution
- Memory Safety: Enhanced resource cleanup and disposal handling in test environment
- Test Robustness: Improved test teardown methods with proper error handling and safety checks
- Extension Lifecycle: Added defensive programming to handle disposed contexts gracefully
- CancellationToken Cleanup: Proper disposal of cancellation token sources in tests
- Error Handling: Enhanced error handling in test environment without affecting functionality
- Context Safety: Added guards against disposed extension contexts during rapid activation/deactivation
- Test Environment: Improved stability during VS Code's internal test framework operations
- Production Ready: All improvements maintain 62 passing tests with zero functional regressions
- VSIX Packaging: Configured
vsce package
to output VSIX to therelease/
folder. - Selective Inclusion: Updated
.vscodeignore
to exclude development files and directories (.github/
,.husky/
,internal/
,scripts/
,test-workspace/
) for a smaller, cleaner VSIX. - VS Code Version Support: Adjusted
engines.vscode
and@types/vscode
to support VS Code version^1.90.0
and later. - Pre-publish Checks: Ensured
vsce package
runs type checks, linting, and all tests before building the VSIX.
- Increased Test Coverage: Added more comprehensive unit and integration tests (62 passing tests total).
- Disposable Management: Enhanced memory safety and proper resource cleanup in test environment.
- Error Handling: Improved resilience and graceful error handling during test execution.
- Modular Design: Refactored into ModelService, HtmlGenerator, and type definitions
- Type Safety: Comprehensive TypeScript interfaces and error handling
- Clean Separation: Organized code structure for maintainability and extensibility
- Accordion Interface: Collapsible sections for organized information display
- VS Code Theme Integration: Automatic light/dark theme adaptation
- Copy to Clipboard: Professional SVG icons with toast notifications
- Responsive Design: Improved text handling and layout across screen sizes
- Complete API Reference: Full LanguageModelChatRequestOptions documentation
- Parameter Examples: Detailed examples for temperature, tokens, tools, and more
- Type Definitions: In-UI TypeScript interface documentation
- Model Capabilities: Enhanced capability detection and display
- Cancellation Support: User-controllable operation cancellation
- Error Resilience: Graceful handling of model failures and API issues
- XSS Protection: Enhanced HTML escaping and security measures
- Progress Tracking: Detailed progress reporting with status updates
- Comprehensive Testing: 62 passing tests covering all components
- Integration Tests: Real-world scenario validation
- Security Testing: XSS protection and HTML validation
- Performance Testing: Concurrent operation stability
- Memory Safety: Enhanced disposable management and cleanup testing
- Basic model discovery and testing functionality
- Simple HTML output with model information
- GitHub Copilot integration setup
This project is provided "as is" without warranty of any kind. Use at your own risk. The authors are not responsible for any damage or loss caused by the use of this software.