Problem
The VS Code extension currently lacks a UI for adding custom OpenAI-compatible providers, even though this functionality exists in the web/TUI application (packages/app).
Users must manually edit their opencode.json configuration file to add OpenAI-compatible providers, which creates a poor user experience and friction for users who want to:
- Connect to local models (Ollama, LM Studio)
- Use custom API endpoints
- Connect to enterprise/self-hosted deployments
- Use lesser-known OpenAI-compatible providers
Current State
Web/TUI App (packages/app) ✅
Has full UI support for custom providers:
dialog-custom-provider.tsx - Full form dialog with validation
settings-providers.tsx - Settings section with "Custom provider" button (line 212-234)
Features:
- Provider ID input with validation
- Provider name input
- Base URL input with format validation
- API Key input (supports both direct keys and
{env:VAR} format)
- Multiple model entries (ID + name)
- Custom headers support
- Full form validation
- Integration with global config updates
VS Code Extension (packages/kilo-vscode) ❌
Missing the custom provider UI:
ProvidersTab.tsx only shows:
- Default model selector
- Small model selector
- Disabled providers list
- Enabled providers list
- No UI to add/configure custom providers
Current Workaround
Users must manually create/edit opencode.json:
{
"provider": {
"my-custom-provider": {
"name": "My Custom Provider",
"api": "https://api.example.com/v1",
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "key-here",
"baseURL": "https://api.example.com/v1"
},
"models": {
"model-id": {
"id": "model-id",
"name": "Model Name",
"temperature": true,
"tool_call": true,
"cost": {
"input": 0.0001,
"output": 0.0002
},
"limit": {
"context": 128000,
"output": 4096
}
}
}
}
}
}
Proposed Solution
Port the custom provider UI from packages/app to packages/kilo-vscode/webview-ui:
- Add
DialogCustomProvider component - Port from packages/app/src/components/dialog-custom-provider.tsx
- Update
ProvidersTab - Add a "Custom Provider" section similar to the web app
- Add necessary translations - Ensure all i18n keys exist in the VSCode webview translations
- Add backend integration - Use existing
handleUpdateConfig and auth endpoints
Implementation Notes
- The VSCode extension already has the necessary backend plumbing via
KiloProvider.handleUpdateConfig()
- The backend
/global/config endpoint supports updating provider configurations
- Auth can be set via the
/global/auth/set endpoint
- The UI should follow the same validation logic as the web app
Related Documentation
- OpenAI Compatible Providers docs
- Provider system implementation in
packages/opencode/src/provider/provider.ts
- Config schema in
packages/opencode/src/config/config.ts
User Impact
High - This is a frequently requested feature that significantly improves the user experience for developers using:
- Local LLM setups
- Custom API gateways
- Enterprise deployments
- Self-hosted solutions
Problem
The VS Code extension currently lacks a UI for adding custom OpenAI-compatible providers, even though this functionality exists in the web/TUI application (
packages/app).Users must manually edit their
opencode.jsonconfiguration file to add OpenAI-compatible providers, which creates a poor user experience and friction for users who want to:Current State
Web/TUI App (
packages/app) ✅Has full UI support for custom providers:
dialog-custom-provider.tsx- Full form dialog with validationsettings-providers.tsx- Settings section with "Custom provider" button (line 212-234)Features:
{env:VAR}format)VS Code Extension (
packages/kilo-vscode) ❌Missing the custom provider UI:
ProvidersTab.tsxonly shows:Current Workaround
Users must manually create/edit
opencode.json:{ "provider": { "my-custom-provider": { "name": "My Custom Provider", "api": "https://api.example.com/v1", "npm": "@ai-sdk/openai-compatible", "options": { "apiKey": "key-here", "baseURL": "https://api.example.com/v1" }, "models": { "model-id": { "id": "model-id", "name": "Model Name", "temperature": true, "tool_call": true, "cost": { "input": 0.0001, "output": 0.0002 }, "limit": { "context": 128000, "output": 4096 } } } } } }Proposed Solution
Port the custom provider UI from
packages/apptopackages/kilo-vscode/webview-ui:DialogCustomProvidercomponent - Port frompackages/app/src/components/dialog-custom-provider.tsxProvidersTab- Add a "Custom Provider" section similar to the web apphandleUpdateConfigand auth endpointsImplementation Notes
KiloProvider.handleUpdateConfig()/global/configendpoint supports updating provider configurations/global/auth/setendpointRelated Documentation
packages/opencode/src/provider/provider.tspackages/opencode/src/config/config.tsUser Impact
High - This is a frequently requested feature that significantly improves the user experience for developers using: