Skip to main content

What is a Router?

A router is a directed graph that evaluates an AI request and chooses how it should be handled. Routers are especially useful when a project has multiple endpoints, policies, or optimization strategies but application developers need one stable API target.

Router DAG Definition

The Bud admin UI models router graphs with a RouterDAGDefinition shape:
FieldDescription
nameRouter graph name
versionOptional version label
descriptionOptional summary of the routing purpose
parametersRuntime inputs accepted by the router
stepsOrdered action nodes and dependency metadata
outputsOptional named outputs produced by the graph
Each step includes an id, display name, action type, parameter object, dependency list, optional condition, optional failure behavior, and optional timeout.

Action Categories

Router actions are fetched dynamically from the router API. The editor uses action metadata for display, parameter forms, outputs, and connection validation.
CategoryRole in the GraphExamples of Parameters
SignalEvaluate request or environment inputsRequest fields, string lists, content rules
ProjectionTransform context into normalized routing featuresTemplates, JSON objects, derived fields
DecisionChoose downstream route based on rulesBranches, rule trees, conditions
AlgorithmExecute endpoint selection strategyEndpoint lists, weighted endpoints, ordered fallback endpoints
PluginApply extension behaviorCredentials, provider settings, cache or guardrail configuration
The exact action list is backend-driven. If an expected action does not appear, refresh the router actions catalog or verify that /routers/actions returns the category and action metadata.

Connection Rules

The router editor intentionally supports a constrained topology so routing graphs remain predictable.

Allowed Connections

SourceAllowed Targets
TriggerSignal, Decision, Projection
DecisionAlgorithm, Plugin

Rejected Connections

  • Signal → any node
  • Projection → any node
  • Decision → Signal, Projection, Decision, or Trigger
  • Algorithm → any node
  • Plugin → any node
  • Trigger → Algorithm or Plugin directly
The editor shows warnings for invalid connections, such as trying to connect a Trigger directly to an Algorithm. In that case, insert a Decision first and connect the Algorithm from the Decision.

Parameters and Data Sources

Router action forms can draw options from Bud resources loaded on the detail page:
  • Clusters use cluster_id values for deployment-compatible workflows.
  • Models load global model records.
  • Projects identify project-scoped routing ownership.
  • Providers and credentials support proprietary or cloud-backed actions.
  • Endpoints provide deployment targets for algorithm and routing actions.

Save Lifecycle

When you click Save, Bud admin performs these steps:
  1. Flush unsaved action configuration changes.
  2. Validate action parameters in the editor panel.
  3. Convert editor steps into API dag_config.steps.
  4. Add entry_step, parameters, outputs, dependencies, conditions, and next_steps.
  5. Update the router and set status to active.

Status and Operational Metadata

Routers can appear as draft, active, or inactive. Router cards display step count, execution count, creation time, and last execution time when available.