Skip to content

Commit 621081c

Browse files
docs + add option for api key
1 parent 4f3eeb4 commit 621081c

File tree

9 files changed

+342
-12
lines changed

9 files changed

+342
-12
lines changed

docs/docs/configuration/language-model-providers.mdx

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ title: Language Model Providers
33
sidebarTitle: Language model providers
44
---
55

6+
import LanguageModelSchema from '/snippets/schemas/v3/languageModel.schema.mdx'
7+
8+
<Note>
9+
Looking to self-host your own model? Check out the [OpenAI Compatible](#openai-compatible) provider.
10+
</Note>
11+
612
To use [Ask Sourcebot](/docs/features/ask) you must define at least one Language Model Provider. These providers are defined within the [config file](/docs/configuration/config-file) you
713
provide Sourcebot.
814

@@ -45,7 +51,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
4551

4652
### Amazon Bedrock
4753

48-
[Vercel AI SDK Amazon Bedrock Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)
54+
[Vercel AI SDK Amazon Bedrock Docs](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)
4955

5056
```json wrap icon="code" Example config with Amazon Bedrock provider
5157
{
@@ -70,7 +76,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
7076

7177
### Anthropic
7278

73-
[Vercel AI SDK Anthropic Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/anthropic)
79+
[Vercel AI SDK Anthropic Docs](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic)
7480

7581
```json wrap icon="code" Example config with Anthropic provider
7682
{
@@ -91,7 +97,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
9197

9298
### Azure OpenAI
9399

94-
[Vercel AI SDK Azure OpenAI Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure)
100+
[Vercel AI SDK Azure OpenAI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/azure)
95101

96102
```json wrap icon="code" Example config with Azure AI provider
97103
{
@@ -114,7 +120,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
114120

115121
### Deepseek
116122

117-
[Vercel AI SDK Deepseek Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepseek)
123+
[Vercel AI SDK Deepseek Docs](https://ai-sdk.dev/providers/ai-sdk-providers/deepseek)
118124

119125
```json wrap icon="code" Example config with Deepseek provider
120126
{
@@ -135,7 +141,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
135141

136142
### Google Generative AI
137143

138-
[Vercel AI SDK Google Generative AI Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai)
144+
[Vercel AI SDK Google Generative AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai)
139145

140146
```json wrap icon="code" Example config with Google Generative AI provider
141147
{
@@ -159,7 +165,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
159165
<Note>If you're using an Anthropic model on Google Vertex, you must define a [Google Vertex Anthropic](#google-vertex-anthropic) provider instead</Note>
160166
<Note>The `credentials` paramater here expects a **path** to a [credentials](https://console.cloud.google.com/apis/credentials) file. This file **must be in a volume mounted by Sourcebot** for it to be readable.</Note>
161167

162-
[Vercel AI SDK Google Vertex AI Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-vertex)
168+
[Vercel AI SDK Google Vertex AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex)
163169

164170
```json wrap icon="code" Example config with Google Vertex provider
165171
{
@@ -185,7 +191,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
185191
<Note>The `credentials` paramater here expects a **path** to a [credentials](https://console.cloud.google.com/apis/credentials) file. This file **must be in a volume mounted by Sourcebot** for it to be readable.</Note>
186192

187193

188-
[Vercel AI SDK Google Vertex Anthropic Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-vertex#google-vertex-anthropic-provider-usage)
194+
[Vercel AI SDK Google Vertex Anthropic Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#google-vertex-anthropic-provider-usage)
189195

190196
```json wrap icon="code" Example config with Google Vertex Anthropic provider
191197
{
@@ -208,7 +214,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
208214

209215
### Mistral
210216

211-
[Vercel AI SDK Mistral Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/mistral)
217+
[Vercel AI SDK Mistral Docs](https://ai-sdk.dev/providers/ai-sdk-providers/mistral)
212218

213219
```json wrap icon="code" Example config with Mistral provider
214220
{
@@ -229,7 +235,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
229235

230236
### OpenAI
231237

232-
[Vercel AI SDK OpenAI Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/openai)
238+
[Vercel AI SDK OpenAI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/openai)
233239

234240
```json wrap icon="code" Example config with OpenAI provider
235241
{
@@ -248,9 +254,36 @@ For a detailed description of all the providers, please refer to the [schema](ht
248254
}
249255
```
250256

257+
### OpenAI Compatible
258+
259+
[Vercel AI SDK OpenAI Compatible Docs](https://ai-sdk.dev/providers/openai-compatible-providers)
260+
261+
The OpenAI compatible provider allows you to use any model that is compatible with the OpenAI [Chat Completions API](https://github.com/ollama/ollama/blob/main/docs/openai.md). This includes self-hosted tools like [Ollama](https://ollama.ai/) and [llama.cpp](https://github.com/ggerganov/llama.cpp).
262+
263+
```json wrap icon="code" Example config with OpenAI Compatible provider
264+
{
265+
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
266+
"models": [
267+
{
268+
"provider": "openai-compatible",
269+
"baseUrl": "BASE_URL_HERE",
270+
"model": "YOUR_MODEL_HERE",
271+
"displayName": "OPTIONAL_DISPLAY_NAME",
272+
"token": {
273+
"env": "OPTIONAL_API_KEY"
274+
}
275+
}
276+
]
277+
}
278+
```
279+
280+
<Accordion title="Troubleshooting">
281+
- When using [llama.cpp](https://github.com/ggml-org/llama.cpp), if you hit "Failed after 3 attempts. Last error: tools param requires --jinja flag", add the `--jinja` flag to your `llama-server` command.
282+
</Accordion>
283+
251284
### OpenRouter
252285

253-
[Vercel AI SDK OpenRouter Docs](https://v5.ai-sdk.dev/providers/community-providers/openrouter)
286+
[Vercel AI SDK OpenRouter Docs](https://ai-sdk.dev/providers/community-providers/openrouter)
254287

255288
```json wrap icon="code" Example config with OpenRouter provider
256289
{
@@ -271,7 +304,7 @@ For a detailed description of all the providers, please refer to the [schema](ht
271304

272305
### xAI
273306

274-
[Vercel AI SDK xAI Docs](https://v5.ai-sdk.dev/providers/ai-sdk-providers/xai)
307+
[Vercel AI SDK xAI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/xai)
275308

276309
```json wrap icon="code" Example config with xAI provider
277310
{
@@ -288,4 +321,14 @@ For a detailed description of all the providers, please refer to the [schema](ht
288321
}
289322
]
290323
}
291-
```
324+
```
325+
326+
327+
## Schema reference
328+
329+
<Accordion title="Reference">
330+
[schemas/v3/languageModel.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/languageModel.json)
331+
332+
<LanguageModelSchema />
333+
334+
</Accordion>

docs/snippets/schemas/v3/index.schema.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,37 @@
18001800
"type": "string",
18011801
"description": "Optional display name."
18021802
},
1803+
"token": {
1804+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
1805+
"anyOf": [
1806+
{
1807+
"type": "object",
1808+
"properties": {
1809+
"secret": {
1810+
"type": "string",
1811+
"description": "The name of the secret that contains the token."
1812+
}
1813+
},
1814+
"required": [
1815+
"secret"
1816+
],
1817+
"additionalProperties": false
1818+
},
1819+
{
1820+
"type": "object",
1821+
"properties": {
1822+
"env": {
1823+
"type": "string",
1824+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
1825+
}
1826+
},
1827+
"required": [
1828+
"env"
1829+
],
1830+
"additionalProperties": false
1831+
}
1832+
]
1833+
},
18031834
"baseUrl": {
18041835
"type": "string",
18051836
"format": "url",
@@ -2572,6 +2603,37 @@
25722603
"type": "string",
25732604
"description": "Optional display name."
25742605
},
2606+
"token": {
2607+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
2608+
"anyOf": [
2609+
{
2610+
"type": "object",
2611+
"properties": {
2612+
"secret": {
2613+
"type": "string",
2614+
"description": "The name of the secret that contains the token."
2615+
}
2616+
},
2617+
"required": [
2618+
"secret"
2619+
],
2620+
"additionalProperties": false
2621+
},
2622+
{
2623+
"type": "object",
2624+
"properties": {
2625+
"env": {
2626+
"type": "string",
2627+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
2628+
}
2629+
},
2630+
"required": [
2631+
"env"
2632+
],
2633+
"additionalProperties": false
2634+
}
2635+
]
2636+
},
25752637
"baseUrl": {
25762638
"type": "string",
25772639
"format": "url",

docs/snippets/schemas/v3/languageModel.schema.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,37 @@
638638
"type": "string",
639639
"description": "Optional display name."
640640
},
641+
"token": {
642+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
643+
"anyOf": [
644+
{
645+
"type": "object",
646+
"properties": {
647+
"secret": {
648+
"type": "string",
649+
"description": "The name of the secret that contains the token."
650+
}
651+
},
652+
"required": [
653+
"secret"
654+
],
655+
"additionalProperties": false
656+
},
657+
{
658+
"type": "object",
659+
"properties": {
660+
"env": {
661+
"type": "string",
662+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
663+
}
664+
},
665+
"required": [
666+
"env"
667+
],
668+
"additionalProperties": false
669+
}
670+
]
671+
},
641672
"baseUrl": {
642673
"type": "string",
643674
"format": "url",
@@ -1410,6 +1441,37 @@
14101441
"type": "string",
14111442
"description": "Optional display name."
14121443
},
1444+
"token": {
1445+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
1446+
"anyOf": [
1447+
{
1448+
"type": "object",
1449+
"properties": {
1450+
"secret": {
1451+
"type": "string",
1452+
"description": "The name of the secret that contains the token."
1453+
}
1454+
},
1455+
"required": [
1456+
"secret"
1457+
],
1458+
"additionalProperties": false
1459+
},
1460+
{
1461+
"type": "object",
1462+
"properties": {
1463+
"env": {
1464+
"type": "string",
1465+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
1466+
}
1467+
},
1468+
"required": [
1469+
"env"
1470+
],
1471+
"additionalProperties": false
1472+
}
1473+
]
1474+
},
14131475
"baseUrl": {
14141476
"type": "string",
14151477
"format": "url",

packages/schemas/src/v3/index.schema.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,37 @@ const schema = {
17991799
"type": "string",
18001800
"description": "Optional display name."
18011801
},
1802+
"token": {
1803+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
1804+
"anyOf": [
1805+
{
1806+
"type": "object",
1807+
"properties": {
1808+
"secret": {
1809+
"type": "string",
1810+
"description": "The name of the secret that contains the token."
1811+
}
1812+
},
1813+
"required": [
1814+
"secret"
1815+
],
1816+
"additionalProperties": false
1817+
},
1818+
{
1819+
"type": "object",
1820+
"properties": {
1821+
"env": {
1822+
"type": "string",
1823+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
1824+
}
1825+
},
1826+
"required": [
1827+
"env"
1828+
],
1829+
"additionalProperties": false
1830+
}
1831+
]
1832+
},
18021833
"baseUrl": {
18031834
"type": "string",
18041835
"format": "url",
@@ -2571,6 +2602,37 @@ const schema = {
25712602
"type": "string",
25722603
"description": "Optional display name."
25732604
},
2605+
"token": {
2606+
"description": "Optional API key. If specified, adds an `Authorization` header to request headers with the value Bearer <token>.",
2607+
"anyOf": [
2608+
{
2609+
"type": "object",
2610+
"properties": {
2611+
"secret": {
2612+
"type": "string",
2613+
"description": "The name of the secret that contains the token."
2614+
}
2615+
},
2616+
"required": [
2617+
"secret"
2618+
],
2619+
"additionalProperties": false
2620+
},
2621+
{
2622+
"type": "object",
2623+
"properties": {
2624+
"env": {
2625+
"type": "string",
2626+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
2627+
}
2628+
},
2629+
"required": [
2630+
"env"
2631+
],
2632+
"additionalProperties": false
2633+
}
2634+
]
2635+
},
25742636
"baseUrl": {
25752637
"type": "string",
25762638
"format": "url",

0 commit comments

Comments
 (0)