Skip to content

Overview ​

Halo AI SDK is a Cache-First Agent Framework for building AI applications with automatic prefix caching across multiple model providers.

What is Halo? ​

Halo gives you a single, unified API to build AI agents that work with DeepSeek, OpenAI, Anthropic, Gemini, and any OpenAI-compatible provider — while automatically maximizing cache hits to reduce latency and cost.

The core insight: separate stable content from dynamic content. Your system prompt, tool definitions, and few-shot examples form a stable "prefix" that never changes between turns. Only the conversation history changes. This separation lets providers cache the prefix, slashing token costs by up to 74%.

Why Halo? ​

HaloRaw API Calls
CachingAutomatic — stable prefix management built inManual — you must structure every request yourself
Tool Callsagent.run() — auto-loop with executorsManual loop — write your own while/tool/dispatch
Provider SwitchChange 1 line (new OpenAiAdapter(...))Rewrite all API call logic
StreamingtoDataStream() — useChat compatible out of the boxBuild SSE protocol yourself
Cost Trackingagent.stats.caching.estimatedSavingsUsdTrack manually from API responses
Keep-Aliveagent.keepAlive() — one callFigure out provider-specific ping strategy

Packages ​

PackageDescription
@halo-ai/coreHalo factory, HaloAgent, StablePrefix, MessageLog, types
@halo-ai/adaptersDeepSeekAdapter (more coming)
@halo-ai/streamtoDataStream, createHaloStream
@halo-ai/strategiesTruncateStrategy, BasicRepair

Supported Providers ​

ProviderAdapterCaching
DeepSeekDeepSeekAdapterPrefix (position 0)
OpenAICustom adapter (~30 lines)Automatic
AnthropicCustom adapter (~40 lines)cache_control breakpoints
GeminiCustom adapter (~50 lines)CachedContent resource
Kimi / GLM / MiniMaxOpenAI-compatible adapterProvider-dependent

Released under the MIT License.