Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Added

- Adds the ability to search for GitHub Enterprise and GitLab Self-Managed pull requests by URL in the main step of Launchpad
- Adds OpenRouter support for GitLens' AI features ([#3906](https://github.com/gitkraken/vscode-gitlens/issues/3906))
- Adds Ollama and OpenRouter support for GitLens' AI features ([#3311](https://github.com/gitkraken/vscode-gitlens/issues/3311), [#3906](https://github.com/gitkraken/vscode-gitlens/issues/3906))
- Adds Google Gemini 2.5 Flash (Preview) model, and OpenAI GPT-4.1, GPT-4.1 mini, GPT-4.1 nano, o4 mini, and o3 models for GitLens' AI features ([#4235](https://github.com/gitkraken/vscode-gitlens/issues/4235))
- Adds _Open File at Revision from Remote_ command to open the specific file revision from a remote file URL

Expand Down
14 changes: 7 additions & 7 deletions docs/telemetry-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand Down Expand Up @@ -155,7 +155,7 @@
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand Down Expand Up @@ -185,7 +185,7 @@ or
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand Down Expand Up @@ -214,7 +214,7 @@ or
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand Down Expand Up @@ -243,7 +243,7 @@ or
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand Down Expand Up @@ -272,7 +272,7 @@ or
'failed.reason': 'user-declined' | 'user-cancelled' | 'error',
'input.length': number,
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string,
'output.length': number,
'retry.count': number,
Expand All @@ -295,7 +295,7 @@ or
```typescript
{
'model.id': string,
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.id': 'anthropic' | 'deepseek' | 'gemini' | 'github' | 'gitkraken' | 'huggingface' | 'ollama' | 'openai' | 'openrouter' | 'vscode' | 'xai',
'model.provider.name': string
}
```
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4047,7 +4047,7 @@
"null"
],
"default": null,
"pattern": "^((anthropic|deepseek|gemini|github|huggingface|openai|xai):([\\w.-]+)|gitkraken|vscode)$",
"pattern": "^((anthropic|deepseek|gemini|github|huggingface|ollama|openai|openrouter|xai):([\\w.-:]+)|gitkraken|vscode)$",
"markdownDescription": "Specifies the AI provider and model to use for GitLens' AI features. Should be formatted as `provider:model` (e.g. `openai:gpt-4o` or `anthropic:claude-3-5-sonnet-latest`), `gitkraken` for GitKraken AI provided models, or `vscode` for models provided by the VS Code extension API (e.g. Copilot)",
"scope": "window",
"order": 10,
Expand Down Expand Up @@ -4083,6 +4083,19 @@
"preview"
]
},
"gitlens.ai.ollama.url": {
"type": [
"string",
"null"
],
"default": null,
"markdownDescription": "Specifies the Ollama URL to use for access",
"scope": "window",
"order": 30,
"tags": [
"preview"
]
},
"gitlens.ai.openai.url": {
"type": [
"string",
Expand All @@ -4091,7 +4104,7 @@
"default": null,
"markdownDescription": "Specifies a custom URL to use for access to an OpenAI model via Azure. Azure URLs should be in the following format: https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}",
"scope": "window",
"order": 30,
"order": 31,
"tags": [
"preview"
]
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ interface AIConfig {
readonly modelOptions: {
readonly temperature: number;
};
readonly ollama: {
readonly url: string | null;
};
readonly openai: {
readonly url: string | null;
};
Expand Down
8 changes: 8 additions & 0 deletions src/constants.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type AIProviders =
| 'github'
| 'gitkraken'
| 'huggingface'
| 'ollama'
| 'openai'
| 'openrouter'
| 'vscode'
Expand Down Expand Up @@ -86,3 +87,10 @@ export const openRouterProviderDescriptor: AIProviderDescriptor<'openrouter'> =
requiresAccount: true,
requiresUserKey: true,
} as const;
export const ollamaProviderDescriptor: AIProviderDescriptor<'ollama'> = {
id: 'ollama',
name: 'Ollama',
primary: false,
requiresAccount: false,
requiresUserKey: false,
} as const;
8 changes: 8 additions & 0 deletions src/plus/ai/aiProviderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
githubProviderDescriptor,
gitKrakenProviderDescriptor,
huggingFaceProviderDescriptor,
ollamaProviderDescriptor,
openAIProviderDescriptor,
openRouterProviderDescriptor,
vscodeProviderDescriptor,
Expand Down Expand Up @@ -183,6 +184,13 @@ const supportedAIProviders = new Map<AIProviders, AIProviderDescriptorWithType>(
),
},
],
[
'ollama',
{
...ollamaProviderDescriptor,
type: lazy(async () => (await import(/* webpackChunkName: "ai" */ './ollamaProvider')).OllamaProvider),
},
],
]);

export class AIProviderService implements Disposable {
Expand Down
Loading