| 1 | --- |
| 2 | title: "How to Configure Vertex AI with Continue" |
| 3 | slug: ../vertexai |
| 4 | description: "Configure Google Cloud's Vertex AI with Continue to access powerful models like Claude 3.5 Sonnet, Codestral, and text-embedding-004 for chat, autocomplete, and embeddings" |
| 5 | sidebarTitle: "Vertex AI" |
| 6 | --- |
| 7 | |
| 8 | <Info> |
| 9 | You need to enable the [Vertex AI |
| 10 | API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) |
| 11 | and set up the [Google Application Default |
| 12 | Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc). |
| 13 | </Info> |
| 14 | |
| 15 | ## How to Set Up Vertex AI Chat Models |
| 16 | |
| 17 | We recommend configuring **Claude 3.5 Sonnet** as your chat model. |
| 18 | |
| 19 | <Tabs> |
| 20 | <Tab title="YAML"> |
| 21 | ```yaml title="config.yaml" |
| 22 | models: |
| 23 | - name: Claude 3.5 Sonnet |
| 24 | provider: vertexai |
| 25 | model: claude-3-5-sonnet-20240620 |
| 26 | env: |
| 27 | projectId: <PROJECT_ID> |
| 28 | region: us-east5 |
| 29 | ``` |
| 30 | </Tab> |
| 31 | <Tab title="JSON"> |
| 32 | ```json title="config.json" |
| 33 | { |
| 34 | "models": [ |
| 35 | { |
| 36 | "title": "Claude 3.5 Sonnet", |
| 37 | "provider": "vertexai", |
| 38 | "model": "claude-3-5-sonnet-20240620", |
| 39 | "projectId": "[PROJECT_ID]", |
| 40 | "region": "us-east5" |
| 41 | } |
| 42 | ] |
| 43 | } |
| 44 | ``` |
| 45 | </Tab> |
| 46 | </Tabs> |
| 47 | |
| 48 | ## How to Set Up Vertex AI Autocomplete Models |
| 49 | |
| 50 | We recommend configuring **Codestral** or **code-gecko** as your autocomplete model. |
| 51 | |
| 52 | <Tabs> |
| 53 | <Tab title="YAML"> |
| 54 | ```yaml title="config.yaml" |
| 55 | models: |
| 56 | - name: Codestral (Vertex AI) |
| 57 | provider: vertexai |
| 58 | model: codestral |
| 59 | roles: |
| 60 | - autocomplete |
| 61 | env: |
| 62 | projectId: <PROJECT_ID> |
| 63 | region: us-central1 |
| 64 | |
| 65 | ``` |
| 66 | </Tab> |
| 67 | <Tab title="JSON"> |
| 68 | ```json title="config.json" |
| 69 | { |
| 70 | "tabAutocompleteModel": { |
| 71 | "title": "Codestral (Vertex AI)", |
| 72 | "provider": "vertexai", |
| 73 | "model": "codestral", |
| 74 | "projectId": "[PROJECT_ID]", |
| 75 | "region": "us-central1" |
| 76 | } |
| 77 | } |
| 78 | ``` |
| 79 | </Tab> |
| 80 | </Tabs> |
| 81 | |
| 82 | ## How to Configure Vertex AI Embeddings Models |
| 83 | |
| 84 | We recommend configuring **text-embedding-004** as your embeddings model. |
| 85 | |
| 86 | <Tabs> |
| 87 | <Tab title="YAML"> |
| 88 | ```yaml title="config.yaml" |
| 89 | models: |
| 90 | - name: Text Embedding-004 |
| 91 | provider: vertexai |
| 92 | model: text-embedding-004 |
| 93 | env: |
| 94 | projectId: <PROJECT_ID> |
| 95 | region: us-central1 |
| 96 | roles: |
| 97 | - embed |
| 98 | ``` |
| 99 | </Tab> |
| 100 | <Tab title="JSON"> |
| 101 | ```json title="config.json" |
| 102 | { |
| 103 | "embeddingsProvider": { |
| 104 | "provider": "vertexai", |
| 105 | "model": "text-embedding-004", |
| 106 | "projectId": "[PROJECT_ID]", |
| 107 | "region": "us-central1" |
| 108 | } |
| 109 | } |
| 110 | ``` |
| 111 | </Tab> |
| 112 | </Tabs> |
| 113 | |
| 114 | ## How to Configure Vertex AI Reranking Models |
| 115 | |
| 116 | Vertex AI currently does not offer any reranking models. |
| 117 | |
| 118 | [Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. |
| 119 | |
| 120 | ## How to Enable Vertex AI Express Mode |
| 121 | |
| 122 | You can use VertexAI in [express mode](https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview) by only providing an API Key. Only some Gemini models are supported in express mode for now. |
| 123 | |
| 124 | <Tabs groupId="config-example"> |
| 125 | <TabItem value="yaml" label="YAML"> |
| 126 | ```yaml title="config.yaml" |
| 127 | models: |
| 128 | - name: Gemini 2.5 Flash - VertexAI |
| 129 | provider: vertexai |
| 130 | model: gemini-2.5-flash |
| 131 | apiKey: ${{ secrets.GOOGLE_CLOUD_API_KEY }} |
| 132 | ``` |
| 133 | </TabItem> |
| 134 | <TabItem value="json" label="JSON"> |
| 135 | ```json title="config.json" |
| 136 | { |
| 137 | "models": [ |
| 138 | { |
| 139 | "title": "Gemini 2.5 Flash - VertexAI", |
| 140 | "provider": "vertexai", |
| 141 | "model": "gemini-2.5-flash", |
| 142 | "apiKey": "[YOUR_GOOGLE_CLOUD_API_KEY]", |
| 143 | } |
| 144 | ] |
| 145 | } |
| 146 | ``` |
| 147 | </TabItem> |
| 148 | </Tabs> |