Skip to content

Commit d935f69

Browse files
committed
wip
1 parent a9f7f4c commit d935f69

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

docs/cody/model-configuration/examples.mdx

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,74 @@ In the configuration above, we:
223223

224224
</Accordion>
225225

226-
<Accordion title="OpenAI"></Accordion>
226+
<Accordion title="OpenAI">
227+
228+
```json
229+
"modelConfiguration": {
230+
"sourcegraph": null,
231+
"providerOverrides": [
232+
{
233+
"id": "openai",
234+
"displayName": "OpenAI",
235+
"serverSideConfig": {
236+
"type": "openai",
237+
"accessToken": "token",
238+
"endpoint": "https://api.openai.com"
239+
}
240+
}
241+
],
242+
"modelOverrides": [
243+
{
244+
"modelRef": "openai::2024-02-01::gpt-4o",
245+
"displayName": "GPT-4o",
246+
"modelName": "gpt-4o",
247+
"capabilities": ["edit", "chat"],
248+
"category": "accuracy",
249+
"status": "stable",
250+
"tier": "pro",
251+
"contextWindow": {
252+
"maxInputTokens": 45000,
253+
"maxOutputTokens": 400
254+
}
255+
},
256+
{
257+
"modelRef": "openai::unknown::gpt-3.5-turbo-instruct",
258+
"displayName": "GPT-3.5 Turbo Instruct",
259+
"modelName": "gpt-3.5-turbo-instruct",
260+
"capabilities": ["autocomplete"],
261+
"category": "speed",
262+
"status": "stable",
263+
"tier": "free",
264+
"contextWindow": {
265+
"maxInputTokens": 7000,
266+
"maxOutputTokens": 400
267+
}
268+
}
269+
],
270+
"defaultModels": {
271+
"chat": "openai::2024-02-01::gpt-4o",
272+
"fastChat": "openai::2024-02-01::gpt-4o",
273+
"autocomplete": "openai::unknown::gpt-3.5-turbo-instruct"
274+
}
275+
}
276+
```
277+
278+
In the configuration above, we:
279+
280+
- Set up a provider override for OpenAI, routing requests for this provider directly to the specified OpenAI endpoint (bypassing Cody Gateway).
281+
- Add two OpenAI models:
282+
- `"openai::2024-02-01::gpt-4o"` with "edit" and "chat" capabiities - used for "chat" and "fastChat"
283+
- `"openai::unknown::gpt-3.5-turbo-instruct"` with "autocomplete" capability - used for "autocomplete".
284+
285+
</Accordion>
286+
227287
<Accordion title="Azure OpenAI"></Accordion>
228-
<Accordion title="Generic OpenAI-compatible"></Accordion>
288+
289+
<Accordion title="Generic OpenAI-compatible">
290+
291+
TODO
292+
293+
</Accordion>
229294

230295
<Accordion title="Google Vertex (Anthropic)"></Accordion>
231296
<Accordion title="Google Vertex (Gemini)"></Accordion>

0 commit comments

Comments
 (0)