Liking cljdoc? Tell your friends :D

llm.sdk.providers.anthropic.vertex

Vertex AI Anthropic (Claude) transport adapter.

Claude models served through Google Vertex AI speak the same Messages API as the native Anthropic endpoint, with three differences:

  1. Endpoint — POST to the regional aiplatform host under /publishers/anthropic/models/{model}:rawPredict (unary) or :streamRawPredict (SSE), with the model in the URL path.
  2. Auth — GCP OAuth bearer token (ADC chain via llm.sdk.gcp-auth) instead of an x-api-key header.
  3. Body — the model is dropped from the JSON body and replaced by "anthropic_version": "vertex-2023-10-16"; streaming calls add "stream": true.

Everything else (message/tool/cache/thinking shaping, response and stream parsing) is reused verbatim from llm.sdk.providers.anthropic.chat so the two backends stay in lockstep.

Project resolution: request provider-options [:vertex :project] > profile quirks :vertex-project > GOOGLE_CLOUD_PROJECT env > SA JSON project_id. Location: provider-options [:vertex :location] > profile quirks :vertex-location > GOOGLE_CLOUD_LOCATION env > us-central1.

Vertex AI Anthropic (Claude) transport adapter.

Claude models served through Google Vertex AI speak the same Messages
API as the native Anthropic endpoint, with three differences:

  1. Endpoint — POST to the regional aiplatform host under
     /publishers/anthropic/models/{model}:rawPredict (unary) or
     :streamRawPredict (SSE), with the model in the URL path.
  2. Auth — GCP OAuth bearer token (ADC chain via llm.sdk.gcp-auth)
     instead of an x-api-key header.
  3. Body — the model is dropped from the JSON body and replaced by
     "anthropic_version": "vertex-2023-10-16"; streaming calls add
     "stream": true.

Everything else (message/tool/cache/thinking shaping, response and
stream parsing) is reused verbatim from llm.sdk.providers.anthropic.chat
so the two backends stay in lockstep.

Project resolution: request provider-options [:vertex :project] >
profile quirks :vertex-project > GOOGLE_CLOUD_PROJECT env > SA JSON
project_id. Location: provider-options [:vertex :location] > profile
quirks :vertex-location > GOOGLE_CLOUD_LOCATION env > us-central1.
raw docstring

build-request-vertex-anthropicclj

(build-request-vertex-anthropic profile request)
source

make-transportclj

(make-transport)
source

parse-error-vertex-anthropicclj

(parse-error-vertex-anthropic _profile status body)
source

parse-response-vertex-anthropicclj

(parse-response-vertex-anthropic profile raw)
source

parse-stream-event-vertex-anthropicclj

(parse-stream-event-vertex-anthropic profile line)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close