TailraceTailrace
Reference@tailrace/ai-sdk

AI SDK

Reference for @tailrace/ai-sdk - wrap models and tools, fluent helpers, and streaming options.

@tailrace/ai-sdk integrates Tailrace with the Vercel AI SDK (ai@^5).

Install

pnpm add @tailrace/core @tailrace/ai-sdk ai

Peer dependency: ai@^5.

Exports

ExportDescription
withAiSdkAttach fluent model / tools to a Tailrace instance
wrapModelMiddleware wrapper for LanguageModelV2
wrapToolsType-preserving wrapper for a ToolSet
encodeModelProviderProvider string encoding for policy keys
AiSdkWrapOptionsShared options type
StreamBlockBehaviorStreaming output block modes

Types: TailraceWithAiSdk, AiSdkWrapOptions, StreamBlockBehavior.

Default behavior

With createTailrace() and no custom policy:

  • Secret-class entities → block
  • Email, phone, credit card, IBAN, SSN → tokenize
  • Model input block → throw before provider call
  • Model output block (stream default) → throw after hold-back scan

See @tailrace/core default policy for the full table.

See also

On this page