Using GCP Vertex AI With Teklrn AI

Teklrn AI supports accessing models through Google Cloud Platform's Vertex AI, a managed machine learning platform that provides access to various foundation models, including Anthropic's Claude family.

Website: https://cloud.google.com/vertex-ai

Prerequisites

  • Google Cloud Account: You need an active Google Cloud Platform (GCP) account.
  • Project: You need a GCP project with the Vertex AI API enabled.
  • Model Access: You must request and be granted access to the specific Claude models on Vertex AI you want to use. See the Google Cloud documentation for instructions.
  • Service Account Key: To connect the VS Code extension, generate a JSON key for a service account that can access Vertex AI. See the Google Cloud documentation on creating service account keys.
  • Application Default Credentials (CLI option): To use ADC with the CLI, install the Google Cloud CLI and run gcloud auth application-default login.

Configuration in Teklrn AI

  1. Open Settings and select Providers.
  2. Find Google Vertex AI and select Connect.
  3. Paste the complete service account JSON into Service-account JSON.
  4. Enter a Google Cloud project ID only if you want to override the project_id in the JSON.
  5. Enter the Vertex AI location, such as us-central1 or global.
  6. Select Submit.

The extension stores the service account JSON in Teklrn's credential store, not in Teklrn.json. The JSON is visible while you edit it so you can verify the value before connecting.

⚠️Warning

Treat service account JSON like a password. Do not share it or commit it to source control.

Tips and Notes

  • Permissions: Ensure your Google Cloud account has the necessary permissions to access Vertex AI and the specific models you want to use.
  • Prompt caching: Claude models served through Vertex AI support Teklrn prompt caching. Teklrn applies Anthropic cache controls and tracks cache write/read tokens when Vertex reports them. Native Vertex Gemini models use Google's implicit server-side caching; no extra Teklrn configuration is required, and Gemini may not report cache write tokens.
  • Pricing: Refer to the Vertex AI pricing page for details.