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
Ollamavia/api/tags - discovers models from
LM Studiovia/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.chatModelVisibilitybbaLocalLlmBridge.ollama.baseUrlbbaLocalLlmBridge.ollama.modelsbbaLocalLlmBridge.ollama.toolCallingModelsbbaLocalLlmBridge.lmStudio.baseUrlbbaLocalLlmBridge.lmStudio.apiKeybbaLocalLlmBridge.lmStudio.modelsbbaLocalLlmBridge.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.toolCallingModelsbbaLocalLlmBridge.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 pathstrict: only advertises tool support from metadata or explicit allowlistsall-chat-models: shows every non-embedding model in Chat
Project structure
src/extension.tscontains the provider implementationimages/icon.pngis the marketplace-safe extension icontsconfig.jsoncompiles toout/.vscode/launch.jsonand.vscode/tasks.jsonsupportF5debugging
Typical local setup
Ollama
- Start Ollama.
- Ensure
http://127.0.0.1:11434/api/tagsworks 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/modelsworks locally. - Open VS Code chat and manage models.
- Select a model from BBA LocalLLM Bridge.
Commands
BBA LocalLLM Bridge: Manage ProviderBBA LocalLLM Bridge: Refresh Models
Development
- Run
npm install - Open this folder in VS Code
- Press
F5to launch the Extension Development Host - Open Chat and use the model picker
Useful commands:
npm run compilenpm run lintnpm run package
Notes
The provider API used here is documented by VS Code: