Skip to content

Commit 0fd1594

Browse files
authored
Merge pull request #8832 from uinstinct/gpt-5.1-support
chore: add support for gpt 5.1
2 parents 3b7b21b + dacfee0 commit 0fd1594

File tree

8 files changed

+35
-11
lines changed

8 files changed

+35
-11
lines changed

core/llm/llms/CometAPI.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { LLMOptions } from "../../index.js";
21
import { allModelProviders } from "@continuedev/llm-info";
2+
import { LLMOptions } from "../../index.js";
33
import OpenAI from "./OpenAI.js";
44

55
/**
@@ -183,6 +183,7 @@ class CometAPI extends OpenAI {
183183
*/
184184
private static RECOMMENDED_MODELS = [
185185
// GPT series
186+
"gpt-5.1",
186187
"gpt-5-chat-latest",
187188
"chatgpt-4o-latest",
188189
"gpt-5-mini",

core/llm/toolSupport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export function isRecommendedAgentModel(modelName: string): boolean {
392392
[/o[134]/],
393393
[/deepseek/, /r1|reasoner/],
394394
[/gemini/, /2\.5/, /pro/],
395-
[/gpt-5/],
395+
[/gpt/, /-5|5\.1/],
396396
[/claude/, /sonnet/, /3\.7|3-7|-4/],
397397
[/claude/, /opus/, /-4/],
398398
[/grok-code/],

docs/customize/deep-dives/autocomplete.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ The `config.json` configuration format offers configuration options through `tab
163163

164164
## Autocomplete FAQs and Troubleshooting in Continue
165165

166-
### I want better completions, should I use GPT-4?
166+
### I want better completions, should I use GPT-5?
167167

168-
Perhaps surprisingly, the answer is no. The models that we suggest for autocomplete are trained with a highly specific prompt format, which allows them to respond to requests for completing code (see examples of these prompts [here](https://github.com/continuedev/continue/blob/main/core/autocomplete/templating/AutocompleteTemplate.ts)). Some of the best commercial models like GPT-4 or Claude are not trained with this prompt format, which means that they won't generate useful completions. Luckily, a huge model is not required for great autocomplete. Most of the state-of-the-art autocomplete models are no more than 10b parameters, and increasing beyond this does not significantly improve performance.
168+
Perhaps surprisingly, the answer is no. The models that we suggest for autocomplete are trained with a highly specific prompt format, which allows them to respond to requests for completing code (see examples of these prompts [here](https://github.com/continuedev/continue/blob/main/core/autocomplete/templating/AutocompleteTemplate.ts)). Some of the best commercial models like GPT-5 or Claude are not trained with this prompt format, which means that they won't generate useful completions. Luckily, a huge model is not required for great autocomplete. Most of the state-of-the-art autocomplete models are no more than 10b parameters, and increasing beyond this does not significantly improve performance.
169169

170170
### Autocomplete Not Working – How to Fix It
171171

docs/customize/deep-dives/model-capabilities.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ This matrix shows which models support tool use and image input capabilities. Co
171171

172172
| Model | Tool Use | Image Input | Context Window |
173173
| :------------ | -------- | ----------- | -------------- |
174+
| GPT-5.1 | Yes | No | 400k |
175+
| GPT-5 | Yes | No | 400k |
174176
| o3 | Yes | No | 128k |
175177
| o3-mini | Yes | No | 128k |
176178
| GPT-4o | Yes | Yes | 128k |

docs/customize/model-roles/chat.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ If you prefer to use an open-weight model, then the Gemma family of Models from
7676
</Tab>
7777
</Tabs>
7878
79-
### GPT-4o from OpenAI
79+
### GPT-5.1 from OpenAI
8080
81-
If you prefer to use a model from [OpenAI](../model-providers/top-level/openai), then we recommend GPT-4o.
81+
If you prefer to use a model from [OpenAI](../model-providers/top-level/openai), then we recommend GPT-5.1.
8282
8383
<Tabs>
8484
<Tab title="Hub">
85-
Add the [OpenAI GPT-4o block](https://hub.continue.dev/openai/gpt-4o) from the hub
85+
Add the [OpenAI GPT-5.1 block](https://hub.continue.dev/openai/gpt-5.1) from the hub
8686
</Tab>
8787
<Tab title="YAML">
8888
```yaml title="config.yaml"
8989
models:
90-
- name: GPT-4o
90+
- name: GPT-5.1
9191
provider: openai
92-
model: ''
92+
model: gpt-5.1
9393
apiKey: <YOUR_OPENAI_API_KEY>
9494
```
9595
</Tab>

gui/src/pages/AddNewModel/configs/models.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,18 @@ export const models: { [key: string]: ModelPackage } = {
11211121
icon: "openai.png",
11221122
isOpenSource: false,
11231123
},
1124+
gpt5_1: {
1125+
title: "GPT-5.1",
1126+
description: "OpenAI's GPT-5.1 model for advanced reasoning and chat",
1127+
params: {
1128+
model: "gpt-5.1",
1129+
contextLength: 400_000,
1130+
title: "GPT-5.1",
1131+
},
1132+
providerOptions: ["openai"],
1133+
icon: "openai.png",
1134+
isOpenSource: false,
1135+
},
11241136
gpt5Codex: {
11251137
title: "GPT-5 Codex",
11261138
description:

gui/src/pages/AddNewModel/configs/providers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ export const providers: Partial<Record<string, ProviderInfo>> = {
111111
openai: {
112112
title: "OpenAI",
113113
provider: "openai",
114-
description: "Use gpt-5, gpt-4, or any other OpenAI model",
114+
description: "Use gpt-5.1, gpt-5, gpt-4, or any other OpenAI model",
115115
longDescription:
116-
"Use gpt-5, gpt-4, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",
116+
"Use gpt-5.1, gpt-5, gpt-4, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",
117117
icon: "openai.png",
118118
tags: [ModelProviderTags.RequiresApiKey],
119119
packages: [
120120
models.gpt5,
121+
models.gpt5_1,
121122
models.gpt5Codex,
122123
models.gpt4o,
123124
models.gpt4omini,

packages/llm-info/src/providers/openai.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ export const OpenAi: ModelProvider = {
9292
regex: /gpt-5-codex/,
9393
recommendedFor: ["chat"],
9494
},
95+
{
96+
model: "gpt-5.1",
97+
displayName: "GPT-5.1",
98+
contextLength: 400000,
99+
maxCompletionTokens: 128000,
100+
regex: /^gpt-5\.1$/,
101+
recommendedFor: ["chat"],
102+
},
95103
// gpt-4o
96104
{
97105
model: "gpt-4o",

0 commit comments

Comments
 (0)