|
| Configuration | Description |
|---|---|
| API Key | Required, get fromOpenAI, Azure OpenAI, Anthropic or other AI services |
| API Base URL | Optional, default to "https://api.openai.com/v1" |
| Model | Optional, default to "gpt-4o" |
Refer to the following sections for more details on configuring various AI services.
OpenAI
| Configuration | Example |
|---|---|
| API Key | your-api-key |
| Model | gpt-4o |
| API Base URL | https://api.openai.com/v1 (Optional) |
Ollama
Pull your image first from Ollama library and then setup the base URL and custom model.
| Configuration | Example |
|---|---|
| API Key | ollama (Optional) |
| Model | custom |
| Custom Model | qwen2.5 |
| API Base URL | http://localhost:11434/v1/ |
DeepSeek
Ollama provider:
| Configuration | Example |
|---|---|
| API Key | ollama (Optional) |
| Model | custom |
| Custom Model | deepseek-r1 |
| API Base URL | http://localhost:11434/v1/ |
DeepSeek provider:
| Configuration | Example |
|---|---|
| API Key | your-deepseek-key |
| Model | deepseek-reasoner |
| API Base URL | https://api.deepseek.com |
SiliconFlow (SiliconCloud) provider:
| Configuration | Example |
|---|---|
| API Key | your-siliconflow-key |
| Model | custom |
| Custom Model | deepseek-ai/DeepSeek-R1 |
| API Base URL | https://api.siliconflow.cn/v1 |
Azure AI Foundry provider:
| Configuration | Example |
|---|---|
| API Key | your-azure-ai-key |
| Model | DeepSeek-R1 |
| API Base URL | https://[endpoint-name].[region].models.ai.azure.com |
Anthropic Claude
| Configuration | Example |
|---|---|
| API Key | your-api-key |
| Model | claude-3-sonnet-20240229 |
| API Base URL | https://api.anthropic.com/v1 (Optional) |
Google Gemini
| Configuration | Example |
|---|---|
| API Key | your-api-key |
| Model | gemini-2.0-flash-thinking-exp-1219 |
| API Base URL | https://generativelanguage.googleapis.com/v1beta (Optional) |
Azure OpenAI
For Azure OpenAI Service, apiBaseUrl should be set to format https://[YOUR-ENDPOINT-NAME].openai.azure.com/openai/deployments/[YOUR-DEPLOYMENT-NAME].
| Configuration | Example |
|---|---|
| API Key | your-api-key |
| Model | gpt-4o |
| API Base URL | https://endpoint-name.openai.azure.com/openai/deployments/deployment-name |
Github Models
For Github Models, get your Github token from here.
| Configuration | Example |
|---|---|
| API Key | your-github-token |
| Model | o1 |
| API Base URL | https://models.inference.ai.azure.com |
OpenAI compatible Models
To use OpenAI compatible APIs, you need to set a custom model name: set model to "custom" and then specify your custom model name.
Example for groq:
| Configuration | Example |
|---|---|
| API Key | your-groq-key |
| Model | custom |
| Custom Model | mixtral-8x7b-32768 |
| API Base URL | https://api.groq.com/openai/v1 |
DeepClaude (DeepSeek + Claude)
| Configuration | Example |
|---|---|
| API Key | your-api-key |
| Model | claude-3-sonnet-20240229 |
| API Base URL | https://api.anthropic.com/v1 (Optional) |
| Reasoning API Key | your-deepseek-api-key |
| Reasoning Model | deepseek-reasoner (or deepseek-r1 regarding to your provider) |
| Reasoning API Base URL | https://api.deepseek.com (or your own base URL) |
Configurations
Full list of configuration options
| Setting | Default | Description |
|---|---|---|
chatgpt.gpt3.apiKey |
OpenAI API key.Get your API Key from OpenAI. | |
chatgpt.gpt3.apiBaseUrl |
https://api.openai.com/v1 |
Optional override for the OpenAI API base URL. If you customize it, please make sure you have the same format. e.g. starts with https:// without a trailing slash. The completions endpoint suffix is added internally, e.g. for reference: ${apiBaseUrl}/v1/completions |
chatgpt.gpt3.organization |
OpenAI Organization ID. | |
chatgpt.gpt3.model |
gpt-4o |
OpenAI models to use for your prompts.Documentation. If you face 400 Bad Request please make sure you are using the right model for your integration method. For local or self-hosted LLMs compatible with OpenAI, you can select custom and specify your custom model name in #chatgpt.gpt3.customModel#. |
chatgpt.gpt3.customModel |
Specify your custom model name here if you selected custom in #chatgpt.gpt3.model#. This allows you to use a custom model name for local or self-hosted LLMs compatible with OpenAI. |
|
chatgpt.gpt3.maxTokens |
1024 |
The maximum number of tokens to generate in the completion. |
chatgpt.gpt3.temperature |
1 |
What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. |
chatgpt.gpt3.top_p |
1 |
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. |
chatgpt.systemPrompt |
System prompts for the copilot. | |
chatgpt.gpt3.generateCode-enabled |
true |
Enable the code generation context menu item for the selected comment/code for Codex. |
chatgpt.gpt3.searchGrounding.enabled |
false |
Enable search grounding for Gemini model. Only available for Google Gemini models. |
chatgpt.promptPrefix.addTests |
Implement tests for the following code |
The prompt prefix used for adding tests for the selected code |
chatgpt.promptPrefix.addTests-enabled |
true |
Enable the prompt prefix used for adding tests for the selected code in the context menu |
chatgpt.promptPrefix.findProblems |
Find problems with the following code |
The prompt prefix used for finding problems for the selected code |
chatgpt.promptPrefix.findProblems-enabled |
true |
Enable the prompt prefix used for finding problems for the selected code in the context menu |
chatgpt.promptPrefix.optimize |
Optimize the following code |
The prompt prefix used for optimizing the selected code |
chatgpt.promptPrefix.optimize-enabled |
true |
Enable the prompt prefix used for optimizing the selected code in the context menu |
chatgpt.promptPrefix.explain |
Explain the following code |
The prompt prefix used for explaining the selected code |
chatgpt.promptPrefix.explain-enabled |
true |
Enable the prompt prefix used for explaining the selected code in the context menu |
chatgpt.promptPrefix.addComments |
Add comments for the following code |
The prompt prefix used for adding comments for the selected code |
chatgpt.promptPrefix.addComments-enabled |
true |
Enable the prompt prefix used for adding comments for the selected code in the context menu |
chatgpt.promptPrefix.completeCode |
Complete the following code |
The prompt prefix used for completing the selected code |
chatgpt.promptPrefix.completeCode-enabled |
true |
Enable the prompt prefix used for completing the selected code in the context menu |
chatgpt.promptPrefix.adhoc-enabled |
true |
Enable the prompt prefix used for adhoc command for the selected code in the context menu |
chatgpt.promptPrefix.customPrompt1 |
Your custom prompt 1. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt | |
chatgpt.promptPrefix.customPrompt1-enabled |
false |
Enable custom prompt 1. If you enable this item make sure to set this #chatgpt.promptPrefix.customPrompt1# |
chatgpt.promptPrefix.customPrompt2 |
Your custom prompt 2. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt | |
chatgpt.promptPrefix.customPrompt2-enabled |
false |
Enable custom prompt 2. If you enable this item make sure to set this #chatgpt.promptPrefix.customPrompt2# |
chatgpt.response.showNotification |
false |
Choose whether you'd like to receive a notification when ChatGPT bot responds to your query. |
chatgpt.response.autoScroll |
true |
Whenever there is a new question or response added to the conversation window, extension will automatically scroll to the bottom. You can change that behaviour by disabling this setting. |
How to install locally
Build and install locally
We highly recommend installing the extension directly from the VS Code Marketplace for the easiest setup and automatic updates. However, for advanced users, building and installing locally is also an option.
- Install
vsceif you don't have it on your machine (The Visual Studio Code Extension Manager)npm install --global vsce
- Run
vsce package - Follow the
<a href="https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix">instructions</a>and install manually.
npm run build
npm run package
code --uninstall-extension cweijan.openai-chat
code --install-extension openai-chat-*.vsix
Acknowledgement
AI Toolkit for TypeScript
This extension utilizes the AI Toolkit for TypeScript to seamlessly integrate with a variety of AI providers. This allows for flexible and robust AI functionality within the editor. We appreciate the work by Vercel in creating this valuable resource.
gencay/vscode-chatgpt
This extension is built on the widely-used gencay/vscode-chatgpt project, which has garnered over 500,000 downloads. We are deeply grateful for the foundation laid by the original author, Gencay, and the community that supported it.
Unfortunately, the original author has decided to stop maintaining the project, and the new recommended Genie AI extension is not open-source. This fork continues the development to keep the project open and accessible to everyone.
License
This project is released under ISC License - See LICENSE for details. Copyright notice and the respective permission notices must appear in all copies.
