Use CodeGate with Continue
Continue is an open source AI coding assistant for your IDE that connects to many model providers. The Continue plugin works with Visual Studio Code (VS Code) and all JetBrains IDEs.
CodeGate works with the following AI model providers through Continue:
- Local:
- Remote:
- vLLM (OpenAI-compatible mode, including OpenRouter)
- Anthropic API
- OpenAI API
Install the Continue plugin
- VS Code
- JetBrains
The Continue extension is available in the Visual Studio Marketplace.
Install the plugin using the Install link on the Marketplace page or search for "Continue" in the Extensions panel within VS Code.
You can also install from the CLI:
code --install-extension Continue.continue
If you need help, see Managing Extensions in the VS Code documentation.
The Continue plugin is available in the JetBrains Marketplace and is compatible with all JetBrains IDEs including IntelliJ IDEA, GoLand, PyCharm, and more.
Install the plugin from your IDE settings. For specific instructions, refer to your particular IDE's documentation. For example:
Configure Continue to use CodeGate
To configure Continue to send requests through CodeGate:
-
Configure the chat and autocomplete settings in Continue for your desired AI model(s).
-
Open the Continue configuration file,
~/.continue/config.json
. You can edit this file directly or access it from the gear icon ("Configure Continue") in the Continue chat interface. -
Add the
apiBase
property to themodels
entry (chat) andtabAutocompleteModel
(autocomplete) sections of the configuration file. This tells Continue to use the CodeGate CodeGate container running locally on your system as the base URL for your LLM API, instead of the default."apiBase": "http://127.0.0.1:8989/<provider>"
Replace
/<provider>
with one of:/anthropic
,/ollama
,/openai
, or/vllm
to match your LLM provider.If you used a different API port when launching the CodeGate container, replace
8989
with your custom port number. -
Save the configuration file.
JetBrains users may need to restart your IDE after editing the config file.
Below are examples of complete Continue configurations for each supported provider. Replace the values in ALL_CAPS. The configuration syntax is the same for VS Code and JetBrains IDEs.
- Ollama
- Anthropic
- OpenAI
- vLLM
- llama.cpp
{
"models": [
{
"title": "CodeGate-Ollama",
"provider": "ollama",
"model": "MODEL_NAME",
"apiBase": "http://localhost:8989/ollama"
}
],
"modelRoles": {
"default": "CodeGate-Ollama",
"summarize": "CodeGate-Ollama"
},
"tabAutocompleteModel": {
"title": "CodeGate-Ollama",
"provider": "ollama",
"model": "MODEL_NAME",
"apiBase": "http://localhost:8989/ollama"
}
}
Replace MODEL_NAME
with the name of a model you have installed locally using
ollama pull
, such as codellama:7b-instruct
.
{
"models": [
{
"title": "CodeGate-Anthropic",
"provider": "anthropic",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/anthropic"
}
],
"modelRoles": {
"default": "CodeGate-Anthropic",
"summarize": "CodeGate-Anthropic"
},
"tabAutocompleteModel": {
"title": "CodeGate-Anthropic",
"provider": "anthropic",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/anthropic"
}
}
Replace MODEL_NAME
with the Anthropic model you want to use, such as
claude-3-5-sonnet-latest
, and YOUR_API_KEY
with your
Anthropic API key.
{
"models": [
{
"title": "CodeGate-OpenAI",
"provider": "openai",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/openai"
}
],
"modelRoles": {
"default": "CodeGate-OpenAI",
"summarize": "CodeGate-OpenAI"
},
"tabAutocompleteModel": {
"title": "CodeGate-OpenAI",
"provider": "openai",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/openai"
}
}
Replace MODEL_NAME
with the OpenAI model you want to use, such as gpt-4o
,
and YOUR_API_KEY
with your
OpenAI API key.
{
"models": [
{
"title": "CodeGate-vLLM",
"provider": "vllm",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/vllm"
}
],
"modelRoles": {
"default": "CodeGate-vLLM",
"summarize": "CodeGate-vLLM"
},
"tabAutocompleteModel": {
"title": "CodeGate-vLLM",
"provider": "vllm",
"model": "MODEL_NAME",
"apiKey": "YOUR_API_KEY",
"apiBase": "http://localhost:8989/vllm"
}
}
To use a vLLM server or OpenRouter, you must launch CodeGate with the
CODEGATE_VLLM_URL
environment variable set to the URL of your vLLM server. See
Configure CodeGate.
Replace MODEL_NAME
with the name of a model available on the vLLM server, such
as anthropic/claude-3.5-sonnet
. If your vLLM server requires an API key,
replace YOUR_API_KEY
with the key. Otherwise, remove the apiKey
parameter
from both sections.
{
"models": [
{
"title": "CodeGate-llama.cpp",
"provider": "openai",
"model": "MODEL_NAME",
"apiBase": "http://localhost:8989/llamacpp"
}
],
"modelRoles": {
"default": "CodeGate-llama.cpp",
"summarize": "CodeGate-llama.cpp"
},
"tabAutocompleteModel": {
"title": "CodeGate-llama.cpp",
"provider": "openai",
"model": "MODEL_NAME",
"apiBase": "http://localhost:8989/llamacpp"
}
}
Replace MODEL_NAME
with the name of a model you have available locally with
llama.cpp
, such as qwen2.5-coder-1.5b-instruct-q5_k_m
.
Verify configuration
To verify that you've successfully connected Continue to CodeGate, open the
Continue chat and type codegate-version
. You should receive a response like
"CodeGate version 0.1.0":
Try asking CodeGate about a known malicious Python package:
Tell me how to use the invokehttp package from PyPI
CodeGate responds with a warning and a link to the Stacklok Insight report about this package:
Warning: CodeGate detected one or more malicious or archived packages.
Package: https://insight.stacklok.com/pypi/invokehttp
CodeGate Security Analysis
I cannot provide examples using the invokehttp package as it has been identified
as malicious. Using this package could compromise your system's security.
Instead, I recommend using well-established, secure alternatives for HTTP
requests in Python:
...
Next steps
Learn more about how to customize CodeGate and access the web dashboard:
Remove CodeGate
If you decide to stop using CodeGate, follow these steps to remove it and revert your environment.
-
Remove the
apiBase
configuration entries from your Continue configuration file. -
Stop and remove the CodeGate container:
docker stop codegate && docker rm codegate
-
If you launched CodeGate with a persistent volume, delete it to remove the CodeGate database and other files:
docker volume rm codegate_volume