|
1 | 1 | ---
|
2 | 2 | title: Language Model Providers
|
3 | 3 | sidebarTitle: Language model providers
|
4 |
| ---- |
| 4 | +--- |
| 5 | + |
| 6 | +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 |
| 7 | +provide Sourcebot. |
| 8 | + |
| 9 | + |
| 10 | +```json wrap icon="code" Example config with language model provider |
| 11 | +{ |
| 12 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 13 | + "models": [ |
| 14 | + // 1. Google Vertex config for Gemini 2.5 Pro |
| 15 | + { |
| 16 | + "provider": "google-vertex", |
| 17 | + "model": "gemini-2.5-pro", |
| 18 | + "displayName": "Gemini 2.5 Pro", |
| 19 | + "project": "sourcebot", |
| 20 | + "credentials": { |
| 21 | + "env": "GOOGLE_APPLICATION_CREDENTIALS" |
| 22 | + } |
| 23 | + }, |
| 24 | + // 2. OpenAI config for o3 |
| 25 | + { |
| 26 | + "provider": "openai", |
| 27 | + "model": "o3", |
| 28 | + "displayName": "o3", |
| 29 | + "token": { |
| 30 | + "env": "OPENAI_API_KEY" |
| 31 | + } |
| 32 | + } |
| 33 | + ] |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +# Supported Providers |
| 38 | + |
| 39 | +Sourcebot uses the [Vercel AI SDK](https://ai-sdk.dev/docs/introduction), so it can integrate with any provider the SDK supports. If you don't see your provider below please submit |
| 40 | +a [feature request](https://github.com/sourcebot-dev/sourcebot/discussions/categories/feature-requests). |
| 41 | + |
| 42 | +For a detailed description of all the providers, please refer to the [schema](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/languageModel.json). |
| 43 | + |
| 44 | +<Note>Any parameter defined using `env` will read the value from the corresponding environment variable you provide Sourcebot</Note> |
| 45 | + |
| 46 | +### Amazon Bedrock |
| 47 | + |
| 48 | +[Vercel AI SDK Amazon Bedrock Docs](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock) |
| 49 | + |
| 50 | +```json wrap icon="code" Example config with Amazon Bedrock provider |
| 51 | +{ |
| 52 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 53 | + "models": [ |
| 54 | + { |
| 55 | + "provider": "amazon-bedrock", |
| 56 | + "model": "YOUR_MODEL_HERE", |
| 57 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 58 | + "accessKeyId": { |
| 59 | + "env": "AWS_ACCESS_KEY_ID" |
| 60 | + }, |
| 61 | + "accessKeySecret": { |
| 62 | + "env": "AWS_SECRET_ACCESS_KEY" |
| 63 | + }, |
| 64 | + "region": "YOUR_REGION_HERE", // defaults to the AWS_REGION env var if not set |
| 65 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 66 | + } |
| 67 | + ] |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | +### Anthropic |
| 72 | + |
| 73 | +[Vercel AI SDK Anthropic Docs](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic) |
| 74 | + |
| 75 | +```json wrap icon="code" Example config with Anthropic provider |
| 76 | +{ |
| 77 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 78 | + "models": [ |
| 79 | + { |
| 80 | + "provider": "anthropic", |
| 81 | + "model": "YOUR_MODEL_HERE", |
| 82 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 83 | + "token": { |
| 84 | + "env": "ANTHROPIC_API_KEY" |
| 85 | + }, |
| 86 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 87 | + } |
| 88 | + ] |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +### Google Generative AI |
| 93 | + |
| 94 | +[Vercel AI SDK Google Generative AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai) |
| 95 | + |
| 96 | +```json wrap icon="code" Example config with Google Generative AI provider |
| 97 | +{ |
| 98 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 99 | + "models": [ |
| 100 | + { |
| 101 | + "provider": "google-generative-ai", |
| 102 | + "model": "YOUR_MODEL_HERE", |
| 103 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 104 | + "token": { |
| 105 | + "env": "GOOGLE_GENERATIVE_AI_API_KEY" |
| 106 | + }, |
| 107 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 108 | + } |
| 109 | + ] |
| 110 | +} |
| 111 | +``` |
| 112 | + |
| 113 | +### Google Vertex |
| 114 | + |
| 115 | +<Note>If you're using an Anthropic model on Google Vertex, you must define a [Google Vertex Anthropic](#google-vertex-anthropic) provider instead</Note> |
| 116 | +<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> |
| 117 | + |
| 118 | +[Vercel AI SDK Google Vertex AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex) |
| 119 | + |
| 120 | +```json wrap icon="code" Example config with Google Vertex provider |
| 121 | +{ |
| 122 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 123 | + "models": [ |
| 124 | + { |
| 125 | + "provider": "google-vertex", |
| 126 | + "model": "YOUR_MODEL_HERE", // e.g., "gemini-2.0-flash-exp", "gemini-1.5-pro", "gemini-1.5-flash" |
| 127 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 128 | + "project": "YOUR_PROJECT_ID", // defaults to the GOOGLE_VERTEX_PROJECT env var if not set |
| 129 | + "region": "YOUR_REGION_HERE", // defaults to the GOOGLE_VERTEX_REGION env var if not set, e.g., "us-central1", "us-east1", "europe-west1" |
| 130 | + "credentials": { |
| 131 | + "env": "GOOGLE_APPLICATION_CREDENTIALS" |
| 132 | + }, |
| 133 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 134 | + } |
| 135 | + ] |
| 136 | +} |
| 137 | +``` |
| 138 | + |
| 139 | +### Google Vertex Anthropic |
| 140 | + |
| 141 | +<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> |
| 142 | + |
| 143 | + |
| 144 | +[Vercel AI SDK Google Vertex Anthropic Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#google-vertex-anthropic-provider-usage) |
| 145 | + |
| 146 | +```json wrap icon="code" Example config with Google Vertex Anthropic provider |
| 147 | +{ |
| 148 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 149 | + "models": [ |
| 150 | + { |
| 151 | + "provider": "google-vertex-anthropic", |
| 152 | + "model": "YOUR_MODEL_HERE", // e.g., "claude-sonnet-4" |
| 153 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 154 | + "project": "YOUR_PROJECT_ID", // defaults to the GOOGLE_VERTEX_PROJECT env var if not set |
| 155 | + "region": "YOUR_REGION_HERE", // defaults to the GOOGLE_VERTEX_REGION env var if not set, e.g., "us-central1", "us-east1", "europe-west1" |
| 156 | + "credentials": { |
| 157 | + "env": "GOOGLE_APPLICATION_CREDENTIALS" |
| 158 | + }, |
| 159 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 160 | + } |
| 161 | + ] |
| 162 | +} |
| 163 | +``` |
| 164 | + |
| 165 | +### OpenAI |
| 166 | + |
| 167 | +[Vercel AI SDK OpenAI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/openai) |
| 168 | + |
| 169 | +```json wrap icon="code" Example config with OpenAI provider |
| 170 | +{ |
| 171 | + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", |
| 172 | + "models": [ |
| 173 | + { |
| 174 | + "provider": "openai", |
| 175 | + "model": "YOUR_MODEL_HERE", // e.g., "gpt-4.1", "o4-mini", "o3", "o3-deep-research" |
| 176 | + "displayName": "OPTIONAL_DISPLAY_NAME", |
| 177 | + "token": { |
| 178 | + "env": "OPENAI_API_KEY" |
| 179 | + }, |
| 180 | + "baseUrl": "OPTIONAL_BASE_URL" |
| 181 | + } |
| 182 | + ] |
| 183 | +} |
| 184 | +``` |
0 commit comments