# cascadeflow ## Docs - [@cascadeflow.agent()](https://docs.cascadeflow.ai/api-reference/python/agent-decorator.md): Decorate agent functions with policy metadata including budget, compliance, and KPI weights. - [CascadeAgent](https://docs.cascadeflow.ai/api-reference/python/cascade-agent.md): The main agent class for speculative cascade execution with quality validation, tool calling, streaming, and batch processing. - [CascadeResult](https://docs.cascadeflow.ai/api-reference/python/cascade-result.md): Result dataclass from cascade execution — content, cost breakdown, quality diagnostics, timing, and tool calls. - [Environment Variables](https://docs.cascadeflow.ai/api-reference/python/environment.md): Environment variable reference for cascadeflow harness configuration, provider API keys, and config file paths. - [Errors](https://docs.cascadeflow.ai/api-reference/python/errors.md): Exception classes for budget limits, provider errors, quality validation failures, and configuration issues. - [HarnessConfig](https://docs.cascadeflow.ai/api-reference/python/harness-config.md): Full configuration dataclass for the cascadeflow harness with all fields, types, and defaults. - [cascadeflow.init()](https://docs.cascadeflow.ai/api-reference/python/init.md): Activate the cascadeflow harness globally with a mode and optional configuration. - [ModelConfig](https://docs.cascadeflow.ai/api-reference/python/model-config.md): Configuration dataclass for defining models in a cascade — provider, cost, capabilities, and routing metadata. - [Python API](https://docs.cascadeflow.ai/api-reference/python/overview.md): Python API reference for cascadeflow — the three-tier harness API and supporting types. - [Presets](https://docs.cascadeflow.ai/api-reference/python/presets.md): One-line agent creation with preset profiles — cost-optimized, balanced, speed, quality, and development configurations. - [cascadeflow.run()](https://docs.cascadeflow.ai/api-reference/python/run.md): Create a scoped run context with budget caps, tool call limits, and metrics tracking. - [HarnessRunContext](https://docs.cascadeflow.ai/api-reference/python/run-context.md): Run context object yielded by cascadeflow.run() with summary(), trace(), and budget tracking methods. - [Streaming](https://docs.cascadeflow.ai/api-reference/python/streaming.md): Streaming API — StreamEvent, StreamEventType, and async iterators for real-time response output. - [Tools](https://docs.cascadeflow.ai/api-reference/python/tools.md): Tool calling framework — ToolConfig, ToolExecutor, and the @tool decorator for agent function calling. - [Configuration](https://docs.cascadeflow.ai/api-reference/typescript/configuration.md): TypeScript configuration types — AgentConfig, QualityConfig, CascadeConfig, RunOptions, and presets. - [@cascadeflow/core](https://docs.cascadeflow.ai/api-reference/typescript/core.md): TypeScript core package with CascadeAgent for model routing, cost tracking, and quality validation. - [@cascadeflow/langchain](https://docs.cascadeflow.ai/api-reference/typescript/langchain.md): TypeScript LangChain integration with withCascade() for drop-in cascade routing and model discovery helpers. - [TypeScript API](https://docs.cascadeflow.ai/api-reference/typescript/overview.md): TypeScript API reference for cascadeflow — CascadeAgent, Vercel AI middleware, and LangChain integration. - [Streaming](https://docs.cascadeflow.ai/api-reference/typescript/streaming.md): TypeScript streaming API — StreamEvent, StreamEventType, and async iterators for real-time cascade output. - [@cascadeflow/vercel-ai](https://docs.cascadeflow.ai/api-reference/typescript/vercel-ai.md): Vercel AI SDK middleware integration for cascade routing with streaming, multi-turn chat, and tool execution. - [Capabilities Overview](https://docs.cascadeflow.ai/capabilities/overview.md): The full cascadeflow surface area, organized as a concise capability map instead of scattered deep dives. - [Changelog](https://docs.cascadeflow.ai/changelog.md): Release history and changelog for cascadeflow. - [Contributing](https://docs.cascadeflow.ai/contributing.md): How to contribute to cascadeflow — development setup, code style, testing, and pull request process. - [Customization](https://docs.cascadeflow.ai/developers/customization.md): Where to go when presets are not enough and you need custom cascades, validators, or domain-specific behavior. - [Enterprise Networking](https://docs.cascadeflow.ai/developers/enterprise-networking.md): Proxy, TLS, CA bundle, and corporate-network configuration for enterprise environments. - [Observability And Privacy](https://docs.cascadeflow.ai/developers/observability-and-privacy.md): How to use traces, summaries, and telemetry while keeping the rollout privacy-aware. - [Production And Deployment](https://docs.cascadeflow.ai/developers/production-and-deployment.md): The production-facing surfaces of cascadeflow: deployment patterns, performance, gateway usage, and operational guidance. - [Providers And Presets](https://docs.cascadeflow.ai/developers/providers-and-presets.md): How to think about provider choice, local models, and presets without turning the docs into a provider catalog. - [Tools And Streaming](https://docs.cascadeflow.ai/developers/tools-and-streaming.md): Core patterns for tool calling, streaming, and agent loops. - [Basic Usage](https://docs.cascadeflow.ai/examples/basic-usage.md): Simple cascade setup with OpenAI models showing speculative execution, cost tracking, and savings calculation. - [Budget Enforcement](https://docs.cascadeflow.ai/examples/budget-enforcement.md): Per-run and per-user budget caps with enforcement callbacks, cost tracking, and automatic stop actions. - [Example Catalog](https://docs.cascadeflow.ai/examples/catalog.md): Broader catalog of cascadeflow examples across Python, integrations, TypeScript, and deployment patterns. - [Compliance Gating](https://docs.cascadeflow.ai/examples/compliance-gating.md): GDPR, HIPAA, PCI, and strict model allowlists with enforcement examples for regulated agent workflows. - [Enterprise Patterns](https://docs.cascadeflow.ai/examples/enterprise-patterns.md): Production-ready patterns including retry logic, rate limiting, budget management, circuit breakers, caching, and health monitoring. - [KPI-Weighted Routing](https://docs.cascadeflow.ai/examples/kpi-weighted-routing.md): Configure quality, cost, latency, and energy weights to encode business priorities into model routing decisions. - [Multi-Agent Orchestration](https://docs.cascadeflow.ai/examples/multi-agent.md): Multi-turn tool execution with agent-as-a-tool delegation and budget tracking across agent boundaries. - [For Coding Agents](https://docs.cascadeflow.ai/for-coding-agents.md): Canonical facts, installation, repo map, API surface, and implementation entry points for coding agents evaluating or integrating cascadeflow. - [Quickstart: Agent Decorator](https://docs.cascadeflow.ai/get-started/agent-decorator.md): Attach budget, compliance, and KPI policies directly to agent functions with @cascadeflow.agent(). - [Agent Harness](https://docs.cascadeflow.ai/get-started/agent-harness.md): The runtime governance layer that tracks, scores, and enforces constraints across every agent step. - [Agent Loop](https://docs.cascadeflow.ai/get-started/agent-loop.md): How cascadeflow operates inside multi-step agent execution — tool interception, budget tracking across steps, sub-agent handoffs, and decision traces. - [Choose Your Integration](https://docs.cascadeflow.ai/get-started/choose-integration.md): Pick the right cascadeflow integration for your framework — LangChain, OpenAI Agents, CrewAI, Google ADK, n8n, or Vercel AI. - [Quickstart: Enforce Mode](https://docs.cascadeflow.ai/get-started/enforce.md): Add budget caps and constraints that actively control agent execution — stop runs, switch models, and gate tool calls. - [How It Works](https://docs.cascadeflow.ai/get-started/how-it-works.md): Architecture of cascadeflow's two engines — Cascade for speculative model routing and Harness for agent runtime intelligence. - [Installation](https://docs.cascadeflow.ai/get-started/installation.md): Install cascadeflow with pip extras for Python or npm packages for TypeScript, including provider-specific setup. - [Quickstart: Observe Mode](https://docs.cascadeflow.ai/get-started/observe.md): Add cascadeflow to an existing project with zero code changes. Track cost, latency, and model usage across all LLM calls. - [Rollout Guide](https://docs.cascadeflow.ai/get-started/rollout-guide.md): Move from first install to production enforcement safely — observe, validate, enforce, tune. - [Decision Actions](https://docs.cascadeflow.ai/harness/actions.md): Four harness actions — allow, switch_model, deny_tool, and stop — and when each is triggered. - [Budget Enforcement](https://docs.cascadeflow.ai/harness/budget-enforcement.md): Configure budget enforcement with per-run caps and automatic stop actions when budget is exceeded. - [Compliance Gating](https://docs.cascadeflow.ai/harness/compliance.md): GDPR, HIPAA, PCI, and strict model allowlists for compliance-aware model gating in agent workflows. - [Decision Traces](https://docs.cascadeflow.ai/harness/decision-trace.md): Per-step audit trail of every harness decision — action, reason, model, cost, budget state, and enforcement status. - [Energy Tracking](https://docs.cascadeflow.ai/harness/energy-tracking.md): Deterministic compute-intensity coefficients for carbon-aware AI operations, with energy caps and per-model coefficients. - [KPI-Weighted Routing](https://docs.cascadeflow.ai/harness/kpi-optimization.md): Inject business priorities as quality, cost, latency, and energy weights into every model routing decision. - [Harness Modes](https://docs.cascadeflow.ai/harness/modes.md): Three harness modes — off, observe, and enforce — with rollout guidance for production deployments. - [Harness Overview](https://docs.cascadeflow.ai/harness/overview.md): Overview of the cascadeflow harness — six optimization dimensions, HarnessConfig surface, and high-level decision flow. - [cascadeflow](https://docs.cascadeflow.ai/index.md): The agent runtime intelligence layer. Control cost, latency, quality, compliance, and energy inside every agent step. - [CrewAI](https://docs.cascadeflow.ai/integrations/crewai.md): Hook-based harness integration for CrewAI with budget gating, metrics tracking, and decision traces across crew steps. - [Google ADK](https://docs.cascadeflow.ai/integrations/google-adk.md): Plugin-based harness integration for Google Agent Development Kit with budget enforcement and metrics tracking. - [LangChain](https://docs.cascadeflow.ai/integrations/langchain.md): Harness-aware callback handler for LangChain and LangGraph with budget tracking, cost analytics, and decision traces. - [n8n](https://docs.cascadeflow.ai/integrations/n8n.md): cascadeflow community nodes for n8n with cascade model routing, tool gating, and harness modes for no-code AI workflows. - [OpenAI Agents SDK](https://docs.cascadeflow.ai/integrations/openai-agents.md): CascadeFlowModelProvider for OpenAI Agents SDK with model candidates, tool gating, and budget tracking. - [OpenClaw](https://docs.cascadeflow.ai/integrations/openclaw.md): Secondary OpenClaw integration path using cascadeflow as an OpenAI-compatible provider. - [Integrations Overview](https://docs.cascadeflow.ai/integrations/overview.md): Matrix of all cascadeflow framework integrations with supported features, languages, and integration patterns. - [PydanticAI](https://docs.cascadeflow.ai/integrations/pydantic-ai.md): Full cascade Model for PydanticAI agents with speculative drafter→verifier routing, quality gating, and budget enforcement. - [Vercel AI SDK](https://docs.cascadeflow.ai/integrations/vercel-ai.md): TypeScript middleware integration for Vercel AI SDK with cascade routing, multi-turn chat, and tool execution. - [Why cascadeflow](https://docs.cascadeflow.ai/why-cascadeflow.md): The business and technical case for inside-the-loop agent runtime intelligence. ## OpenAPI Specs - [openapi](https://docs.cascadeflow.ai/api-reference/openapi.json) ## Optional - [Website](https://cascadeflow.ai) - [GitHub](https://github.com/lemony-ai/cascadeflow)