Skip to content

DeepSeekAdapter ​

Built-in adapter for the DeepSeek API. Supports prefix caching, tool use, and streaming.

Import ​

ts
import { DeepSeekAdapter } from "@halo-ai/adapters";

Constructor ​

ts
new DeepSeekAdapter(opts: {
  apiKey: string;
  model?: string;       // default: "deepseek-v4-flash"
  baseUrl?: string;     // default: "https://api.deepseek.com"
})

Properties ​

PropertyValueDescription
modelId"deepseek-v4-flash"Default model
contextWindow128_000Token limit
capabilities.toolUsetrueTool calling supported
capabilities.streamingtrueStreaming supported
pricing.inputPricePer1k0.00027$/1K input tokens
pricing.cachedInputPricePer1k0.00007$/1K cached input tokens

Caching ​

DeepSeek automatically caches the prefix (position 0 in the message array). The adapter sends messages as [...prefix, ...history], placing the stable prefix first for automatic cache detection.

Released under the MIT License.