<liclass="toctree-l2"><aclass="reference internal"href="../../concepts/llm_providers/supported_providers.html">Supported Providers & Configuration</a></li>
<spanid="lifecycle-of-a-request"></span><h1>Request Lifecycle<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#request-lifecycle"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h1>
<p>Plano is a set of <strong>two</strong> self-contained processes that are designed to run alongside your application servers
(or on a separate server connected to your application servers via a network).</p>
<p>The first process is designated to manage HTTP-level networking and connection management concerns (protocol management, request id generation, header sanitization, etc.), and the other process is a <strong>controller</strong>, which helps Plano make intelligent decisions about the incoming prompts. The controller hosts the purpose-built LLMs to manage several critical, but undifferentiated, prompt related tasks on behalf of developers.</p>
<p>The request processing path in Plano has three main parts:</p>
<li><p><aclass="reference internal"href="../../concepts/listeners.html#plano-overview-listeners"><spanclass="std std-ref">Listener subsystem</span></a> which handles <strong>downstream</strong> and <strong>upstream</strong> request
processing. It is responsible for managing the inbound(edge) and outbound(egress) request lifecycle. The downstream and upstream HTTP/2 codec lives here. This also includes the lifecycle of any <strong>upstream</strong> connection to an LLM provider or tool backend. The listenser subsystmem manages connection pools, load balancing, retries, and failover.</p></li>
<li><p><aclass="reference internal"href="model_serving.html#bright-staff"><spanclass="std std-ref">Bright Staff controller subsystem</span></a> is Plano’s memory-efficient, lightweight controller for agentic traffic. It sits inside the Plano data plane and makes real-time decisions about how prompts are handled, forwarded, and processed.</p></li>
<p>These two subsystems are bridged with either the HTTP router filter, and the cluster manager subsystems of Envoy.</p>
<p>Also, Plano utilizes <aclass="reference external"href="https://blog.envoyproxy.io/envoy-threading-model-a8d44b922310"rel="nofollow noopener">Envoy event-based thread model<svgfill="currentColor"height="1em"stroke="none"viewbox="0 96 960 960"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M188 868q-11-11-11-28t11-28l436-436H400q-17 0-28.5-11.5T360 336q0-17 11.5-28.5T400 296h320q17 0 28.5 11.5T760 336v320q0 17-11.5 28.5T720 696q-17 0-28.5-11.5T680 656V432L244 868q-11 11-28 11t-28-11Z"></path></svg></a>. A main thread is responsible for the server lifecycle, configuration processing, stats, etc. and some number of <aclass="reference internal"href="threading_model.html#arch-overview-threading"><spanclass="std std-ref">worker threads</span></a> process requests. All threads operate around an event loop (<aclass="reference external"href="https://libevent.org/"rel="nofollow noopener">libevent<svgfill="currentColor"height="1em"stroke="none"viewbox="0 96 960 960"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M188 868q-11-11-11-28t11-28l436-436H400q-17 0-28.5-11.5T360 336q0-17 11.5-28.5T400 296h320q17 0 28.5 11.5T760 336v320q0 17-11.5 28.5T720 696q-17 0-28.5-11.5T680 656V432L244 868q-11 11-28 11t-28-11Z"></path></svg></a>) and any given downstream TCP connection will be handled by exactly one worker thread for its lifetime. Each worker thread maintains its own pool of TCP connections to upstream endpoints.</p>
<li><p><strong>Routing Decision (Agent vs Prompt Target)</strong>:
The decrypted data stream is de-framed by the HTTP/2 codec in Plano’s HTTP connection manager. Plano performs
intent matching (via the Bright Staff controller and prompt-handling logic) using the configured agents and
<aclass="reference internal"href="../../concepts/prompt_target.html#prompt-target"><spanclass="std std-ref">prompt targets</span></a>, determining whether this request should be handled by an agent workflow
(with optional <aclass="reference internal"href="../../concepts/filter_chain.html#filter-chain"><spanclass="std std-ref">Filter Chains</span></a>) or by a deterministic prompt target.</p></li>
</ol>
<p>4a. <strong>Agent Path: Orchestration and Filter Chains</strong></p>
<blockquote>
<div><p>If the request is routed to an <strong>agent</strong>, Plano executes any attached <aclass="reference internal"href="../../concepts/filter_chain.html#filter-chain"><spanclass="std std-ref">Filter Chains</span></a> first. These filters can apply guardrails, rewrite prompts, or enrich context (for example, RAG retrieval) before the agent runs. Once filters complete, the Bright Staff controller orchestrates which downstream tools, APIs, or LLMs the agent should call and in what sequence.</p>
<ulclass="simple">
<li><p>Plano may call one or more backend APIs or tools on behalf of the agent.</p></li>
<li><p>If an endpoint cluster is identified, load balancing is performed, circuit breakers are checked, and the request is proxied to the appropriate upstream endpoint.</p></li>
<li><p>If no specific endpoint is required, the prompt is sent to an upstream LLM using Plano’s model proxy for
completion or summarization.</p></li>
</ul>
<p>For more on agent workflows and orchestration, see <aclass="reference internal"href="../../concepts/prompt_target.html#prompt-target"><spanclass="std std-ref">Prompt Targets and Agents</span></a> and
<div><p>If the request is routed to a <strong>prompt target</strong>, Plano treats it as a deterministic, task-specific call.
Plano engages its function-calling and parameter-gathering capabilities to extract the necessary details
from the incoming prompt(s) and produce the structured inputs your backend expects.</p>
<ulclass="simple">
<li><p><strong>Parameter Gathering</strong>: Plano extracts and validates parameters defined on the prompt target (for example,
currency symbols, dates, or entity identifiers) so your backend does not need to parse natural language.</p></li>
<li><p><strong>API Call Execution</strong>: Plano then routes the call to the configured backend endpoint. If an endpoint cluster is identified, load balancing and circuit-breaker checks are applied before proxying the request upstream.</p></li>
</ul>
<p>For more on how to design and configure prompt targets, see <aclass="reference internal"href="../../concepts/prompt_target.html#prompt-target"><spanclass="std std-ref">Prompt Target</span></a>.</p>
<li><p><strong>Error Handling and Forwarding</strong>:
Errors encountered during processing, such as failed function calls or guardrail detections, are forwarded to
designated error targets. Error details are communicated through specific headers to the application:</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">X-Function-Error-Code</span></code>: Code indicating the type of function call error.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">X-Prompt-Guard-Error-Code</span></code>: Code specifying violations detected by prompt guardrails.</p></li>
<li><p>Additional headers carry messages and timestamps to aid in debugging and logging.</p></li>
</ul>
</li>
<li><p><strong>Response Handling</strong>:
The upstream endpoint’s TLS transport socket encrypts the response, which is then proxied back downstream.
Responses pass through HTTP filters in reverse order, ensuring any necessary processing or modification before final delivery.</p></li>
</ol>
</section>
<sectionid="request-flow-egress">
<h2>Request Flow (Egress)<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#request-flow-egress"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#request-flow-egress'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>A brief outline of the lifecycle of a request and response in the context of egress traffic from an application to Large Language Models (LLMs) via Plano:</p>
Plano initiates an HTTP connection to the upstream LLM service. This connection is handled by Plano’s egress listener running on a worker thread. The connection typically uses a secure transport protocol such as HTTPS, ensuring the prompt data is encrypted before being sent to the LLM service.</p></li>
Before sending the request to the LLM, Plano applies rate-limiting policies to ensure that the upstream LLM service is not overwhelmed by excessive traffic. Rate limits are enforced per client or service, ensuring fair usage and preventing accidental or malicious overload. If the rate limit is exceeded, Plano may return an appropriate HTTP error (e.g., 429 Too Many Requests) without sending the prompt to the LLM.</p></li>
<li><p><strong>Seamless Request Transformation and Smart Routing</strong>:
After rate limiting, Plano normalizes the outgoing request into a provider-agnostic shape and applies smart routing decisions using the configured <aclass="reference internal"href="../../concepts/llm_providers/llm_providers.html#llm-providers"><spanclass="std std-ref">LLM Providers</span></a>. This includes translating client-specific conventions into a unified OpenAI-style contract, enriching or overriding parameters (for example, temperature or max tokens) based on policy, and choosing the best target model or provider using <aclass="reference internal"href="../../concepts/llm_providers/llm_providers.html#llm-providers"><spanclass="std std-ref">model-based, alias-based, or preference-aligned routing</span></a>.</p></li>
Once the LLM processes the prompt, Plano receives the response from the LLM service. The response is typically a generated text, completion, or summarization. Upon reception, Plano decrypts (if necessary) and handles the response, passing it through any egress processing pipeline defined by the application, such as logging or additional response filtering.</p></li>
<h3>Post-request processing<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#post-request-processing"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#post-request-processing'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>Once a request completes, the stream is destroyed. The following also takes places:</p>
<ulclass="simple">
<li><p>The post-request <aclass="reference internal"href="../../guides/observability/monitoring.html#monitoring"><spanclass="std std-ref">monitoring</span></a> are updated (e.g. timing, active requests, upgrades, health checks).
<li><p><aclass="reference internal"href="../../guides/observability/access_logging.html#arch-access-logging"><spanclass="std std-ref">Access logs</span></a> are written to the access log</p></li>
<li><p><aclass="reference internal"href="../../guides/observability/tracing.html#arch-overview-tracing"><spanclass="std std-ref">Trace</span></a> spans are finalized. If our example request was traced, a
trace span, describing the duration and details of the request would be created by the HCM when
processing request headers and then finalized by the HCM during post-request processing.</p></li>
<h2>Configuration<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#configuration"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#configuration'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>Today, only support a static bootstrap configuration file for simplicity today:</p>
</span><spanid="line-17"><spanclass="w"></span><spanclass="nt">description</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">handel all scenarios that are question and answer in nature. Like summarization, information extraction, etc.</span>
</span><spanid="line-21"><spanclass="w"></span><spanclass="c1"># Arch uses the default LLM and treats the response from the endpoint as the prompt to send to the LLM</span>
</span><spanid="line-23"><spanclass="w"></span><spanclass="c1"># override system prompt for this prompt target</span>
</span><spanid="line-24"><spanclass="w"></span><spanclass="nt">system_prompt</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">You are a helpful information extraction assistant. Use the information that is provided to you.</span>
</span><spanid="line-27"><spanclass="w"></span><spanclass="nt">description</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Reboot a specific network device</span>
</span><spanid="line-34"><spanclass="w"></span><spanclass="nt">description</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Identifier of the network device to reboot.</span>
</span><spanid="line-38"><spanclass="w"></span><spanclass="nt">description</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Confirmation flag to proceed with reboot.</span>
</span><spanid="line-42"><spanclass="c1"># Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.</span>