Cloudflare AI stack. Use skills in this subdomain when building:
Three services that compose into the 2nth.ai AI pipeline:
| Service | Role | When to use |
|---|---|---|
tech/cloudflare/ai/workers-ai | Edge inference | Classification, routing, embeddings — cheap + zero latency |
tech/cloudflare/ai/ai-gateway | Proxy + observability | All Claude calls — token metering, caching, fallback |
tech/cloudflare/ai/vectorize | Vector database | RAG, semantic search, skill discovery |
Request
→ Workers AI (Llama 3.1 8B) — classify intent at edge (5–20 tokens, ~1ms)
→ If complex: AI Gateway → Claude — domain expert response
→ Vectorize — retrieve relevant skills/context for RAG
→ Response streams back to client
→ AI Gateway logs token usage (→ Penny's token economy)
This pattern minimises Claude API costs by filtering and enriching at the edge before the expensive call.
The three services in this stack have distinct failure modes — surface the ones that bite across all of them, then drill into per-service leaves for specifics.
[anthropic, openai], Anthropic outages route to OpenAI on every call (no health-check, just on-failure). For predictable behaviour, route primary-only and handle the fallback in application code if outages should be visible.category=billing, you may get fewer than 5 results (or zero) even when 100+ matching vectors exist. Set topK high (50+) and filter generously, then trim in application code.