Skip to content

Cost-Optimized AI Stack

Minimize LLM costs with intelligent routing, response caching, and cost monitoring. Routes to the cheapest provider that meets quality thresholds, caches similar prompts to avoid redundant calls, and tracks spend with anomaly detection.

Namecost-optimized-ai
Version0.1.0
Tagsai, cost, optimization, caching
Sourcecomposites/cost-optimized-ai.yaml

Render it

# CLI
npx @nanohype/sdk render-composite cost-optimized-ai --out ./my-app

# SDK
import { LocalSource, renderComposite } from "@nanohype/sdk";
const result = await renderComposite(source, "cost-optimized-ai", variables);

# MCP — from an agent
get_composite({ name: "cost-optimized-ai" })

What it draws together

TemplateRendered atNotes
monoreporootthe root project
module-llm-gatewaypackages/gateway
module-semantic-cachepackages/cache
module-llm-observabilitypackages/observability

Variables

Required

ProjectName string
Project name used across all templates Must be lowercase kebab-case.

Optional

LlmProvider string — defaults to anthropic
Default LLM provider for the gateway