Cost Savings: 69% (MT-Bench), 93% (GSM8K), 52% (MMLU), 80% (TruthfulQA) savings, retaining 96% GPT-5 quality.
$ npx -y skills add lemony-ai/cascadeflow --agent claude-code
Repo: lemony-ai/cascadeflow
What's inside
Cost Savings: 69% (MT-Bench), 93% (GSM8K), 52% (MMLU), 80% (TruthfulQA) savings, retaining 96% GPT-5 quality.
Python • TypeScript • LangChain • OpenAI Agents • CrewAI • PydanticAI • Google ADK • n8n • Vercel AI • OpenClaw • Hermes Agent • 📖 Docs • 💡 Examples
The in-process intelligence layer for AI agents. Optimize cost, latency, quality, budget, compliance, and energy — inside the execution loop, not at the HTTP boundary.
cascadeflow works where external proxies can't: per-step model decisions based on agent state, per-tool-call budget gating, runtime stop/continue/escalate actions, and business KPI injection during agent loops. It accumulates insight from every model call, tool result, and quality score — the agent gets smarter the more it runs. Sub-5ms overhead. Works with LangChain, OpenAI Agents SDK, CrewAI, PydanticAI, Google ADK, n8n, Vercel AI SDK, and Hermes Agent.
Update
Hermes Agent delegation cascading
CascadeFlow now provides a Hermes Agent integration for per-skill model cascading, task-complexity cascading, topic-aware subagent cascading, observe-mode rollout, and auditable decisions without taking over provider credentials, base URLs, fallback chains, or API modes.
pip install cascadeflow
npm install @cascadeflow/core
| Dimension | External Proxy | cascadeflow Harness |
|---|---|---|
| Scope | HTTP request boundary | Inside agent execution loop |
| Dimensions | Cost only | Cost + quality + latency + budget + compliance + energy |
| Latency overhead | 10-50ms network RTT | <5ms in-process |
| Business logic | None | KPI weights and targets |
| Enforcement | None (observe only) | stop, deny_tool, switch_model |
| Auditability | Request logs | Per-step decision traces |
cascadeflow is a library and agent harness — an intelligent AI model cascading package that dynamically selects the optimal model for each query or tool call through speculative execution. It's based on the research that 40-70% of queries don't require slow, expensive flagship models, and domain-specific smaller models often outperform large general-purpose models on specialized tasks. For the remaining queries that need advanced reasoning, cascadeflow automatically escalates to flagship models if needed.
allow, switch_model, deny_tool, stop — based on current context and policy state. Closes the gap between analytics and execution.ℹ️ Note: SLMs (under 10B parameters) are sufficiently powerful for 60-70% of agentic AI tasks. Research paper
cascadeflow uses speculative execution with quality validation:
Zero configuration. Works with YOUR existing models (>17 providers currently supported).
In practice, 60-70% of queries are handled by small, efficient models (8-20x cost difference) without requiring escalation
Result: 40-85% cost reduction, 2-10x faster responses, zero quality loss.
FAQ
cascadeflow is a Claude Code plugin with 1 hand-picked skill for agent orchestration work, indexed on Flowy. Install it with the command on its page. It includes cascadeflow. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it