Aeion AI vs Vercel AI SDK & LangChain
Vercel AI SDK charges $0.05/1M tokens on top of OpenAI/Anthropic costs and provides no multi-tenant billing or cost caps. LangChain is a complex abstraction layer with vendor lock-in and no built-in provider management. Aeion AI ships 57 adapters, automatic usage tracking, cost caps per tenant, and model auto-refresh — included free with any Aeion module.
Head-to-Head Comparison
| Capability | Aeion AI | Vercel AI SDK | LangChain |
|---|---|---|---|
| **Provider Adapters** | 57 (built-in) | ~15 (streaming-first) | Many (via community) |
| **Cost Calculation** | Built-in (calculateTextCost, etc.) | DIY | DIY |
| **Token Estimation** | Pure JS, no API call | DIY | DIY |
| **Usage Tracking** | Automatic (ai.operation.completed event) | DIY | DIY |
| **Multi-Tenant Billing** | Built-in (UsageService) | DIY | DIY |
| **Cost Caps** | Per-tenant, configurable | DIY | DIY |
| **Model Auto-Refresh** | Daily via cron (built-in) | DIY | DIY |
| **Provider Credentials** | Encrypted at rest, per-tenant scoped | DIY | DIY |
| **Multi-Modal** | text/image/audio/video/3D/embedding/STT/TTS/rerank | text/image/audio | text/image (limited) |
| **Local / Air-Gapped** | Ollama adapter (fully local) | No | Ollama (via LangChain community) |
| **Pricing** | $0 — included free with any module | $0.05/1M tokens (on top of provider costs) | Free (but lock-in) |
| **Multi-tenant Isolation** | Built-in (AeionContext) | DIY | DIY |
The Hidden Cost of Vercel AI SDK
Vercel AI SDK's pricing: $0.05/1M tokens for the SDK layer. This is on top of your OpenAI, Anthropic, or Google API costs.
Example: 10 tenants, moderate AI usage:
- Tenant 1: 50M tokens/month (OpenAI GPT-4o) = $1.50 SDK + $250 API = $251.50
- Tenant 2: 30M tokens/month (Anthropic Claude) = $1.50 SDK + $150 API = $151.50
- Tenant 3: 100M tokens/month (Google Gemini) = $5.00 SDK + $5 API = $10.00
- ...9 more tenants
Total monthly: ~$1,000 in SDK fees alone, just for the abstraction layer.
Plus you still have to build:
- Multi-tenant credential management (separate API keys per tenant)
- Cost aggregation and billing (UsageService — built into Aeion AI)
- Cost caps per tenant (throttle/block/notify on budget exceeded)
- Usage dashboards (AiDashboards collection + aggregation queries)
- Provider fallback logic (what if OpenAI is down?)
- Token estimation without API calls (estimateTokens — pure JS in Aeion AI)
Aeion AI: $0 — included free with any module. No per-token surcharge. All of the above is built in.
LangChain: Powerful but Complex
LangChain's value proposition: A powerful abstraction layer for AI workflows. Chains, agents, retrieval augmentation, memory.
The problem: LangChain is a framework for building AI applications — it's not an AI gateway. You still need to:
- Manage provider credentials for every AI service
- Build your own usage tracking and cost aggregation
- Implement multi-tenant billing
- Handle provider-specific quirks (Anthropic's tool use, OpenAI's JSON mode, etc.)
- Deal with LangChain's own versioning and breaking changes
LangChain complexity:
```typescript // What you write with LangChain: const model = new ChatAnthropic({}); const chain = RunnableSequence.from([ promptTemplate, model, new JsonOutputParser(), ]);
// Plus: memory management, retrieval, agent orchestration, vector stores... // → 50+ imports, 200+ concepts, 3 months to learn ```
Aeion AI complexity:
typescript
// What you write with Aeion AI:
const result = await ctx.ai.text({
model: "claude-sonnet-4-20250514",
messages: [{ role: "user", content: "Summarize the report" }],
maxTokens: 1024,
});
// → result.text → done
// Usage tracked automatically
// Cost calculated automatically
// Provider credentials encrypted
// Multi-tenant isolation enforced
LangChain is for AI application developers. Aeion AI is for platform developers who need an AI gateway integrated into their BaaS.
The Provider Credential Problem
Each tenant needs their own AI credentials. You can't share one OpenAI API key across 500 tenants — billing gets muddled and security is compromised.
What you need:
- Per-tenant API keys stored securely
- Encrypted at rest (never plaintext in the database)
- Easy rotation (revoke old key, add new key)
- Per-tenant spending limits (don't let one tenant burn through the budget)
- Credential validation (is this key still valid?)
Vercel/LangChain: You build this yourself. Database tables for credentials, encryption logic, rotation workflows.
Aeion AI:
```typescript // One provider config per tenant { tenantId: "tenant_01J8X", providerId: "openai", credentials: { apiKey: "sk-...encrypted..." }, limits: { maxTokensPerMinute: 10000, monthlyBudget: 500 // USD } }
// Limits are enforced automatically // Credentials are encrypted via Aeion's built-in encryption framework // Rotation: update via API → re-encrypt → done ```
Encryption: AES-256-GCM with PBKDF2 key derivation, using a key scoped to the AI layer. Keys are never in plaintext in the database. If the encryption key rotates, all credentials are re-encrypted with the new key automatically.
Automatic Usage Tracking vs DIY
The tracking problem: Every AI call generates cost. If you're not tracking it per-tenant, per-user, per-feature, you have no idea:
- Which tenant is consuming the most budget
- Which user is hitting cost limits
- Which AI feature is unexpectedly expensive
- Whether your free tier is profitable
What you'd build on Vercel/LangChain:
```typescript // In every AI call, manually log usage async function callAI(model, params, tenantId, userId) { const start = Date.now(); const result = await callProvider(model, params); const latency = Date.now() - start;
// Calculate cost const cost = calculateTextCost( model, result.usage.promptTokens, result.usage.completionTokens, );
// Log to database await db.insert(ai_usage_logs).values({ tenantId, userId, providerId: detectProvider(model), model, promptTokens: result.usage.promptTokens, completionTokens: result.usage.completionTokens, totalCost: cost, latencyMs: latency, status: "success", });
// Check cost cap const tenantSpend = await db.query.sum(ai_usage_logs, { tenantId, period: "monthly", }); if (tenantSpend > tenant.costCap) { throw new Error("Monthly AI budget exceeded"); }
return result; } ```
Do this for 50+ models, 12 modalities, and 500 tenants. That's your 3-month engineering project.
Aeion AI: It's one line — await ctx.ai.text(...). Usage tracking handles everything else: every completed AI operation is automatically logged, aggregated, and checked against cost caps before the next call.
Model Auto-Refresh: The Silent Cost
AI providers release new models constantly:
- Week 1: OpenAI releases GPT-4.5
- Week 2: Anthropic releases Claude 3.7 Sonnet
- Week 3: Google releases Gemini 2.5 Pro
- Week 4: DeepSeek releases R2
Without auto-refresh: You hardcode model names in your application. When a new model comes out, you have to update your code, test it, and deploy. For 50+ providers, this is a full-time job.
Vercel/LangChain: You build the auto-refresh yourself. Call /models endpoints, diff the results, update your registry. That's another 2-3 months of engineering.
Aeion AI: A daily job checks every provider's model catalog, diffs it against what's registered, and adds anything new automatically — no code to write or maintain.
New model available within 24 hours. No code changes. No deploys. No missed opportunities.
Multi-Tenant Billing: The Hard Problem
For a BaaS with 500 tenants, AI cost allocation is complex:
- Tenant A used $127.50 in OpenAI, $43.20 in Anthropic, $8.40 in Google
- Tenant B used $0 in OpenAI, $300 in Anthropic, $2 in Google
- Tenant C burned through their $50 monthly cap in 5 days
Without built-in usage tracking:
- You can't invoice tenants accurately
- You can't enforce spending limits
- You can't show tenants where their budget went
- You can't optimize (route to cheaper models when quality is sufficient)
With UsageService:
```typescript // Get usage for billing const invoice = await usageService.getUsage({ tenantId: "tenant_01J8X", period: "monthly", groupBy: "provider", }); // → { providerId: "openai", totalCost: 127.50, ... } // → Use this for tenant invoices
// Cost cap enforcement enforceCostCap(tenantId, operationCost); // → If monthly spend > cap: throttle/block/notify // → Alert tenant at 80%, block at 100% ```
Vercel: No multi-tenant billing — you pay Vercel, Vercel pays the providers. You have no visibility into per-tenant costs.
LangChain: No billing — it's a framework, not a platform.
Aeion AI: Full per-tenant usage tracking and cost caps built in.
Local / Air-Gapped Deployment
For government, healthcare, and financial services: AI data can't leave the network. You need fully local inference.
Vercel AI SDK: No local option. Every call goes to external providers.
LangChain: Ollama support via community integrations. Functional but:
- No unified API (Ollama has a different interface than OpenAI)
- No automatic usage tracking (local model, no API → no logs)
- No credential management (local = no credentials needed)
- No cost calculation (local = no cost)
- Fragmented model support (some models work, others don't)
Aeion AI Ollama adapter:
json
{
"providerId": "ollama",
"name": "Ollama Local",
"credentials": { "baseUrl": "http://localhost:11434" },
"defaults": { "textModel": "llama3", "embeddingModel": "nomic-embed-text" }
}
Same API surface as cloud providers:
typescript
await ctx.ai.text({ model: "llama3", messages }); // same call regardless of provider
await ctx.ai.embed({ model: "nomic-embed-text", input }); // same call
UsageService still works: Ollama calls are tracked (latency, success/failure, model). Cost is $0, but you still have visibility. Perfect for air-gapped enterprise deployments.
Frequently Asked Questions
Vercel AI SDK is a client-side streaming library for chat UIs — useful for building chat interfaces, doesn't solve provider management, cost tracking, multi-tenant billing, sub-processor compliance, or audit logging. Aeion AI is the server-side gateway that handles all of that, plus exposes a streaming surface compatible with Vercel SDK if you want it for the client.
Provider catalogs update as new models ship (GPT-5, Claude 4.5, Gemini 2 Pro, etc.) without redeploying your app — the gateway pulls latest provider capabilities and exposes them to your skills. Routing rules can target 'best available' for a given task class without naming a specific model.
Yes — multi-level budget governance. Per-tenant daily/weekly/monthly caps, per-skill caps, per-user soft caps, per-budget-period auto-routing to cheaper providers when nearing cap. Warn / soft-block / hard-block thresholds. Cost transparency: every AI call is logged with provider + model + token count + cost in the audit log.
Vercel adds 'gateway' fees ($0.05/1M tokens) on top of provider costs. Aeion adds zero markup — you pay the provider's raw API rate. At a million-token monthly load, that's tens-of-dollars / month; at billions, it's serious money. Plus Aeion's cost-routing typically saves 40-80% by sending bulk traffic to cheaper providers.
Yes — local-AI providers are first-class. Bridge can host Ollama / vLLM / LM Studio on a local box, and the AI gateway routes to them under the same governance (cost tracking, audit, sub-processor allowlist) as cloud providers. Useful for fully on-prem or air-gapped deployments.