Skip to content

Why Halo? ​

Comparing Halo with other approaches to building AI agents.

Halo vs Raw API Calls ​

ts
// ❌ Raw API: manual cache management, DIY loop, no tracking
const messages = [
  { role: "system", content: "You are..." },
  ...toolsAsMessages,
  ...history,
];
const res = await fetch("https://api.deepseek.com/chat/completions", {
  body: JSON.stringify({ messages, tools }),
});
// Is caching working? No idea.
// Tool calls returned? Need to write the loop yourself.
// Cost tracking? Manually from usage fields.
ts
// ✅ Halo: automatic cache, agent loop, tracked stats
const agent = halo.agent({ system: "You are...", tools: { ... } });
const result = await agent.run("Do the task");
console.log(agent.stats.caching?.cacheHitRate); // 0.92
console.log(agent.stats.caching?.estimatedSavingsUsd); // $0.023

Halo vs Vercel AI SDK ​

HaloVercel AI SDK
FocusCache-first agent runtimeProvider-agnostic LLM toolkit
CachingBuilt-in StablePrefix, auto-managedManual via experimental_cache options
Agent Loopagent.run() — auto tool executionManual with maxSteps + tool handling
Cost Trackingagent.stats.caching built inManual from usage
Provider ModelAdapters with cache strategiesProvider packages
SSE ProtocolCompatible via toDataStream()Native 0:/d: protocol
Best ForAgent-heavy apps, cost-sensitive, multi-turnGeneral LLM apps, broad provider support

The two are complementary — Halo's toDataStream() makes it compatible with Vercel AI SDK's useChat().

Halo vs LangChain ​

HaloLangChain
PhilosophyMinimal, cache-firstMaximal, abstraction-heavy
Bundle Size~5KB per package500KB+
CachingAutomatic prefix cacheManual LCEL caching
Learning Curve~5 minutesHours to days
DebuggingDirect adapter code, visible HTTPDeep chain abstraction

When to Choose Halo ​

  • You're building multi-turn agents with tool calling
  • You care about token costs and want automatic savings tracking
  • You use DeepSeek (or plan to support multiple providers)
  • You want a minimal, auditable codebase (zero external dependencies in core)
  • You're shipping to production and need keep-alive, stats, and error events

When Not to Choose Halo ​

  • You need structured output generation (JSON mode, objects) — use Vercel AI SDK
  • You need embeddings, image generation, or speech — use provider SDKs directly
  • You're doing a single-shot prompt with no conversation — raw API is fine

Released under the MIT License.