Expose local models from Ollama or LM Studio in the VS Code chat model picker.
What this extension does
This extension registers a LanguageModelChatProvider named BBA LocalLLM Bridge. When VS Code asks the provider for available models, it:
discovers models from Ollama via /api/tags
discovers models from LM Studio via /v1/models
publishes those models into the chat model picker
forwards chat requests to the selected local model with streaming responses
Current scope
This is a focused bridge for chat models, not a full assistant stack. It currently:
supports local text chat streaming
discovers models automatically
supports tool-calling passthrough for tool-capable models
lets you restrict which models appear with settings
uses naive token counting for VS Code budgeting
includes a packaging-ready TypeScript extension scaffold
It does not yet:
support images
estimate tokens with model-specific tokenizers
expose embeddings, completions, or rerank endpoints
Extension settings
Open Settings and search for BBA LocalLLM Bridge.
Important settings:
bbaLocalLlmBridge.chatModelVisibility
bbaLocalLlmBridge.ollama.baseUrl
bbaLocalLlmBridge.ollama.models
bbaLocalLlmBridge.ollama.toolCallingModels
bbaLocalLlmBridge.lmStudio.baseUrl
bbaLocalLlmBridge.lmStudio.apiKey
bbaLocalLlmBridge.lmStudio.models
bbaLocalLlmBridge.lmStudio.toolCallingModels
Tool Calling
Tool calling support depends on the model you select.
If the selected model supports tool use, VS Code can use it in agent-style flows that require tools.
If the selected model does not support tool use well, it may still appear for normal chat but not behave reliably for tool-based tasks.
LM Studio can expose tool-use capability metadata for some models.
This extension can also be configured to show likely chat models more aggressively in the Chat picker, while retrying normal chat requests without tools if a backend rejects tool payloads.
If you want strict control, set these allowlists:
bbaLocalLlmBridge.ollama.toolCallingModels
bbaLocalLlmBridge.lmStudio.toolCallingModels
For easier setup, use:
BBA LocalLLM Bridge: Configure Chat Visibility
Visibility modes:
balanced: recommended for most users, shows likely chat models while keeping a safe retry path
strict: only advertises tool support from metadata or explicit allowlists
all-chat-models: shows every non-embedding model in Chat
Project structure
src/extension.ts contains the provider implementation
images/icon.png is the marketplace-safe extension icon
tsconfig.json compiles to out/
.vscode/launch.json and .vscode/tasks.json support F5 debugging
Typical local setup
Ollama
Start Ollama.
Ensure http://127.0.0.1:11434/api/tags works locally.
Open VS Code chat and manage models.
Select a model from BBA LocalLLM Bridge.
LM Studio
Start LM Studio local server.
Ensure http://127.0.0.1:1234/v1/models works locally.
Open VS Code chat and manage models.
Select a model from BBA LocalLLM Bridge.
Commands
BBA LocalLLM Bridge: Manage Provider
BBA LocalLLM Bridge: Refresh Models
Development
Run npm install
Open this folder in VS Code
Press F5 to launch the Extension Development Host
Open Chat and use the model picker
Useful commands:
npm run compile
npm run lint
npm run package
Notes
The provider API used here is documented by VS Code: