<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jangwook Kim</title>
    <description>The latest articles on DEV Community by Jangwook Kim (@jangwook_kim_e31e7291ad98).</description>
    <link>https://dev.to/jangwook_kim_e31e7291ad98</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1909290%2F60a8c15f-b2b5-4189-8578-78b8ab78900b.jpg</url>
      <title>DEV Community: Jangwook Kim</title>
      <link>https://dev.to/jangwook_kim_e31e7291ad98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jangwook_kim_e31e7291ad98"/>
    <language>en</language>
    <item>
      <title>MCP STDIO Is Code Execution: Harden Servers Before Launch</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Fri, 04 Dec 2026 00:36:18 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/mcp-stdio-is-code-execution-harden-servers-before-launch-3h61</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/mcp-stdio-is-code-execution-harden-servers-before-launch-3h61</guid>
      <description>&lt;h2&gt;
  
  
  Why We Treat Local MCP Registration as Executable Deployment
&lt;/h2&gt;

&lt;p&gt;The production decision we care about is not whether an MCP server can answer a tool call. It is whether we can afford to let its executable start.&lt;/p&gt;

&lt;p&gt;The security boundary comes before launch&lt;/p&gt;
&lt;p&gt;A configured STDIO command runs before MCP validation, so initialization errors cannot undo startup effects; isolate and constrain the server before launch.&lt;/p&gt;

&lt;p&gt;A local STDIO server is an operating-system process. The client launches an executable, supplies arguments and an environment, and exchanges protocol messages over standard streams. Without an additional boundary, that executable can exercise the permissions of its account before it returns any useful MCP response.&lt;/p&gt;

&lt;p&gt;We therefore treat MCP registration as executable deployment, not integration configuration.&lt;/p&gt;

&lt;p&gt;In our security review, we treated execution before MCP validation as the key launch-time failure mode (&lt;a href="https://labs.cloudsecurityalliance.org/research/csa-research-note-mcp-by-design-rce-ox-security-20260420-csa/" rel="noopener noreferrer"&gt;CSA’s &lt;em&gt;MCP by Design: RCE Across the AI Agent Ecosystem&lt;/em&gt;&lt;/a&gt;). The critical ordering is straightforward: the configured command runs before the client can establish that it speaks MCP. An initialization error cannot undo filesystem writes or other startup effects.&lt;/p&gt;

&lt;p&gt;We distinguish that behavior from an automatically exploitable remote vulnerability. Launching a deliberately selected local executable is expected process behavior. It becomes an attacker-controlled execution path when an adversary can influence registration, command arguments, executable contents, or the configuration used to launch it. Shell metacharacters are not required; selecting a malicious executable is sufficient.&lt;/p&gt;

&lt;p&gt;We also kept two supply-chain scenarios in the threat model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In our threat-model review, we examined a controlled malicious-server scenario in which convincing productivity tools masked collection and exfiltration (&lt;a href="https://securelist.com/model-context-protocol-for-ai-integration-abused-in-supply-chain-attacks/117473/" rel="noopener noreferrer"&gt;Securelist demonstration&lt;/a&gt;). We use that scenario to reject “the advertised tool works” as a security acceptance test, without treating it as evidence that every similar package is malicious.&lt;/li&gt;
&lt;li&gt;In our hosting-risk review, we traced a compromise path from build-context traversal through an overprivileged credential to access to more than 3,000 hosted servers (&lt;a href="https://blog.gitguardian.com/breaking-mcp-server-hosting/" rel="noopener noreferrer"&gt;GitGuardian Smithery disclosure&lt;/a&gt;). We distinguish that demonstrated exposure from a confirmed malicious attack: the vulnerability was patched, and no evidence of malicious exploitation was found.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are different entry points. Our architecture response is consistent: constrain installation, build, launch, and runtime separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our local validation stopped at an infrastructure prerequisite: the &lt;code&gt;python:3.12-slim&lt;/code&gt; Docker image was unavailable.&lt;/strong&gt; We did not obtain successful container attack results, escape results, or performance measurements. The worked example below is our reproducible acceptance harness, with expected output explicitly labeled—not a claim that an unavailable run succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We designed this walkthrough for a Linux Docker host with no real secrets, cloud account, or external attack endpoint. Image acquisition may require registry access; the runtime fixture itself needs none.&lt;/p&gt;

&lt;p&gt;The example uses a deliberately small STDIO MCP fixture rather than an unreviewed package. It supports initialization, tool discovery, and a diagnostic tool call. It is not a production server or a protocol-conformance suite.&lt;/p&gt;

&lt;p&gt;Our fixture attempts to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read a synthetic secret outside the project mount.&lt;/li&gt;
&lt;li&gt;Reach that same secret through a project symlink.&lt;/li&gt;
&lt;li&gt;Modify the read-only project.&lt;/li&gt;
&lt;li&gt;Write to the read-only root filesystem.&lt;/li&gt;
&lt;li&gt;Reach a documentation-only network address.&lt;/li&gt;
&lt;li&gt;Observe a synthetic environment variable.&lt;/li&gt;
&lt;li&gt;Write a startup marker before processing protocol input.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We keep all targets synthetic. The numeric limits below are illustrative policy settings, not measured server requirements or incident statistics.&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;run-lab.sh&lt;/code&gt; and execute it with Bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

&lt;span class="nv"&gt;IMAGE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"${IMAGE:-python:3.12-slim}"&lt;/span&gt;
&lt;span class="nv"&gt;LAB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(mktemp -d)"&lt;/span&gt;
&lt;span class="nb"&gt;trap&lt;/span&gt; &lt;span class="s1"&gt;'rm -rf "$LAB"'&lt;/span&gt; EXIT

mkdir -p &lt;span class="s2"&gt;"$LAB/project"&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/private"&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/build"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'Synthetic project\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/project/README.md"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'DUMMY_SECRET_ONLY\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/private/canary"&lt;/span&gt;
ln -s /private/canary &lt;span class="s2"&gt;"$LAB/project/secret-link"&lt;/span&gt;
chmod 755 &lt;span class="s2"&gt;"$LAB"&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/project"&lt;/span&gt;
chmod 644 &lt;span class="s2"&gt;"$LAB/project/README.md"&lt;/span&gt;

cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/build/server.py"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import json
import os
from pathlib import Path
import socket
import sys

&lt;span class="c"&gt;# This side effect happens before any MCP initialization request.&lt;/span&gt;
Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/tmp/startup-marker"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.write_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"started\n"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"fixture: startup marker written"&lt;/span&gt;, &lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sys.stderr, &lt;span class="nv"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;

def attempt&lt;span class="o"&gt;(&lt;/span&gt;fn&lt;span class="o"&gt;)&lt;/span&gt;:
    try:
        fn&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"ALLOWED"&lt;/span&gt;
    except Exception as exc:
        &lt;span class="nb"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:"&lt;/span&gt; + &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;exc&lt;span class="o"&gt;)&lt;/span&gt;.__name__

def connect_probe&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    &lt;span class="c"&gt;# Documentation-only address; no real exfiltration destination.&lt;/span&gt;
    with socket.create_connection&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"192.0.2.1"&lt;/span&gt;, 443&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt;:
        pass

def probe&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    &lt;span class="nb"&gt;return&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"outside_read"&lt;/span&gt;: attempt&lt;span class="o"&gt;(&lt;/span&gt;
            lambda: Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/private/canary"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="s2"&gt;"symlink_read"&lt;/span&gt;: attempt&lt;span class="o"&gt;(&lt;/span&gt;
            lambda: Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/project/secret-link"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="s2"&gt;"project_write"&lt;/span&gt;: attempt&lt;span class="o"&gt;(&lt;/span&gt;
            lambda: Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/project/probe"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.write_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"dummy"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="s2"&gt;"root_write"&lt;/span&gt;: attempt&lt;span class="o"&gt;(&lt;/span&gt;
            lambda: Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/etc/probe"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.write_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"dummy"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="s2"&gt;"network_connect"&lt;/span&gt;: attempt&lt;span class="o"&gt;(&lt;/span&gt;connect_probe&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="s2"&gt;"parent_canary_visible"&lt;/span&gt;: &lt;span class="s2"&gt;"PARENT_CANARY"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; os.environ,
        &lt;span class="s2"&gt;"startup_marker_exists"&lt;/span&gt;: Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/tmp/startup-marker"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.exists&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; line &lt;span class="k"&gt;in&lt;/span&gt; sys.stdin:
    request &lt;span class="o"&gt;=&lt;/span&gt; json.loads&lt;span class="o"&gt;(&lt;/span&gt;line&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt; not &lt;span class="k"&gt;in&lt;/span&gt; request:
        &lt;span class="nb"&gt;continue&lt;/span&gt;
    method &lt;span class="o"&gt;=&lt;/span&gt; request.get&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"method"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; method &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"initialize"&lt;/span&gt;:
        result &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"protocolVersion"&lt;/span&gt;: &lt;span class="s2"&gt;"2024-11-05"&lt;/span&gt;,
            &lt;span class="s2"&gt;"capabilities"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"tools"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
            &lt;span class="s2"&gt;"serverInfo"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"isolation-fixture"&lt;/span&gt;, &lt;span class="s2"&gt;"version"&lt;/span&gt;: &lt;span class="s2"&gt;"0.1"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; method &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"tools/list"&lt;/span&gt;:
        result &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"tools"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"probe"&lt;/span&gt;,
            &lt;span class="s2"&gt;"description"&lt;/span&gt;: &lt;span class="s2"&gt;"Run synthetic isolation checks."&lt;/span&gt;,
            &lt;span class="s2"&gt;"inputSchema"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="s2"&gt;"object"&lt;/span&gt;,
                &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
                &lt;span class="s2"&gt;"additionalProperties"&lt;/span&gt;: False,
            &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; method &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"tools/call"&lt;/span&gt;:
        &lt;span class="k"&gt;if&lt;/span&gt; request.get&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"params"&lt;/span&gt;, &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.get&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; != &lt;span class="s2"&gt;"probe"&lt;/span&gt;:
            result &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"isError"&lt;/span&gt;: True,
                &lt;span class="s2"&gt;"content"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="s2"&gt;"text"&lt;/span&gt;, &lt;span class="s2"&gt;"text"&lt;/span&gt;: &lt;span class="s2"&gt;"Unknown tool"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
            &lt;span class="o"&gt;}&lt;/span&gt;
        else:
            result &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"content"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="s2"&gt;"text"&lt;/span&gt;,
                &lt;span class="s2"&gt;"text"&lt;/span&gt;: json.dumps&lt;span class="o"&gt;(&lt;/span&gt;probe&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;sort_keys&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;,
            &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
    else:
        print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;: &lt;span class="s2"&gt;"2.0"&lt;/span&gt;,
            &lt;span class="s2"&gt;"id"&lt;/span&gt;: request&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
            &lt;span class="s2"&gt;"error"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"code"&lt;/span&gt;: -32601, &lt;span class="s2"&gt;"message"&lt;/span&gt;: &lt;span class="s2"&gt;"Method not found"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;continue&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;: &lt;span class="s2"&gt;"2.0"&lt;/span&gt;, &lt;span class="s2"&gt;"id"&lt;/span&gt;: request&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"result"&lt;/span&gt;: result
    &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
PY

cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"$LAB/build/Dockerfile"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'DOCKER'&lt;/span&gt;
&lt;span class="k"&gt;ARG&lt;/span&gt; BASE
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;${BASE}&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt; --chmod=0444 server.py /app/server.py
&lt;span class="k"&gt;USER&lt;/span&gt; 65534:65534
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;, &lt;span class="s2"&gt;"-I"&lt;/span&gt;, &lt;span class="s2"&gt;"-u"&lt;/span&gt;, &lt;span class="s2"&gt;"/app/server.py"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
DOCKER

&lt;span class="c"&gt;# Acquire and approve the base image before an offline run.&lt;/span&gt;
docker image inspect &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null
docker build --network=none \
  --build-arg &lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; \
  -t effloow-mcp-isolation-fixture &lt;span class="s2"&gt;"$LAB/build"&lt;/span&gt;

&lt;span class="nv"&gt;FIXTURE_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(docker image inspect \
  --format '{{.Id}}' effloow-mcp-isolation-fixture)"&lt;/span&gt;

&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PARENT_CANARY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"DUMMY_PARENT_ONLY"&lt;/span&gt;

cat &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'JSON'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; docker run --rm -i \
  --network=none \
  --read-only \
  --user=65534:65534 \
  --cap-drop=ALL \
  --security-opt=no-new-privileges:true \
  --pids-limit=64 \
  --memory=128m \
  --cpus=0.5 \
  --ulimit &lt;span class="nv"&gt;nofile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;256:256 \
  --tmpfs /tmp:rw,noexec,nosuid,nodev,size=16m,mode=1777 \
  --mount &lt;span class="s2"&gt;"type=bind,src=$LAB/project,dst=/project,readonly"&lt;/span&gt; \
  --env &lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp \
  --env &lt;span class="nv"&gt;PYTHONDONTWRITEBYTECODE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 \
  --log-driver=none \
  &lt;span class="s2"&gt;"$FIXTURE_ID"&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;:&lt;span class="s2"&gt;"2.0"&lt;/span&gt;,&lt;span class="s2"&gt;"id"&lt;/span&gt;:1,&lt;span class="s2"&gt;"method"&lt;/span&gt;:&lt;span class="s2"&gt;"initialize"&lt;/span&gt;,&lt;span class="s2"&gt;"params"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"protocolVersion"&lt;/span&gt;:&lt;span class="s2"&gt;"2024-11-05"&lt;/span&gt;,&lt;span class="s2"&gt;"capabilities"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,&lt;span class="s2"&gt;"clientInfo"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;:&lt;span class="s2"&gt;"fixture-driver"&lt;/span&gt;,&lt;span class="s2"&gt;"version"&lt;/span&gt;:&lt;span class="s2"&gt;"0.1"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;:&lt;span class="s2"&gt;"2.0"&lt;/span&gt;,&lt;span class="s2"&gt;"method"&lt;/span&gt;:&lt;span class="s2"&gt;"notifications/initialized"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;:&lt;span class="s2"&gt;"2.0"&lt;/span&gt;,&lt;span class="s2"&gt;"id"&lt;/span&gt;:2,&lt;span class="s2"&gt;"method"&lt;/span&gt;:&lt;span class="s2"&gt;"tools/list"&lt;/span&gt;,&lt;span class="s2"&gt;"params"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"jsonrpc"&lt;/span&gt;:&lt;span class="s2"&gt;"2.0"&lt;/span&gt;,&lt;span class="s2"&gt;"id"&lt;/span&gt;:3,&lt;span class="s2"&gt;"method"&lt;/span&gt;:&lt;span class="s2"&gt;"tools/call"&lt;/span&gt;,&lt;span class="s2"&gt;"params"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;:&lt;span class="s2"&gt;"probe"&lt;/span&gt;,&lt;span class="s2"&gt;"arguments"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
JSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We intentionally require the base image to exist locally. On a connected preparation machine, acquire an approved base image, record its digest, and pass that immutable reference through &lt;code&gt;IMAGE&lt;/code&gt;. Our default tag makes the example accessible; it is not the production pinning policy.&lt;/p&gt;

&lt;p&gt;Our actual attempt stopped before a fixture build because the base image was unavailable. We have no successful runtime transcript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simulated output for a correctly enforced boundary&lt;/strong&gt; would include this stderr line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fixture: startup marker written
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final JSON-RPC response would contain a text payload shaped like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"network_connect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:OSError"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"outside_read"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:FileNotFoundError"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"parent_canary_visible"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"project_write"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:OSError"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"root_write"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:OSError"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"startup_marker_exists"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"symlink_read"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"BLOCKED:FileNotFoundError"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exception classes can vary. We would gate on the operations failing, not exact exception strings.&lt;/p&gt;

&lt;p&gt;The symlink result needs careful interpretation: the absolute link resolves inside the container’s filesystem view, where &lt;code&gt;/private/canary&lt;/code&gt; is absent. It does not demonstrate resistance to every traversal technique or validate another server’s path handling.&lt;/p&gt;

&lt;p&gt;Likewise, the network probe is a smoke test, not proof of comprehensive egress enforcement. We would inspect the network configuration and add controlled reachability tests before deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Limitations and Remaining Deployment Risks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Our first failure was image availability
&lt;/h3&gt;

&lt;p&gt;We could not execute the Docker fixture without its base image. That sounds mundane, but it belongs in the production assessment: an isolation policy that depends on an unavailable artifact does not deliver a working service.&lt;/p&gt;

&lt;p&gt;Our operational workaround is a preparation stage: mirror approved images, pin their digests, verify availability on deployment hosts, and prohibit runtime package resolution. We did not validate that workaround in this run.&lt;/p&gt;

&lt;p&gt;We would not respond by temporarily launching the same server directly on the host.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initialization is too late to establish trust
&lt;/h3&gt;

&lt;p&gt;We place the startup marker before the fixture reads stdin because this ordering is the central risk in the &lt;a href="https://labs.cloudsecurityalliance.org/research/csa-research-note-mcp-by-design-rce-ox-security-20260420-csa/" rel="noopener noreferrer"&gt;CSA execution analysis&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A follow-up negative test should launch a fixture that writes the marker and exits without speaking MCP. The acceptance criterion is that the client rejects initialization &lt;strong&gt;while containment remains intact&lt;/strong&gt;. The marker inside permitted scratch space is acceptable; an equivalent write into host configuration is not.&lt;/p&gt;

&lt;p&gt;We have not run that negative test with a pinned SDK here. Nor have we established whether a particular client reliably cleans up delayed descendants after initialization failure. We require explicit process-tree cleanup tests rather than assuming an error response means execution stopped.&lt;/p&gt;

&lt;h3&gt;
  
  
  An executable allowlist can still authorize arbitrary code
&lt;/h3&gt;

&lt;p&gt;We do not approve &lt;code&gt;python&lt;/code&gt;, &lt;code&gt;node&lt;/code&gt;, &lt;code&gt;npx&lt;/code&gt;, or &lt;code&gt;docker&lt;/code&gt; by executable name alone. Those are launch mechanisms, not narrowly bounded capabilities.&lt;/p&gt;

&lt;p&gt;Our production registration maps a reviewed server identifier to an immutable image, fixed entrypoint, constrained arguments, explicit mounts, and a per-server environment. We keep that mapping outside model-writable files. We also prohibit arbitrary Docker flags: access to the Docker socket or launcher authority could bypass the policy entirely.&lt;/p&gt;

&lt;p&gt;For the same reason, we do not mount the host home directory, SSH agent socket, Docker socket, or client configuration directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Read-only storage and non-root execution are necessary, not sufficient
&lt;/h3&gt;

&lt;p&gt;We expect real servers to need caches, temporary files, or writable working directories. Our response is to provide bounded scratch space or a narrow dedicated data volume—not to make the whole project writable.&lt;/p&gt;

&lt;p&gt;We retain Docker’s default seccomp policy and the host’s applicable security-module policy. We would verify their effective configuration on the deployment host; the flags above do not prove their presence.&lt;/p&gt;

&lt;p&gt;Containers also share a kernel. This fixture attempts ordinary reads, writes, and connectivity, not kernel exploitation. We make no sandbox-escape-resistance claim.&lt;/p&gt;

&lt;p&gt;Finally, blocking direct network access does not eliminate data leakage. A server can return mounted content through legitimate tool output. Our &lt;a href="https://dev.to/articles/docker-mcp-gateway-security-boundary-hands-on-2026"&gt;Docker MCP Gateway review&lt;/a&gt; addresses the adjacent routing boundary; we still need tenant-aware authorization and careful handling of tool results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We cannot supply startup latency, throughput, or memory measurements from an unexecuted container run. The memory and CPU flags in the harness are ceilings, not observed consumption.&lt;/p&gt;

&lt;p&gt;Our comparison is therefore architectural:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Execution model&lt;/th&gt;
&lt;th&gt;Boundary we would rely on&lt;/th&gt;
&lt;th&gt;Operational cost driver&lt;/th&gt;
&lt;th&gt;Our deployment position&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bare host subprocess&lt;/td&gt;
&lt;td&gt;Host account permissions&lt;/td&gt;
&lt;td&gt;Low setup effort; potentially broad incident scope&lt;/td&gt;
&lt;td&gt;Only trusted code with deliberately limited account access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hardened Docker or Podman&lt;/td&gt;
&lt;td&gt;Namespaces, mounts, reduced privileges, runtime policy&lt;/td&gt;
&lt;td&gt;Image lifecycle, compatibility tests, resource management&lt;/td&gt;
&lt;td&gt;Baseline candidate for local third-party servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dedicated OS account&lt;/td&gt;
&lt;td&gt;Account permissions and host policy&lt;/td&gt;
&lt;td&gt;Account provisioning and filesystem hygiene&lt;/td&gt;
&lt;td&gt;Useful additional boundary, not automatic egress isolation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MicroVM&lt;/td&gt;
&lt;td&gt;Separate guest kernel and virtualized boundary&lt;/td&gt;
&lt;td&gt;Image preparation, lifecycle, storage and networking&lt;/td&gt;
&lt;td&gt;Stronger candidate for mutually untrusted execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote MCP service&lt;/td&gt;
&lt;td&gt;Provider isolation plus client-side authorization&lt;/td&gt;
&lt;td&gt;Service pricing, credential custody and vendor review&lt;/td&gt;
&lt;td&gt;Useful when local resources are unnecessary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would not treat a remote endpoint as an automatic security upgrade. The &lt;a href="https://blog.gitguardian.com/breaking-mcp-server-hosting/" rel="noopener noreferrer"&gt;Smithery disclosure&lt;/a&gt; puts builder credentials and concentrated hosting authority directly into that decision. Our &lt;a href="https://dev.to/articles/composio-agent-tool-auth-production-isolation-2026"&gt;Composio review&lt;/a&gt; covers the related token-custody question.&lt;/p&gt;

&lt;p&gt;For stronger local separation, we would evaluate the operational trade-offs in our &lt;a href="https://dev.to/articles/firecracker-microvm-agent-code-execution-isolation-2026"&gt;Firecracker sandbox review&lt;/a&gt;, rather than claiming a container flag provides an equivalent boundary.&lt;/p&gt;

&lt;p&gt;Our practical break-even model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Monthly isolation cost =
  amortized implementation labor
  + recurring maintenance labor
  + incremental compute and storage

Isolation is economically justified when:
  expected reduction in monthly incident loss
  &amp;gt; monthly isolation cost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would populate that with internal labor rates and the actual privileges at risk. We would not derive incident probability from download counts or substitute unsupported benchmark figures.&lt;/p&gt;

&lt;p&gt;For scale testing, we separate cold startup, warm tool-call latency, concurrent container count, output volume, and cleanup time. We also test slow readers and stderr flooding: a bounded container can still overwhelm an unbounded client-side buffer.&lt;/p&gt;

&lt;p&gt;Keeping containers warm may reduce repeated startup work, but it retains process state longer. Our acceptance gate is isolation between principals and bounded lifecycle behavior—not simply a faster median call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Our verdict is a conditional go for the architecture, not a passed runtime certification.&lt;/strong&gt; Hardened local execution is the right baseline candidate when a server genuinely needs local resources. Our own container acceptance run remains incomplete.&lt;/p&gt;

&lt;p&gt;We would deploy only when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Registration is reviewed and cannot be rewritten by model output.&lt;/li&gt;
&lt;li&gt;[ ] Images and dependencies are pinned and available before launch.&lt;/li&gt;
&lt;li&gt;[ ] Installation and builds run without unrelated host secrets.&lt;/li&gt;
&lt;li&gt;[ ] The server runs non-root without added capabilities or privileged mode.&lt;/li&gt;
&lt;li&gt;[ ] Only explicitly approved directories are mounted, preferably read-only.&lt;/li&gt;
&lt;li&gt;[ ] Credentials are server-specific and narrowly scoped.&lt;/li&gt;
&lt;li&gt;[ ] Egress is denied or enforced through a controlled destination policy.&lt;/li&gt;
&lt;li&gt;[ ] CPU, memory, process count, scratch space, and output are bounded.&lt;/li&gt;
&lt;li&gt;[ ] Initialization failure triggers verified cleanup.&lt;/li&gt;
&lt;li&gt;[ ] Synthetic filesystem, environment, network, and lifecycle tests pass.&lt;/li&gt;
&lt;li&gt;[ ] Tool-result authorization remains enforced outside the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would hold off when a server requires broad home-directory access, accepts arbitrary launch parameters, installs dependencies at startup, or needs unrestricted credentials for a narrow task.&lt;/p&gt;

&lt;p&gt;We would avoid shared-kernel execution for workloads whose adversary model demands a stronger boundary. We would also skip local installation when the capability needs no local resources and a properly assessed remote service meets the requirement.&lt;/p&gt;

&lt;p&gt;The lesson we carry into deployment review is simple: &lt;strong&gt;a valid MCP response is not evidence that startup was safe, and an initialization error is not evidence that nothing ran.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For an effloow &lt;a href="https://dev.to/proof-studio"&gt;Proof Studio assessment&lt;/a&gt;, we would make the deliverable a recorded launch policy, reproducible negative tests, lifecycle evidence, and explicit residual risks. Until those checks run successfully, we keep the server out of the trusted execution path.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>security</category>
      <category>docker</category>
      <category>agentinfrastructure</category>
    </item>
    <item>
      <title>RunPod Serverless: Cold Starts, Billing, and Scaling Risks</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Thu, 03 Dec 2026 00:41:10 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/runpod-serverless-cold-starts-billing-and-scaling-risks-11bp</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/runpod-serverless-cold-starts-billing-and-scaling-risks-11bp</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated RunPod Serverless
&lt;/h2&gt;

&lt;p&gt;Our question was not whether serverless GPUs can execute inference. It was whether scale-to-zero saves enough money to justify the latency and operational uncertainty it introduces.&lt;/p&gt;

&lt;p&gt;For bursty inference, the expensive unit is not necessarily a request. It is the worker lifecycle surrounding that request: initialization, execution, and paid waiting before shutdown. A cheap GPU-second becomes less attractive when a short job repeatedly pays for model loading.&lt;/p&gt;

&lt;p&gt;RunPod Serverless puts our container behind either a managed job queue or a direct HTTP load-balancing endpoint. We retain responsibility for model initialization, CUDA compatibility, request safety, and application-level concurrency. The platform manages worker provisioning and scaling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our verdict is conditional: this is a credible candidate for asynchronous, bursty inference, not a demonstrated latency guarantee for interactive workloads.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to establish the evidence boundary immediately. We reviewed the supplied service references and the published 2026 comparison, but did not execute a live GPU deployment or obtain billing records for this review. The commands below are a reproducible deployment example, not a transcript of completed lab runs. We therefore cannot honestly publish measured min-worker comparisons, invoice reconciliation, or volume throughput.&lt;/p&gt;

&lt;p&gt;That limitation does not prevent an architectural decision. It does prevent us from turning a single cold-start median into a production promise.&lt;/p&gt;

&lt;p&gt;We approached this with the same distinction we use in our &lt;a href="https://dev.to/articles/tei-batching-reranker-serving-production-2026"&gt;TEI batching and single-GPU review&lt;/a&gt;: infrastructure readiness, queue delay, and model execution are different measurements. Combining them into one attractive number hides the failure mode we need to price.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducible Deployment Example and Measurement Plan
&lt;/h2&gt;

&lt;p&gt;We would start with a queue-based endpoint and a deliberately small GPU model. A tiny model isolates worker lifecycle overhead better than a multi-gigabyte LLM, although it cannot predict LLM loading latency.&lt;/p&gt;

&lt;p&gt;The example below uses a randomly initialized linear layer. It exercises CUDA inference without requiring model downloads, credentials for a model repository, or claims about model quality.&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;handler.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;runpod&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;

&lt;span class="n"&gt;boot_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;init_start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_available&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CUDA is required for this audit"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;manual_seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Linear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"cuda"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inference_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;synchronize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"model_ready"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"boot_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;boot_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"model_init_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;init_start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"values"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Expected exactly 16 numeric values"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;started&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tensor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;float32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"cuda"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inference_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tensor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;synchronize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"boot_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;boot_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"worker_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RUNPOD_POD_ID"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"unknown"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"gpu"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_device_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"handler_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;started&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tolist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="n"&gt;runpod&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;serverless&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"handler"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Dockerfile would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404

&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;RUN&lt;/span&gt; python -m pip install --no-cache-dir runpod
&lt;span class="k"&gt;COPY&lt;/span&gt; handler.py /app/handler.py

&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;, &lt;span class="s2"&gt;"-u"&lt;/span&gt;, &lt;span class="s2"&gt;"/app/handler.py"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK installation intentionally resolves the current package. Before collecting comparable results, we would capture that resolved version, lock it, and pin the container digest. This is bootstrap code, not an immutable benchmark environment.&lt;/p&gt;

&lt;p&gt;With Docker registry credentials configured, these commands build the worker and create an endpoint through REST v2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

: &lt;span class="s2"&gt;"${RUNPOD_API_KEY:?Set RUNPOD_API_KEY}"&lt;/span&gt;
: &lt;span class="s2"&gt;"${IMAGE:?Set IMAGE to a writable registry image tag}"&lt;/span&gt;

docker build --platform linux/amd64 -t &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; .
docker push &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt;

jq -n --arg image &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; &lt;span class="s1"&gt;'{
  name: "effloow-gpu-lifecycle-audit",
  image: $image,
  type: "QUEUE",
  gpu: {pools: ["ADA_24"], count: 1},
  workers: {
    min: 0,
    max: 3,
    idleTimeout: 5,
    initTimeout: 420
  },
  scaling: {type: "QUEUE_DELAY", queueDelay: 4},
  timeout: 300000,
  flashboot: "OFF"
}'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; endpoint.json

curl --fail-with-body --silent --show-error \
  https://api.runpod.io/v2/serverless \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $RUNPOD_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  --data-binary @endpoint.json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; created.json

&lt;span class="nv"&gt;ENDPOINT_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(jq -er '.id' created.json)"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"$ENDPOINT_ID"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; endpoint-id.txt

curl --fail-with-body --silent --show-error \
  &lt;span class="s2"&gt;"https://api.runpod.ai/v2/$ENDPOINT_ID/run"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $RUNPOD_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{"input":{"values":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; tee submitted.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative response only—not observed service output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"illustrative-job-id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"IN_QUEUE"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use separate control-plane and inference hosts deliberately: endpoint creation goes to &lt;code&gt;api.runpod.io&lt;/code&gt;; job submission goes to &lt;code&gt;api.runpod.ai&lt;/code&gt;. Our API key needs the appropriate endpoint-management and inference permissions, including &lt;code&gt;serverless:write&lt;/code&gt; for creation.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;ADA_24&lt;/code&gt; pool makes this a small-model smoke test, &lt;strong&gt;not a reproduction of the A100 benchmark&lt;/strong&gt;. For a matched comparison, we would select the A100 pool from the current GPU catalog and record the actual assigned card.&lt;/p&gt;

&lt;p&gt;Our measurement plan has two otherwise identical endpoints: &lt;code&gt;workers.min=0&lt;/code&gt; and &lt;code&gt;workers.min=1&lt;/code&gt;. We would wait for the warm endpoint to become ready and verify the zero-minimum endpoint has no running workers before submitting its next isolated request.&lt;/p&gt;

&lt;p&gt;For each request, our harness would retain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Submission, acceptance, and completion timestamps.&lt;/li&gt;
&lt;li&gt;Job status, worker identity, and application boot identity.&lt;/li&gt;
&lt;li&gt;Available queue-delay and execution metrics.&lt;/li&gt;
&lt;li&gt;Worker startup and readiness logs.&lt;/li&gt;
&lt;li&gt;Exact image digest, SDK version, GPU, placement, and FlashBoot setting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The timer inside the handler measures only handler work. Even &lt;code&gt;model_init_ms&lt;/code&gt; excludes scheduling and container startup. We would not label either value “end-to-end cold start.”&lt;/p&gt;

&lt;p&gt;A completed audit also needs worker lifecycle records and attributable billing usage. Without those, subtracting handler time from wall-clock latency does not tell us how many seconds were charged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration Risks and Verification Limits
&lt;/h2&gt;

&lt;p&gt;Our first roadblock was evidence completeness: the available material does not establish the controlled min-zero versus min-one result the deployment decision needs. The useful findings are configuration and lifecycle hazards, not failures we observed on live hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Our deployment path changes the defaults
&lt;/h3&gt;

&lt;p&gt;The most actionable mismatch we found in the &lt;a href="https://docs.runpod.io/serverless/endpoints/endpoint-configurations" rel="noopener noreferrer"&gt;endpoint settings reference&lt;/a&gt; is between console-created and REST-created endpoints.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Console default&lt;/th&gt;
&lt;th&gt;REST v2 default&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Idle timeout&lt;/td&gt;
&lt;td&gt;5 seconds&lt;/td&gt;
&lt;td&gt;10 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution timeout&lt;/td&gt;
&lt;td&gt;600 seconds&lt;/td&gt;
&lt;td&gt;300,000 milliseconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FlashBoot&lt;/td&gt;
&lt;td&gt;Enabled&lt;/td&gt;
&lt;td&gt;Off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Endpoint-level job TTL&lt;/td&gt;
&lt;td&gt;24 hours&lt;/td&gt;
&lt;td&gt;No create-time field; use per-request policy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Our workaround is to specify lifecycle settings explicitly and inspect the resulting configuration. Otherwise, a console experiment and an automated rollout can differ while appearing equivalent.&lt;/p&gt;

&lt;p&gt;FlashBoot particularly matters: we cannot compare a state-retention revival with a fresh boot and call the difference a GPU-provider advantage.&lt;/p&gt;

&lt;h3&gt;
  
  
  One warm worker does not make the endpoint permanently warm
&lt;/h3&gt;

&lt;p&gt;We read &lt;code&gt;workers.min=1&lt;/code&gt; as one baseline worker kept running, with continuous charges even without jobs. We do &lt;strong&gt;not&lt;/strong&gt; read it as a guarantee that every request avoids cold starts.&lt;/p&gt;

&lt;p&gt;If that worker is busy, additional capacity may still require initialization. Restarts and releases also remain relevant. Our production gate would distinguish isolated warm requests from burst requests that exceed warm capacity.&lt;/p&gt;

&lt;p&gt;For the documented request-count scaler, the target worker calculation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ceil((queued requests + requests in progress) / scalerValue)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The queue-delay scaler instead adds workers when waiting crosses its threshold. A four-second setting is a scaling trigger, not a four-second completion guarantee.&lt;/p&gt;

&lt;h3&gt;
  
  
  Max workers is not model-serving concurrency
&lt;/h3&gt;

&lt;p&gt;With three workers, we have a worker-pool limit. We have not established three simultaneous token streams, three GPU kernels, or three requests per worker.&lt;/p&gt;

&lt;p&gt;Our simple handler avoids application-level concurrent dispatch. For an LLM runtime, batching and in-flight request admission become separate controls. We would measure those independently, just as we distinguish routing from model-runtime behavior in our &lt;a href="https://dev.to/articles/sglang-agentx-prefix-cache-speculative-decoding-agents-2026"&gt;SGLang prefix-caching review&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Queue-based endpoints accept backlog. Load-balancing endpoints provide no managed backlog queue. Moving to direct HTTP therefore changes overload behavior, not merely URL shape.&lt;/p&gt;

&lt;h3&gt;
  
  
  Queue delay, execution timeout, and TTL cover different intervals
&lt;/h3&gt;

&lt;p&gt;We found no explicit maximum queue depth or standalone queue-wait limit in the supplied references. We would not invent one.&lt;/p&gt;

&lt;p&gt;The limits we can identify are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialization timeout: default 420 seconds; documented range 60–14,400 seconds.&lt;/li&gt;
&lt;li&gt;Execution timeout: documented range five seconds to seven days.&lt;/li&gt;
&lt;li&gt;Job TTL: default 24 hours; documented range ten seconds to seven days.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TTL starts at submission. A job waiting 45 minutes with a one-hour TTL has only 15 minutes left in the system. In our deadline design, we account for job deletion at TTL expiry—even during execution—and subsequent status checks returning 404. We have not exercised that boundary on a live endpoint.&lt;/p&gt;

&lt;p&gt;Our workaround would be to size TTL for queueing &lt;strong&gt;plus&lt;/strong&gt; execution, persist important results externally, and make side effects idempotent. A client HTTP timeout must not automatically trigger a duplicate submission.&lt;/p&gt;

&lt;h3&gt;
  
  
  Persistent storage changes placement
&lt;/h3&gt;

&lt;p&gt;Network volumes preserve files across worker restarts, but add network access and restrict the endpoint to the volume’s data center. That trades repeated downloads for a narrower placement pool.&lt;/p&gt;

&lt;p&gt;We have not measured mount latency, bandwidth, or volume charges. Our volume acceptance test would verify persistence after worker replacement, safe concurrent access, read throughput, and placement availability—not just successful mounting.&lt;/p&gt;

&lt;p&gt;One final operational trap we account for is automatic reduction of max workers after inactivity: the limit falls to two after three days without requests and zero after seven. Incoming requests reset the inactivity timer, but once the limit has been reduced, we must raise it manually. We would check deployed configuration before a dormant endpoint’s next scheduled workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;In our analysis of the &lt;a href="https://dev.to/mrzitoun/benchmarking-serverless-gpus-modal-vs-runpod-vs-replicate-cold-starts-2026-a5c"&gt;2026 cold-start comparison&lt;/a&gt;, we use the following published figures as a comparison baseline, not as measurements from our own deployment:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Hardware in comparison&lt;/th&gt;
&lt;th&gt;Published median cold start&lt;/th&gt;
&lt;th&gt;Published equivalent hourly rate&lt;/th&gt;
&lt;th&gt;Our qualification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RunPod Serverless&lt;/td&gt;
&lt;td&gt;A100 80GB&lt;/td&gt;
&lt;td&gt;4.2 seconds&lt;/td&gt;
&lt;td&gt;About $2.59&lt;/td&gt;
&lt;td&gt;Missing matched configuration and distribution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modal&lt;/td&gt;
&lt;td&gt;A100 40GB&lt;/td&gt;
&lt;td&gt;1.8 seconds&lt;/td&gt;
&lt;td&gt;About $2.85&lt;/td&gt;
&lt;td&gt;Different A100 memory configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replicate&lt;/td&gt;
&lt;td&gt;A100 80GB&lt;/td&gt;
&lt;td&gt;6.5 seconds&lt;/td&gt;
&lt;td&gt;About $4.14&lt;/td&gt;
&lt;td&gt;Missing workload detail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lambda dedicated GPU&lt;/td&gt;
&lt;td&gt;A100 80GB&lt;/td&gt;
&lt;td&gt;About 45-second VM boot&lt;/td&gt;
&lt;td&gt;$1.89&lt;/td&gt;
&lt;td&gt;VM provisioning is not the same cold-start boundary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would not turn this into a ranking for our workload. The available excerpt lacks sample counts, model, region, image size, and min-worker settings. A median also says nothing about the tail latency that governs an interactive SLA.&lt;/p&gt;

&lt;p&gt;For RunPod vs Replicate, we need matched models, containers, request shapes, and billing boundaries. For an always-on open-source runtime, we need equivalent throughput and operational cost—not merely the same GPU name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Per-second pricing is not per-request billing
&lt;/h3&gt;

&lt;p&gt;For our A100 80GB cost calculations, we use the listed rate of &lt;strong&gt;$0.00076 per second&lt;/strong&gt;, without treating it as an invoice-verified charge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$0.00076 × 3,600 = $2.736 per worker-hour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That differs from the comparison’s approximately $2.59/hour. We cannot reconcile the difference from the available evidence, and we would not use either as a binding quote.&lt;/p&gt;

&lt;p&gt;We can establish the charging boundary from the &lt;a href="https://docs.runpod.io/serverless/overview" rel="noopener noreferrer"&gt;Serverless lifecycle overview&lt;/a&gt;: initialization and running idle time are billable. We cannot independently establish invoice rounding or minimum billing increments without usage records.&lt;/p&gt;

&lt;p&gt;For planning, our simplified model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cost = sum(worker initialization + execution + paid idle seconds)
       × applicable worker rate
       + storage and other applicable charges
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Different worker classes or rates require separate terms.&lt;/p&gt;

&lt;h3&gt;
  
  
  A worked break-even example
&lt;/h3&gt;

&lt;p&gt;Assume, purely for illustration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;20 seconds of initialization.&lt;/li&gt;
&lt;li&gt;Two seconds of execution.&lt;/li&gt;
&lt;li&gt;Five seconds of paid idle time.&lt;/li&gt;
&lt;li&gt;One isolated request per worker lifecycle.&lt;/li&gt;
&lt;li&gt;A uniform $0.00076/second rate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each request then occupies 27 paid worker-seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;27 × $0.00076 = $0.02052 per isolated request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping one worker continuously running at that same illustrative rate costs $2.736/hour. The simple crossover is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$2.736 / $0.02052 ≈ 133 isolated requests/hour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a measured request-rate threshold. At that traffic level, requests may share warm workers, so the isolation assumption can fail. Bursty traffic can also launch several workers and accumulate multiple idle tails.&lt;/p&gt;

&lt;p&gt;For the dedicated GPU example, compare the published $1.89/hour with $2.736/hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$1.89 / $2.736 ≈ 69.1%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under equal capacity and excluding other costs, serverless loses its compute-price advantage once aggregate billed worker time exceeds about 69% of a continuously provisioned GPU-hour. Useful utilization can be much lower because initialization and idle waiting count too.&lt;/p&gt;

&lt;p&gt;Our purchasing metric would therefore be &lt;strong&gt;cost per successful request at the required latency&lt;/strong&gt;, including retries and failed initialization—not the advertised price per GPU-second.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We would deploy a bounded pilot when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Our workload tolerates asynchronous queueing.&lt;/li&gt;
&lt;li&gt;Traffic has meaningful idle periods.&lt;/li&gt;
&lt;li&gt;Our container initializes predictably.&lt;/li&gt;
&lt;li&gt;We can explicitly configure scaling, deadlines, and FlashBoot.&lt;/li&gt;
&lt;li&gt;We can reconcile worker lifecycles with attributed charges.&lt;/li&gt;
&lt;li&gt;We can enforce idempotency and persist results outside short-lived job history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold off when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Our interactive SLA depends on treating 4.2 seconds as a guarantee.&lt;/li&gt;
&lt;li&gt;We need min-one warmth to cover arbitrarily large bursts.&lt;/li&gt;
&lt;li&gt;Our workload keeps a GPU occupied most of the day.&lt;/li&gt;
&lt;li&gt;A volume’s placement restriction conflicts with capacity requirements.&lt;/li&gt;
&lt;li&gt;We need verified queue-depth limits or exact billing granularity before launch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our recommendation is not “serverless is cheaper.” It is narrower: &lt;strong&gt;RunPod gives us useful control over containerized GPU workers, but lifecycle overhead and admission policy determine whether that control pays off.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before promoting the pilot, we would require matched min-zero/min-one latency distributions, concurrency tests, a volume restart test, timeout-boundary tests, and invoice reconciliation. None is replaced by a simulated response or a published median.&lt;/p&gt;

&lt;p&gt;We would start with the &lt;a href="https://docs.runpod.io/serverless/endpoints/overview" rel="noopener noreferrer"&gt;endpoint creation guide&lt;/a&gt;, keep the &lt;a href="https://docs.runpod.io/serverless/endpoints/endpoint-configurations" rel="noopener noreferrer"&gt;settings reference&lt;/a&gt; beside the deployment manifest, and make the final decision from our workload’s successful-request economics. That is the difference between buying inexpensive GPU seconds and deploying an economical inference service.&lt;/p&gt;

</description>
      <category>serverlessgpu</category>
      <category>runpod</category>
      <category>inference</category>
      <category>cloudcosts</category>
    </item>
    <item>
      <title>Hugging Face TEI: Batching, p95, and Single-GPU Trade-offs</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Wed, 02 Dec 2026 00:37:31 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/hugging-face-tei-batching-p95-and-single-gpu-trade-offs-53k4</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/hugging-face-tei-batching-p95-and-single-gpu-trade-offs-53k4</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated TEI for Dedicated Serving
&lt;/h2&gt;

&lt;p&gt;We wanted to remove embedding and reranking from the application process without replacing a vendor invoice with an unpredictable GPU queue.&lt;/p&gt;

&lt;p&gt;Batching requires workload-specific validation&lt;/p&gt;
&lt;p&gt;TEI offers token-based batching and admission control, but single-GPU co-serving needs simultaneous-load testing before its latency and capacity trade-offs can be approved.&lt;/p&gt;

&lt;p&gt;Those are different workloads. Document ingestion wants sustained throughput. Query embedding wants a short, predictable response. Reranking evaluates a query against every candidate document; a top-50 request creates 50 cross-encoder pairs, not one reusable vector. Mixing all three behind an unrestricted queue is how a cheap retrieval service becomes an expensive latency problem.&lt;/p&gt;

&lt;p&gt;Hugging Face Text Embeddings Inference—TEI—addresses the serving layer: tokenization, token-based dynamic batching, admission control, model execution, and HTTP responses. We evaluate it here as infrastructure, not as a recommendation to change embedding models. Our &lt;a href="https://dev.to/articles/chonkie-token-semantic-chunking-production-2026"&gt;chunking review&lt;/a&gt; covers another variable that directly changes its workload: sequence length.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our assessment is conditional: TEI is a credible dedicated serving engine, but single-GPU embedding-plus-reranking needs workload-specific approval.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An important evidence boundary: our review environment could not launch Docker or fetch model artifacts. We therefore did not complete a TEI execution, GPU latency sweep, OOM reproduction, or cold-start measurement. The commands below are a reproducible deployment and acceptance harness—not a retrospective account of successful runs. We will not turn capacity estimates into measurements.&lt;/p&gt;

&lt;p&gt;Two corrections also matter before deployment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We use the project name &lt;strong&gt;text-embeddings-inference&lt;/strong&gt;, but the documented server executable is &lt;strong&gt;&lt;code&gt;text-embeddings-router&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;We do not treat “no built-in auth” as accurate for the current interface. TEI provides &lt;code&gt;--api-key&lt;/code&gt;; authentication is &lt;strong&gt;off unless configured&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those distinctions are more useful than a confident but unsupported performance score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We would start with the official &lt;a href="https://github.com/huggingface/text-embeddings-inference/" rel="noopener noreferrer"&gt;TEI repository&lt;/a&gt; and &lt;a href="https://huggingface.co/docs/text-embeddings-inference/quick_tour" rel="noopener noreferrer"&gt;Quick Tour&lt;/a&gt;, using separate embedder and reranker containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start with one model
&lt;/h3&gt;

&lt;p&gt;For the CPU smoke test, our deployment recipe uses the CPU image family. For NVIDIA execution, it uses &lt;code&gt;cuda-1.10&lt;/code&gt;, NVIDIA Container Toolkit, and drivers compatible with CUDA 12.2 or later. Check the supported hardware matrix before selecting an image for a particular GPU.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -eu
mkdir -p data

&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;MODEL_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;BAAI/bge-base-en-v1.5
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;MODEL_REVISION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(
  curl -fsSL "&lt;/span&gt;https://huggingface.co/api/models/&lt;span class="nv"&gt;$MODEL_ID&lt;/span&gt;&lt;span class="s2"&gt;" |
    python3 -c 'import json,sys; print(json.load(sys.stdin)["&lt;/span&gt;sha&lt;span class="s2"&gt;"])'
)"&lt;/span&gt;

&lt;span class="c"&gt;# CPU smoke test. On an unsupported laptop architecture, use a supported&lt;/span&gt;
&lt;span class="c"&gt;# host or the project's native installation path instead.&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;IMAGE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ghcr.io/huggingface/text-embeddings-inference:cpu-1.10
docker pull &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt;
docker image inspect &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; --format &lt;span class="s1"&gt;'{{json .RepoDigests}}'&lt;/span&gt;

docker run -d --name tei-embed \
  -p 127.0.0.1:8080:80 \
  -v &lt;span class="s2"&gt;"$PWD/data:/data"&lt;/span&gt; \
  &lt;span class="s2"&gt;"$IMAGE"&lt;/span&gt; \
  --model-id &lt;span class="s2"&gt;"$MODEL_ID"&lt;/span&gt; \
  --revision &lt;span class="s2"&gt;"$MODEL_REVISION"&lt;/span&gt; \
  --max-batch-tokens 4096 \
  --max-concurrent-requests 32

&lt;span class="k"&gt;until&lt;/span&gt; curl -fsS http://127.0.0.1:8080/health &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  sleep 1
&lt;span class="k"&gt;done&lt;/span&gt;

curl -fsS http://127.0.0.1:8080/embed \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"inputs":["What is deep learning?","A neural network example."],
       "truncate":false,"normalize":true}'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  python3 -c &lt;span class="s1"&gt;'
import json, sys
vectors = json.load(sys.stdin)
print(json.dumps({
    "vectors": len(vectors),
    "dimensions": [len(v) for v in vectors]
}))
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative output, not captured execution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"vectors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"dimensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;768&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;768&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a GPU run, replace the image with &lt;code&gt;ghcr.io/huggingface/text-embeddings-inference:cuda-1.10&lt;/code&gt; and add &lt;code&gt;--gpus all&lt;/code&gt;. Record the resolved image digest and model commit; a mutable tag alone is not a benchmark identity.&lt;/p&gt;

&lt;p&gt;For a native installation, we would follow the repository’s backend-specific local build instructions, then inspect and launch the actual executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;text-embeddings-router --help
text-embeddings-router \
  --model-id BAAI/bge-base-en-v1.5 \
  --revision &lt;span class="s2"&gt;"$MODEL_REVISION"&lt;/span&gt; \
  --port 8080 \
  --max-batch-tokens 4096 \
  --max-concurrent-requests 32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would not substitute an unrelated Python package merely because its name resembles the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the native HTTP contracts explicit
&lt;/h3&gt;

&lt;p&gt;Our &lt;code&gt;/embed&lt;/code&gt; request uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"first text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"second text"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"truncate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"normalize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;inputs&lt;/code&gt; also accepts a single string. The response is a JSON array of vectors, in input order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;number[][]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even a single input returns an outer array. There is no OpenAI-style &lt;code&gt;data&lt;/code&gt; envelope on this native route.&lt;/p&gt;

&lt;p&gt;Pooling is a &lt;strong&gt;server/model configuration&lt;/strong&gt;, not a field in this request. Without an override, TEI reads the model’s pooling configuration. &lt;code&gt;--pooling cls&lt;/code&gt;, &lt;code&gt;mean&lt;/code&gt;, or &lt;code&gt;last-token&lt;/code&gt; changes aggregation; &lt;code&gt;splade&lt;/code&gt; requires a compatible masked-language-model architecture and is not interchangeable with ordinary dense pooling.&lt;/p&gt;

&lt;p&gt;For reranking, we would start another container on port 8081 with &lt;code&gt;--model-id BAAI/bge-reranker-base&lt;/code&gt;, its own pinned revision, and independent limits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsS http://127.0.0.1:8081/rerank \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "query":"What is deep learning?",
    "texts":["A bread recipe.","A method using layered neural networks."],
    "truncate":false,
    "raw_scores":true,
    "return_text":true
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The native response is an array of ranked objects containing &lt;code&gt;index&lt;/code&gt; and &lt;code&gt;score&lt;/code&gt;; requesting returned text adds &lt;code&gt;text&lt;/code&gt;. &lt;code&gt;index&lt;/code&gt; refers to the original candidate position. We would preserve that index rather than assuming response order matches request order.&lt;/p&gt;

&lt;p&gt;We intentionally specify truncation instead of depending on defaults. We configure truncation explicitly: the current interface defaults to automatic truncation, unlike the behavior used in the 2023 deployment example. We have not verified that default in a local execution. For reranking, the relevant length is the tokenized &lt;strong&gt;query-document pair&lt;/strong&gt;, including special tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measure instead of guessing
&lt;/h3&gt;

&lt;p&gt;Our harness below measures client-visible latency, successful-request throughput, and locally counted input tokens. Save it as &lt;code&gt;bench.py&lt;/code&gt;; install &lt;code&gt;httpx&lt;/code&gt; and &lt;code&gt;transformers&lt;/code&gt;. It performs real requests and does not generate synthetic timing results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AutoTokenizer&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"MODEL_ID"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;revision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"MODEL_REVISION"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"URL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"http://127.0.0.1:8080/embed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"MODE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"embed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;batch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CLIENT_BATCH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"REQUESTS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1000"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AutoTokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"How does token-based batching affect retrieval latency?"&lt;/span&gt;
&lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Inference servers group independent inputs into batches. "&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;batch&lt;/span&gt;
&lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"truncate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"normalize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"embed"&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"texts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s2"&gt;"truncate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"raw_scores"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tokens_per_request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"input_ids"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"embed"&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"input_ids"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;texts&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;next_request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AsyncClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;nonlocal&lt;/span&gt; &lt;span class="n"&gt;next_request&lt;/span&gt;
            &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;next_request&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;next_request&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
                &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                        &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HTTPStatusError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;
                    &lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

        &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gather&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;

    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"budget"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"BUDGET"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"concurrency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"client_batch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;batch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"successes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"errors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"requests_s"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"input_tokens_s"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tokens_per_request&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"p50_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;latencies&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"p95_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;latencies&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;concurrency&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would restart the server at batch-token budgets &lt;strong&gt;4096, 8192, and 16384&lt;/strong&gt;, repeating each sweep with client batches &lt;strong&gt;1, 8, and 32&lt;/strong&gt;. &lt;code&gt;BUDGET&lt;/code&gt; is a result label; it does not reconfigure a running server. Keep model revision, input corpus, precision, and admission limit fixed.&lt;/p&gt;

&lt;p&gt;This is a closed-loop saturation test, not a realistic arrival distribution. Our final gate would add paced traffic, bursts, variable lengths, and repeated runs. We would collect server metrics/traces for queueing and inference time: client p95 includes transport, tokenization, queueing, execution, and serialization, so it is not a per-request GPU inference measurement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Runtime Limits and Failure Modes We Could Not Verify
&lt;/h2&gt;

&lt;p&gt;Our immediate roadblock was the unavailable runtime. That prevented us from validating the following failure modes experimentally. We treat them as acceptance tests, not incidents we can claim to have reproduced.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Batch-Token Budget Does Not Bound Total Memory Use
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;--max-batch-tokens&lt;/code&gt; defaults to 16384 in the supplied interface. It limits potential tokens per batch, not total process memory. TEI cannot automatically infer the safe ceiling.&lt;/p&gt;

&lt;p&gt;Our mitigation would be to increase the budget only while monitoring device memory, rejection counts, and p95. Concurrency supplies enough queued work to fill larger batches; it does not necessarily create one parallel GPU execution per HTTP request.&lt;/p&gt;

&lt;p&gt;On a shared GPU, two individually safe configurations can still exceed the combined memory envelope. We would test long-input mixtures and simultaneous bursts, then retain headroom. We cannot supply a universal OOM threshold.&lt;/p&gt;

&lt;p&gt;We would also keep the budget large enough for accepted sequences. Current startup validation with automatic truncation disabled can reject configurations where the model maximum exceeds the budget. We would not present older long-request-stall behavior as a verified current-version bug.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pooling can preserve shape while changing meaning
&lt;/h3&gt;

&lt;p&gt;Overriding CLS pooling with mean pooling can still return the expected vector dimensions. A shape-only health check will not catch semantic incompatibility with an existing index.&lt;/p&gt;

&lt;p&gt;Our check would compare fixed texts against a trusted model implementation, then run retrieval-quality tests. We would compare cosine similarity, L2 distance, and ranking changes—not invent a divergence percentage. Model revision, pooling, normalization, and prompt policy belong in the index version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Score normalization is not calibration
&lt;/h3&gt;

&lt;p&gt;For a single-output reranker, &lt;code&gt;raw_scores:true&lt;/code&gt; exposes logits; normalized scores use sigmoid. That monotonic transformation should preserve ordering, but thresholds change.&lt;/p&gt;

&lt;p&gt;We would request both modes on identical candidates and verify the relationship. We would not carry a hosted provider’s relevance threshold into TEI merely because both responses contain a field called &lt;code&gt;score&lt;/code&gt;. We have no matched hosted-versus-local experiment establishing a particular discrepancy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cold starts and default-open access need separate gates
&lt;/h3&gt;

&lt;p&gt;We would measure image acquisition, empty-cache startup, cached-weight startup, readiness, and first inference separately. No measured seconds-to-ready figure is available here.&lt;/p&gt;

&lt;p&gt;For security, the important distinction is &lt;strong&gt;default-open&lt;/strong&gt;, not “authentication impossible.” We would enable &lt;code&gt;--api-key&lt;/code&gt; or &lt;code&gt;API_KEY&lt;/code&gt;, keep the service private, and terminate TLS at the ingress. A Hub token downloads models; it does not authenticate inference clients.&lt;/p&gt;

&lt;p&gt;Shared-key auth also does not replace tenant quotas or rate limits. Our &lt;a href="https://dev.to/articles/docker-mcp-gateway-security-boundary-hands-on-2026"&gt;Docker MCP boundary review&lt;/a&gt; applies the same principle: containerization alone is not an access-control boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We would not choose a batch-token budget by maximizing tokens per second alone. Our production objective is maximum &lt;strong&gt;successful throughput inside the latency target&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;What we gain&lt;/th&gt;
&lt;th&gt;What we must operate or validate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TEI on CPU&lt;/td&gt;
&lt;td&gt;Dedicated serving without a GPU; useful smoke-test path&lt;/td&gt;
&lt;td&gt;CPU capacity, backend compatibility, actual online p95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TEI on a dedicated GPU&lt;/td&gt;
&lt;td&gt;Token-based batching and independent admission control&lt;/td&gt;
&lt;td&gt;GPU cost, safe batch budget, quality parity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two TEI containers sharing one GPU&lt;/td&gt;
&lt;td&gt;Potentially better utilization of one device&lt;/td&gt;
&lt;td&gt;Memory competition and cross-workload tail latency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application-local encoding&lt;/td&gt;
&lt;td&gt;Minimal initial deployment machinery&lt;/td&gt;
&lt;td&gt;Batching across processes, model duplication, backpressure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed embedding/rerank API&lt;/td&gt;
&lt;td&gt;Less infrastructure ownership&lt;/td&gt;
&lt;td&gt;Current pricing, quotas, data policy, score/model differences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed TEI endpoint&lt;/td&gt;
&lt;td&gt;Managed lifecycle around the serving engine&lt;/td&gt;
&lt;td&gt;Instance utilization, cold starts, service configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For scale context, we evaluated a &lt;a href="https://huggingface.co/blog/inference-endpoints-embeddings" rel="noopener noreferrer"&gt;historical managed-endpoint benchmark&lt;/a&gt;: &lt;strong&gt;450+ requests/s for BAAI/bge-base-en-v1.5 at 512 tokens and batch size 32 on an NVIDIA A10G Inference Endpoint&lt;/strong&gt;. We retain its October 2023 conditions; we did not reproduce it locally, and we do not use it as a self-hosted result, a p95 promise, or a 2026 price quote.&lt;/p&gt;

&lt;p&gt;In our illustrative batching calculation, we use a fixed cost of 4 ms and a marginal cost of 0.5 ms per sequence, following this &lt;a href="https://blog.lo0.es/en/posts/serving-embeddings-rerankers-tei-production/" rel="noopener noreferrer"&gt;batching model&lt;/a&gt;. We calculate approximately 222 sequences/s at batch 1 and 1,600 sequences/s at batch 32—about 7.2× throughput. These are assumed-cost calculations, not measured TEI performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Single-GPU co-serving needs three tests
&lt;/h3&gt;

&lt;p&gt;We would run embedding alone, reranking alone, and both simultaneously at the intended traffic mix. Then we would compare each workload’s p95, errors, throughput, and peak memory.&lt;/p&gt;

&lt;p&gt;Two containers provide independent queues, not GPU scheduling isolation. We would cap rerank candidates and pair lengths, protect online embedding capacity, and move bulk ingestion elsewhere before assuming shared-device economics work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break-even depends on useful utilization
&lt;/h3&gt;

&lt;p&gt;Let hourly all-in infrastructure cost be (H), and sustained successful throughput be (T) input tokens/s:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\text{cost per million tokens}&lt;br&gt;
=\frac{H \times 1{,}000{,}000}{3600T}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;For an &lt;strong&gt;illustrative assumption&lt;/strong&gt;, $0.80/hour at 20,000 tokens/s gives approximately &lt;strong&gt;$0.0111 per million tokens&lt;/strong&gt;. Averaging only 2,000 tokens/s raises it to &lt;strong&gt;$0.111&lt;/strong&gt;. Neither throughput is a TEI measurement.&lt;/p&gt;

&lt;p&gt;At $0.80/hour, a 730-hour month costs $584 before engineering and ancillary infrastructure. Against a hypothetical vendor price of $0.10 per million tokens, infrastructure-only break-even is &lt;strong&gt;5.84 billion tokens/month&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We would use current vendor quotes and measured utilization before approving a migration. Reranking needs separate accounting per search or per candidate pair; combining it with embeddings in one tokens-per-dollar headline hides the actual workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We would deploy TEI when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need a dedicated, observable embedding or reranking service.&lt;/li&gt;
&lt;li&gt;We can pin image digests, model revisions, and embedding configuration.&lt;/li&gt;
&lt;li&gt;Our acceptance harness demonstrates useful throughput within p95 targets.&lt;/li&gt;
&lt;li&gt;We have enough steady demand to justify operating the service.&lt;/li&gt;
&lt;li&gt;We can enforce private access, authentication, quotas, and bounded retries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold off on single-GPU co-serving when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Our evidence is limited to idle latency or model-weight size.&lt;/li&gt;
&lt;li&gt;Rerank candidate counts and input lengths are unbounded.&lt;/li&gt;
&lt;li&gt;Bulk ingestion competes directly with interactive retrieval.&lt;/li&gt;
&lt;li&gt;We cannot distinguish queueing time from inference time.&lt;/li&gt;
&lt;li&gt;Our projected savings exclude idle capacity and operational ownership.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our conclusion is not “TEI is slow” or “TEI is cheaper.” It is that TEI exposes the right controls for a serious serving evaluation, while leaving capacity planning and workload isolation with us.&lt;/p&gt;

&lt;p&gt;We would start from the &lt;a href="https://huggingface.co/docs/text-embeddings-inference/quick_tour" rel="noopener noreferrer"&gt;official deployment path&lt;/a&gt;, run the sweep, and approve co-serving only after simultaneous-load results pass. Until then, single-GPU savings remain a hypothesis—not a production commitment.&lt;/p&gt;

</description>
      <category>embeddingserving</category>
      <category>tei</category>
      <category>reranking</category>
      <category>gpuinfrastructure</category>
    </item>
    <item>
      <title>Unsloth Multi-GPU DDP: QLoRA Setup, Costs, and Deployment Gates</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Tue, 01 Dec 2026 00:40:37 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/unsloth-multi-gpu-ddp-qlora-setup-costs-and-deployment-gates-2n5b</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/unsloth-multi-gpu-ddp-qlora-setup-costs-and-deployment-gates-2n5b</guid>
      <description>&lt;h2&gt;
  
  
  Why We Brought This Tool Into Our Lab
&lt;/h2&gt;

&lt;p&gt;We care about distributed fine-tuning for a straightforward reason: a domain-adaptation job that finishes after the deployment window is not operationally useful. Adding GPUs looks like the obvious fix. It can also turn one inexpensive training job into several synchronized GPUs waiting on the slowest worker.&lt;/p&gt;

&lt;p&gt;Official two-T4 QLoRA comparison&lt;span&gt;DDP with block swap: time per step 16.4 seconds&lt;/span&gt;&lt;span&gt;Layer split: time per step 9.0 seconds&lt;/span&gt;&lt;span&gt;DDP with block swap: peak GPU memory 13.2 GB&lt;/span&gt;&lt;span&gt;Layer split: peak GPU memory 10.8 GB&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In this specific offloaded MoE workload, layer splitting was faster and used less peak GPU memory than DDP with block swap; the result is not a general verdict against DDP.&lt;/p&gt;

&lt;p&gt;Unsloth makes this decision interesting because QLoRA already reduces the memory needed for a frozen base model. If the complete training workload fits on one card, we can consider replicating it across two or four cards to process more data concurrently.&lt;/p&gt;

&lt;p&gt;The distinction matters: &lt;strong&gt;DDP is a throughput strategy, not a way to combine GPU memory into one larger pool.&lt;/strong&gt; Each rank holds a model replica and processes its own samples. Gradient synchronization coordinates the trainable parameters; with QLoRA, that primarily means adapters rather than updates to the frozen quantized base.&lt;/p&gt;

&lt;p&gt;Our evidence boundary is important. We reviewed the official execution paths and constructed the reproduction and acceptance plan below, but we did not execute a GPU benchmark for this review. We therefore do not present consumer-GPU throughput, compile latency, or rank-level memory measurements as our own results. The numerical hardware baselines below retain their original configurations and provenance.&lt;/p&gt;

&lt;p&gt;For our architecture review, we used three official references: the &lt;a href="https://unsloth.ai/docs/basics/multi-gpu-training-with-unsloth/ddp" rel="noopener noreferrer"&gt;DDP walkthrough&lt;/a&gt;, the &lt;a href="https://www.unsloth.ai/docs/basics/multi-gpu-training-with-unsloth" rel="noopener noreferrer"&gt;multi-GPU overview&lt;/a&gt;, and the &lt;a href="https://unsloth.ai/docs/models/inkling-2-mini/fine-tuning" rel="noopener noreferrer"&gt;Inkling 2 Mini fine-tuning guide&lt;/a&gt;. Together, they establish a viable launch path, but not a production guarantee for an arbitrary workstation.&lt;/p&gt;

&lt;p&gt;Our initial verdict is conditional: Unsloth DDP is worth qualifying when the model already fits on every participating GPU and training duration matters more than minimizing GPU-hours. We would not buy additional cards on the assumption that “approximately linear” scaling transfers unchanged from H100s to a PCIe workstation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We start with a single Linux node and two visible NVIDIA GPUs. Four GPUs use the same launch pattern with a different process count. We keep model downloads and dataset access separate from training timing.&lt;/p&gt;

&lt;p&gt;We start our installation plan with a source checkout. That is convenient for experimentation, but we do not treat a moving checkout as a reproducible production dependency. Our setup records the resolved commit and environment immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

python3.12 -m venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
python -m pip install --upgrade pip

git clone https://github.com/unslothai/unsloth.git
&lt;span class="nb"&gt;cd&lt;/span&gt; unsloth
python -m pip install .

mkdir -p artifacts
git rev-parse HEAD &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; artifacts/unsloth-commit.txt
python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; artifacts/requirements-resolved.txt
nvidia-smi &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; artifacts/nvidia-smi.txt
nvidia-smi topo -m &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; artifacts/gpu-topology.txt

python unsloth-cli.py --help &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; artifacts/cli-help.txt

python - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import json
import torch

world_size &lt;span class="o"&gt;=&lt;/span&gt; 2
batch_per_gpu &lt;span class="o"&gt;=&lt;/span&gt; 1
accumulation &lt;span class="o"&gt;=&lt;/span&gt; 4

print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"cuda_available"&lt;/span&gt;: torch.cuda.is_available&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s2"&gt;"visible_gpus"&lt;/span&gt;: torch.cuda.device_count&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s2"&gt;"planned_world_size"&lt;/span&gt;: world_size,
    &lt;span class="s2"&gt;"per_device_train_batch_size"&lt;/span&gt;: batch_per_gpu,
    &lt;span class="s2"&gt;"gradient_accumulation_steps"&lt;/span&gt;: accumulation,
    &lt;span class="s2"&gt;"effective_batch_examples"&lt;/span&gt;: &lt;span class="o"&gt;(&lt;/span&gt;
        world_size * batch_per_gpu * accumulation
    &lt;span class="o"&gt;)&lt;/span&gt;,
&lt;span class="o"&gt;}&lt;/span&gt;, &lt;span class="nv"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

assert torch.cuda.is_available&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="s2"&gt;"CUDA is required for this workload"&lt;/span&gt;
assert torch.cuda.device_count&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; world_size, &lt;span class="s2"&gt;"Not enough visible GPUs"&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Illustrative output for a correctly configured two-GPU host—not a captured lab result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"cuda_available"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"visible_gpus"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"planned_world_size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"per_device_train_batch_size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"gradient_accumulation_steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"effective_batch_examples"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recording a commit does not ensure the next machine uses it. Before scheduling repeated jobs, we would rebuild from that exact revision and retain the resolved package environment or immutable container image.&lt;/p&gt;

&lt;p&gt;For a small-model QLoRA qualification, we use the Llama-3.2-1B-Instruct model family used in the official DDP comparison, with four-bit loading explicitly enabled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;CUDA_VISIBLE_DEVICES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0,1 \
torchrun --standalone --nnodes=1 --nproc_per_node=2 \
  unsloth-cli.py \
  --model_name=unsloth/Llama-3.2-1B-Instruct \
  --dataset=yahma/alpaca-cleaned \
  --load_in_4bit \
  --r=16 \
  --lora_alpha=16 \
  --learning_rate=2e-5 \
  --max_seq_length=2048 \
  --per_device_train_batch_size=1 \
  --gradient_accumulation_steps=4 \
  --max_steps=200 \
  --save_model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This combines the documented CLI launch mechanism with an explicit QLoRA configuration; it is not a claim that this exact invocation has been benchmarked here. We check the installed CLI help before execution because supported arguments depend on the pinned revision.&lt;/p&gt;

&lt;p&gt;Model access remains a separate prerequisite. If the selected repository requires authorization, we provision Hugging Face access before launching workers. No other external API credential is needed for this path.&lt;/p&gt;

&lt;p&gt;The corresponding Python loading pattern is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;unsloth&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;FastLanguageModel&lt;/span&gt;

&lt;span class="n"&gt;local_rank&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"LOCAL_RANK"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cuda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_device&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;local_rank&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastLanguageModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"unsloth/Llama-3.2-1B-Instruct"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_seq_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2048&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;load_in_4bit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;device_map&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;local_rank&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the placement portion of a custom training script, not a complete trainer. We would then attach adapters and use a distributed-aware trainer. For a custom script, we use &lt;code&gt;torchrun --nproc_per_node N_GPUS train.py&lt;/code&gt; in our launch plan. We can alternatively use &lt;code&gt;accelerate launch train.py&lt;/code&gt; with an appropriate Accelerate configuration.&lt;/p&gt;

&lt;p&gt;We prefer explicit &lt;code&gt;torchrun&lt;/code&gt; parameters for the first qualification because process count is visible in the job command.&lt;/p&gt;

&lt;p&gt;Our first acceptance check is not loss. It is placement: two workers, two intended devices, one primary replica per rank. Only then do we accept optimizer progress, adapter output, and a separate reload-and-generation smoke test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification Limits and Deployment Constraints
&lt;/h2&gt;

&lt;p&gt;The immediate roadblock in this review was verification: we did not have a suitable GPU environment to confirm warmup behavior, OOM thresholds, or workstation scaling. We will not turn those gaps into invented failure traces. Instead, we separate confirmed execution constraints from the failure modes our deployment gate must test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The launch command is part of the training configuration.&lt;/strong&gt; Running &lt;code&gt;python train.py&lt;/code&gt; does not become DDP merely because several GPUs are visible. We use one process per participating GPU through the launcher. For custom scripts, we inspect local-rank placement before model loading and avoid initializing every replica on device zero.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Balanced loading and DDP solve different problems.&lt;/strong&gt; We distinguish model splitting with &lt;code&gt;device_map="balanced"&lt;/code&gt; from DDP replication in our placement plan. We do not combine cross-device model placement indiscriminately with one-rank-per-GPU replication. If a replica cannot fit on one card, plain DDP is not our capacity fix. We evaluate sharding, model splitting, offload, or a larger-memory device instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per-device batch size is genuinely per device.&lt;/strong&gt; Our planning equation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;effective batch = world size × per-device batch × accumulation steps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At batch one and accumulation four, one GPU processes four examples per optimizer update; two GPUs process eight; four GPUs process sixteen. That changes the optimization experiment, not just its speed.&lt;/p&gt;

&lt;p&gt;For a matched effective batch of eight, our matrix is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;GPUs&lt;/th&gt;
&lt;th&gt;Per-device batch&lt;/th&gt;
&lt;th&gt;Accumulation&lt;/th&gt;
&lt;th&gt;Effective batch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We keep batch one as a conservative starting point, not a universal optimum. Increasing accumulation does not shrink the memory required for one microbatch. It helps when the alternative is increasing the per-device microbatch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compile warmup remains unconfirmed for this configuration.&lt;/strong&gt; We have not verified which paths invoke compilation, how long compilation takes, or whether caches are reused across ranks. We therefore cannot assign a warmup duration or prescribe a verified cache workaround.&lt;/p&gt;

&lt;p&gt;Our measurement workaround is procedural: record process start, model-ready time, first optimizer update, and subsequent step timings separately. If the installed stack invokes &lt;code&gt;torch.compile&lt;/code&gt;, capture compilation and recompilation diagnostics. Report cold and warm runs independently rather than quietly dropping inconvenient startup time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory balance needs measurement, not assumptions.&lt;/strong&gt; When we inspected the two-H100 reference snapshot, we found nearly symmetric total device usage: 18,903 and 18,905 MiB. We also identified small allocations from each process on the other GPU. We would not diagnose a placement bug from an extra CUDA context alone.&lt;/p&gt;

&lt;p&gt;For our acceptance run, we would collect both device-wide memory and per-rank PyTorch allocated/reserved peaks. Those measure different things. Sequence lengths, evaluation, saving, and unrelated workloads can all affect the observed peak; none is a confirmed imbalance incident in this review.&lt;/p&gt;

&lt;p&gt;Finally, when checking multi-GPU readiness, we encountered “official support soon” language alongside a concrete DDP launch path. We treat that mismatch as a release-qualification warning: lock the working stack, test checkpoint behavior, and do not assume every model-specific multi-GPU feature applies to every architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;Our benchmark design uses two comparison methods.&lt;/p&gt;

&lt;p&gt;First, we hold the effective batch constant using the matrix above. We fix model revision, dataset revision, tokenization, sequence cap, packing policy, adapter targets, optimizer, and learning-rate schedule. Each configuration processes the same token budget. This asks whether additional GPUs finish comparable training work sooner.&lt;/p&gt;

&lt;p&gt;Second, we hold per-device batch and accumulation constant. This measures throughput scaling while allowing global batch to grow. We label it separately because equal optimizer-step counts then represent different amounts of training data.&lt;/p&gt;

&lt;p&gt;For either comparison, our report includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End-to-end duration, including startup and final adapter saving.&lt;/li&gt;
&lt;li&gt;Steady-state useful, non-padding tokens per second across all ranks.&lt;/li&gt;
&lt;li&gt;Optimizer updates separately from microsteps.&lt;/li&gt;
&lt;li&gt;Per-device memory peaks and the busiest device.&lt;/li&gt;
&lt;li&gt;Validation quality at comparable token budgets.&lt;/li&gt;
&lt;li&gt;GPU-hours and cost per completed, accepted checkpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We repeat runs and retain variability. A fast training loop that produces an unusable checkpoint is not a cost saving. Our &lt;a href="https://dev.to/articles/inspect-ai-agent-evaluation-production-benchmark-2026"&gt;Inspect AI deployment-gate review&lt;/a&gt; provides the complementary evaluation discipline; our &lt;a href="https://dev.to/articles/distilabel-synthetic-data-pipeline-production-benchmark-2026"&gt;Distilabel review&lt;/a&gt; covers the data-quality work that should precede buying more training throughput.&lt;/p&gt;

&lt;h3&gt;
  
  
  Official Numerical Baselines and Their Limits
&lt;/h3&gt;

&lt;p&gt;For our Qwen3-8B reference baseline, we recorded a two-H100 80GB configuration with sequence length 2,048, per-device batch one, and accumulation four. When inspecting its memory snapshot and training summary, we identified approximately 19 GB per GPU and approximately 1.1 iterations per second. These are reference-run figures, not measurements from a local GPU run.&lt;/p&gt;

&lt;p&gt;We do &lt;strong&gt;not&lt;/strong&gt; label that command a QLoRA memory benchmark: its displayed invocation does not include &lt;code&gt;--load_in_4bit&lt;/code&gt;. Nor do we translate iterations per second into useful tokens per second without actual token counts.&lt;/p&gt;

&lt;p&gt;The separate Llama-3.2-1B-Instruct comparisons cover LoRA and four-bit QLoRA over 500 steps. They establish the expected distinction between step count and data progress, but do not supply enough numerical timing detail to calculate consumer-GPU speedup.&lt;/p&gt;

&lt;p&gt;Our counterexample is the official Inkling 2 Mini two-T4 comparison. Under its short FP16 QLoRA workload—rank eight and two times 512 tokens per step—DDP with block swap takes 16.4 seconds per step and peaks at 13.2 GB on the busiest GPU. The layer-split baseline takes 9.0 seconds and peaks at 10.8 GB. That is a specific offloaded MoE configuration, not a general verdict against DDP.&lt;/p&gt;

&lt;p&gt;It does, however, prevent us from equating “more replicas” with “faster.”&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;What we would use it for&lt;/th&gt;
&lt;th&gt;Main trade-off&lt;/th&gt;
&lt;th&gt;Evidence boundary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single-GPU Unsloth QLoRA&lt;/td&gt;
&lt;td&gt;Simple, repeatable adaptation&lt;/td&gt;
&lt;td&gt;No inter-GPU throughput scaling&lt;/td&gt;
&lt;td&gt;Our required baseline; no measured result here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unsloth DDP&lt;/td&gt;
&lt;td&gt;Replicas that fit independently&lt;/td&gt;
&lt;td&gt;Synchronization and multiplied GPU billing&lt;/td&gt;
&lt;td&gt;Official DDP examples, not a consumer-node guarantee&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One larger GPU&lt;/td&gt;
&lt;td&gt;More memory without distributed launch&lt;/td&gt;
&lt;td&gt;Different hourly price and availability&lt;/td&gt;
&lt;td&gt;Requires a measured hardware comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model splitting or offload&lt;/td&gt;
&lt;td&gt;Capacity-limited workloads&lt;/td&gt;
&lt;td&gt;Transfer overhead and architecture-specific behavior&lt;/td&gt;
&lt;td&gt;Inkling two-T4 example only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed fine-tuning&lt;/td&gt;
&lt;td&gt;Reduced infrastructure ownership&lt;/td&gt;
&lt;td&gt;Service limits, billing model, portability&lt;/td&gt;
&lt;td&gt;No comparable vendor quote or benchmark supplied&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Our break-even calculation
&lt;/h3&gt;

&lt;p&gt;Let a one-GPU job take (T_1) hours and a two-GPU job take (T_2). With equal per-GPU hourly pricing, two GPUs reduce compute cost only when:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 × T2 &amp;lt; T1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Equivalently, speedup must exceed 2×. At exactly 2×, GPU-hours are unchanged.&lt;/p&gt;

&lt;p&gt;For illustration—not a measured Unsloth result—suppose one GPU costs $1 per hour and finishes in ten hours. At 1.6× speedup, two GPUs finish in 6.25 hours:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single GPU: 10 GPU-hours, $10.&lt;/li&gt;
&lt;li&gt;Two GPUs: 12.5 GPU-hours, $12.50.&lt;/li&gt;
&lt;li&gt;Time saved: 3.75 hours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would pay that premium if the earlier checkpoint unblocks a release. We would not describe it as a GPU-hour reduction.&lt;/p&gt;

&lt;p&gt;For managed fine-tuning, our break-even adds engineering time, failed runs, storage, and checkpoint export to infrastructure charges. For short jobs, cold-start and compilation overhead can dominate the decision even when steady-state scaling looks attractive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;We would put Unsloth DDP through production qualification when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A complete QLoRA training replica fits on each GPU with measured headroom.&lt;/li&gt;
&lt;li&gt;Training duration materially delays evaluation or delivery.&lt;/li&gt;
&lt;li&gt;The node has sufficient CPU, storage, and interconnect capacity.&lt;/li&gt;
&lt;li&gt;We can pin the stack and preserve the exact training configuration.&lt;/li&gt;
&lt;li&gt;A matched-work benchmark demonstrates a worthwhile wall-clock improvement.&lt;/li&gt;
&lt;li&gt;Checkpoint reload, validation, and restart behavior pass independently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would hold off when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The objective is pooling several small GPUs to fit one oversized replica.&lt;/li&gt;
&lt;li&gt;The proposed speedup comes only from processing more examples per update.&lt;/li&gt;
&lt;li&gt;Jobs are too short to amortize startup overhead.&lt;/li&gt;
&lt;li&gt;GPU-hour reduction is promised without end-to-end measurements.&lt;/li&gt;
&lt;li&gt;The workload depends on model-specific offload behavior that has not been qualified.&lt;/li&gt;
&lt;li&gt;Nobody owns distributed-training failures after the initial successful run.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our conclusion is deliberately narrower than a blanket recommendation: &lt;strong&gt;Unsloth exposes a practical DDP path, but deployment value comes from measured time-to-accepted-checkpoint, not GPU count.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We would begin with the &lt;a href="https://unsloth.ai/docs/basics/multi-gpu-training-with-unsloth/ddp" rel="noopener noreferrer"&gt;official DDP CLI guide&lt;/a&gt;, keep the &lt;a href="https://www.unsloth.ai/docs/basics/multi-gpu-training-with-unsloth" rel="noopener noreferrer"&gt;multi-GPU placement distinction&lt;/a&gt; explicit, and require our matched-batch comparison before increasing the training budget. Until that run exists on the target hardware, our setup is a reproducible qualification plan—not a completed consumer-GPU performance endorsement.&lt;/p&gt;

</description>
      <category>unsloth</category>
      <category>qlora</category>
      <category>distributedtraining</category>
      <category>gpuinfrastructure</category>
    </item>
    <item>
      <title>Composio Production Review: User Isolation and Token Custody</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Mon, 30 Nov 2026 00:37:02 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/composio-production-review-user-isolation-and-token-custody-4502</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/composio-production-review-user-isolation-and-token-custody-4502</guid>
      <description>&lt;h2&gt;
  
  
  Why We Reviewed Composio
&lt;/h2&gt;

&lt;p&gt;We care less about how quickly an agent connects GitHub than whether its next request can accidentally run against another customer's account.&lt;/p&gt;

&lt;p&gt;Managed authentication is not product authorization&lt;/p&gt;
&lt;p&gt;Sessions scope private accounts by user ID, but direct proxy owner checks depend on project settings; the backend must enforce account ownership.&lt;/p&gt;

&lt;p&gt;Composio addresses a real infrastructure burden: provider authentication, connected-account storage, token refresh, and authenticated tool execution. Our backend supplies an identity or connected-account identifier and an operation. Composio resolves credentials, authenticates the provider request server-side, and returns its result. We do not need to put OAuth tokens in model context—or even retrieve them into our application.&lt;/p&gt;

&lt;p&gt;That is useful delegation. It is not delegated product authorization.&lt;/p&gt;

&lt;p&gt;Our central finding from reviewing the &lt;a href="https://docs.composio.dev/docs/security/token-custody" rel="noopener noreferrer"&gt;token-custody and isolation contract&lt;/a&gt; is that &lt;strong&gt;session account selection and direct Proxy Execute have materially different authorization boundaries&lt;/strong&gt;. Within a session, Composio resolves a private connection using the user identity. A direct proxy request requires additional care: owner validation for a private account depends on the project's 2FA setting. We would enforce ownership in our backend regardless.&lt;/p&gt;

&lt;p&gt;We also need to set the evidence boundary plainly. This review is a source-verified architecture assessment with a reproducible worked example, not a completed live-service benchmark. We did not connect real accounts, observe an OAuth refresh, induce provider throttling, or measure concurrent isolation. The commands and acceptance tests below are the deployment procedure we would use; illustrative output is labeled accordingly.&lt;/p&gt;

&lt;p&gt;Our verdict is therefore conditional: Composio is a credible way to buy managed authentication and execution, but we would not approve production deployment from a successful Connect Link alone.&lt;/p&gt;

&lt;p&gt;This distinction complements our &lt;a href="https://dev.to/articles/docker-mcp-gateway-security-boundary-hands-on-2026"&gt;Docker MCP Gateway security review&lt;/a&gt;. Keeping secrets outside an agent is one control. Binding each operation to the correct customer is another.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Resolve the package mismatch first
&lt;/h3&gt;

&lt;p&gt;The setup requirement we started with used these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Legacy setup sequence; not verified for the current session API.&lt;/span&gt;
pip install composio-core
composio login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would not present that sequence as a verified installation for the code below. For our &lt;a href="https://docs.composio.dev/docs/authentication/managed-auth-for-custom-tools" rel="noopener noreferrer"&gt;managed-authentication worked example&lt;/a&gt;, we use &lt;code&gt;pip install composio&lt;/code&gt;, not &lt;code&gt;composio-core&lt;/code&gt;. We have not verified either package installation or the CLI login command's current availability or behavior.&lt;/p&gt;

&lt;p&gt;For this worked example, we follow the current package path and use an explicit server-side project key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m venv .venv
. .venv/bin/activate
python -m pip install composio
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;COMPOSIO_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace-with-your-development-project-key"&lt;/span&gt;
python -m pip show composio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would record and lock the resolved version after validation. We would not install both package names into one environment and assume that import compatibility proves API compatibility.&lt;/p&gt;

&lt;p&gt;Our configuration checklist is short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a disposable development Composio project.&lt;/li&gt;
&lt;li&gt;Keep its API key out of browsers, prompts, and repositories.&lt;/li&gt;
&lt;li&gt;Enable session-management write, connected-account read, and proxy-execution permissions.&lt;/li&gt;
&lt;li&gt;For scoped keys, use the exact &lt;strong&gt;Proxy execute (Legacy)&lt;/strong&gt; permission label exposed by the managed-auth guide. The label does not require a legacy SDK.&lt;/li&gt;
&lt;li&gt;Restrict the test to GitHub and a read-only &lt;code&gt;GET /user&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use a throwaway GitHub account. A custom OAuth app is optional for this basic managed-auth test; use one when validating your own consent screen, scopes, and quota configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Connect one owner, then test our application boundary
&lt;/h3&gt;

&lt;p&gt;We use &lt;code&gt;org_lab:member_a&lt;/code&gt; and &lt;code&gt;org_lab:member_b&lt;/code&gt; as two immutable application identities. Only A connects an account. We do &lt;strong&gt;not&lt;/strong&gt; relabel A's private connection as B's to simulate legitimate sharing.&lt;/p&gt;

&lt;p&gt;The following script is runnable after installation and key configuration. Its ownership dictionary stands in for a verified database mapping. It demonstrates our application guard, not Composio's server-side isolation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# review_auth.py&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;composio&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Composio&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Composio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;owner_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"org_lab:member_a"&lt;/span&gt;
&lt;span class="n"&gt;owner_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"org_lab:member_b"&lt;/span&gt;

&lt;span class="n"&gt;session_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;owner_a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolkits&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;attempt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authorize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Open this Connect Link: {attempt.redirect_url}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wait_for_connection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# For this local example, retain the account returned by A's attempt.&lt;/span&gt;
&lt;span class="c1"&gt;# A deployed callback must verify attempt, account owner, and current status.&lt;/span&gt;
&lt;span class="n"&gt;ownership&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;owner_a&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;authenticated_owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# In production, derive authenticated_owner from the server session&lt;/span&gt;
    &lt;span class="c1"&gt;# and load this mapping from the application's database.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ownership&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;authenticated_owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;PermissionError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Connected account does not belong to caller"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;authenticated_owner&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;connected_account_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;account_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read_profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;owner_a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Provider request failed: status={response.status}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"case"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"owner_read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"login"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"login"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;read_profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;owner_b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;PermissionError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"case"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cross_owner_read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"blocked_by"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;AssertionError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Application ownership guard failed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;session_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;owner_b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toolkits&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Created B's separate session; provider isolation remains a live test."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python review_auth.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative output—not captured from a live execution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open this Connect Link: https://connect.composio.dev/link/ln_example
{"case": "owner_read", "status": 200, "login": "throwaway-review-account"}
{"case": "cross_owner_read", "blocked_by": "application", "error": "Connected account does not belong to caller"}
Created B's separate session; provider isolation remains a live test.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our provider request contains a Composio key, owner ID, account ID, path, and method. It contains no GitHub token. The proxy response exposes provider &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;headers&lt;/code&gt;, and &lt;code&gt;data&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We would next exercise B through the session execution path and verify that A's private account cannot be resolved or used. Creating B's session alone does not prove that property. Separately, in the disposable project, we would test direct proxy owner mismatches with project 2FA enabled and disabled, recording responses without printing credentials.&lt;/p&gt;

&lt;p&gt;For deployed onboarding, we would persist the connection attempt and return the Connect Link immediately rather than hold an HTTP request open for consent. On callback, we would verify the attempt, signed-in owner, returned account, and current connection status. Callback query parameters are not authorization evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Risks and Evidence Gaps
&lt;/h2&gt;

&lt;p&gt;Our review exposed several deployment blockers. These are contract and evidence gaps, not invented incident reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  Email-derived userIDs can map distinct users to one identity
&lt;/h3&gt;

&lt;p&gt;We reject email as the connection owner key. Emails change, aliases normalize differently, and addresses can be reassigned. Two distinct application principals mapped to the same string become the same Composio identity within a project.&lt;/p&gt;

&lt;p&gt;For example, if a former employee and a replacement employee both map to &lt;code&gt;ops@example.com&lt;/code&gt;, the integration has lost the distinction between them. That is an application identity collision, not proof that Composio leaked between two distinct user IDs.&lt;/p&gt;

&lt;p&gt;Our owner format is an immutable tenant/member tuple, such as &lt;code&gt;org_42:user_7&lt;/code&gt;. We derive it after authenticating the request and checking workspace membership. We never accept it from model output or a browser parameter.&lt;/p&gt;

&lt;p&gt;We found no supplied live trace demonstrating email-derived leakage. We treat this as a concrete failure mechanism to test, not an observed vendor defect.&lt;/p&gt;

&lt;h3&gt;
  
  
  Direct Proxy Execute is not equivalent to a scoped session
&lt;/h3&gt;

&lt;p&gt;This is our largest security concern.&lt;/p&gt;

&lt;p&gt;For private accounts, we cannot rely on merely passing &lt;code&gt;user_id&lt;/code&gt; to direct Proxy Execute: the reviewed contract ties its owner check to project 2FA. Our backend must authorize the selected account before calling the proxy.&lt;/p&gt;

&lt;p&gt;We also treat a project key as broad execution authority within its permitted operations. It can act for different user IDs in that project; those IDs are not independently authenticated customer identities.&lt;/p&gt;

&lt;p&gt;Shared connections require a separate design. Their access lists are checked independently of project 2FA, sharing is explicit, and session use requires pinning. We would not use experimental sharing as a shortcut around our tenant ownership model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refresh is managed; reconnect remains product work
&lt;/h3&gt;

&lt;p&gt;We distinguish an expiring access token from an unusable refresh grant.&lt;/p&gt;

&lt;p&gt;Our integration can delegate supported access-token refresh to Composio. If the refresh token expires or is revoked, the &lt;a href="https://docs.composio.dev/docs/authentication" rel="noopener noreferrer"&gt;authentication lifecycle&lt;/a&gt; moves the connection to &lt;code&gt;EXPIRED&lt;/code&gt; and requires reconnecting. We would subscribe to &lt;code&gt;composio.connected_account.expired&lt;/code&gt;, mark the account unavailable, and offer a new Connect Link to its verified owner.&lt;/p&gt;

&lt;p&gt;We would also handle failures synchronously. An expiration webhook cannot be the only protection against a request racing with revocation.&lt;/p&gt;

&lt;p&gt;GitHub profile access does not establish Google refresh behavior. We would run refresh and revocation acceptance tests against each provider and grant type we intend to ship.&lt;/p&gt;

&lt;h3&gt;
  
  
  A 429 does not imply an automatic execution retry
&lt;/h3&gt;

&lt;p&gt;We separate SDK metadata reads from provider executions.&lt;/p&gt;

&lt;p&gt;We would design our &lt;a href="https://docs.composio.dev/docs/production-readiness" rel="noopener noreferrer"&gt;production recovery logic&lt;/a&gt; around the SDK's retry boundary: reads are retried on timeouts and HTTP 408, 409, 429, and 5xx responses, while tool execution and proxy calls are not automatically retried. Composio's backend does not deduplicate executions. We have not independently tested these retry paths.&lt;/p&gt;

&lt;p&gt;We interpret “sent once” narrowly. It is not an exactly-once side-effect guarantee.&lt;/p&gt;

&lt;p&gt;For proxy calls, we would inspect the returned provider status and headers and also handle SDK or transport exceptions. We do not assume every native tool surfaces provider throttling in an identical envelope.&lt;/p&gt;

&lt;p&gt;Our backoff policy would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Distinguish Composio throttling from provider throttling.&lt;/li&gt;
&lt;li&gt;Track budgets by provider, OAuth app, account, and operation where applicable.&lt;/li&gt;
&lt;li&gt;Honor usable provider retry headers.&lt;/li&gt;
&lt;li&gt;Apply bounded exponential backoff with jitter only where repetition is safe.&lt;/li&gt;
&lt;li&gt;Reconcile ambiguous writes before retrying.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have no verified per-tool thresholds or captured 429 responses. Shared managed OAuth quotas are a capacity risk, not a measured concurrency ceiling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trigger delivery guarantees remain unverified
&lt;/h3&gt;

&lt;p&gt;We could verify the instruction to test a deployed HTTPS webhook, parse events with the SDK, and map them to the correct environment and owner. We could not establish delivery retry schedules, ordering guarantees, deduplication behavior, or replay windows from the supplied material.&lt;/p&gt;

&lt;p&gt;Our receiver would verify authenticity, durably enqueue accepted events, and make downstream processing idempotent. We would test duplicate delivery, delayed delivery, receiver downtime, and replay before enabling consequential actions.&lt;/p&gt;

&lt;p&gt;We would not promise at-least-once delivery without a verified contract. This is the same side-effect discipline we apply in our &lt;a href="https://dev.to/articles/restate-ai-durable-execution-sdk-gotchas-2026"&gt;Restate recovery review&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Token redaction does not prevent Composio from accessing credentials
&lt;/h3&gt;

&lt;p&gt;In Composio Cloud, Composio holds encrypted credentials and its execution service decrypts them to authenticate provider requests. AES-256-GCM at rest and API-response redaction do not mean the service cannot access usable credentials.&lt;/p&gt;

&lt;p&gt;Our application does not receive raw tokens through supported connected-account reads. Owning the OAuth app does not change that custody boundary or create a supported token-export path.&lt;/p&gt;

&lt;p&gt;We cannot establish individual employee access rights, approval procedures, or privileged-access auditing from encryption details alone. Those require security-review evidence.&lt;/p&gt;

&lt;p&gt;We also account for business data: tool arguments and results are stored in execution logs by default. Zero Data Retention has coverage limits and does not change credential custody. BYOC changes deployment location; customer-managed keys introduce a different decryption boundary. We would review operator permissions, backups, and outbound access for either arrangement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We have no measured latency percentiles, throughput ceiling, or memory profile for this integration. We expect an additional hosted execution path compared with direct provider calls, but we cannot quantify the added latency without measurement.&lt;/p&gt;

&lt;p&gt;We would measure connection setup separately from steady-state reads, refresh activity, throttling, and reconnects.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;What we delegate&lt;/th&gt;
&lt;th&gt;What we still own&lt;/th&gt;
&lt;th&gt;Main trade-off&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Composio Cloud, managed OAuth&lt;/td&gt;
&lt;td&gt;OAuth app setup, credential storage, supported refresh, execution&lt;/td&gt;
&lt;td&gt;Identity, ownership, retries, reconnect UX, event processing&lt;/td&gt;
&lt;td&gt;Fast integration; shared app quotas and vendor custody&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Composio Cloud, custom OAuth app&lt;/td&gt;
&lt;td&gt;Credential storage, supported refresh, execution&lt;/td&gt;
&lt;td&gt;OAuth registration and approval, scopes, product authorization&lt;/td&gt;
&lt;td&gt;More branding and quota control; same Cloud token custody&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct provider SDKs with our vault&lt;/td&gt;
&lt;td&gt;Provider HTTP implementation to SDKs&lt;/td&gt;
&lt;td&gt;OAuth flows, token lifecycle, storage, isolation, operations&lt;/td&gt;
&lt;td&gt;Maximum control; larger engineering burden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosted integration platform&lt;/td&gt;
&lt;td&gt;Varies by platform and connector&lt;/td&gt;
&lt;td&gt;Hosting, upgrades, key access, connector validation, authorization&lt;/td&gt;
&lt;td&gt;Infrastructure control brings operational responsibility&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Our build-versus-buy model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Monthly value =
  avoided initial engineering cost / amortization months
  + avoided monthly maintenance cost
  - managed platform charges
  - additional operating costs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a planning example—not measured savings or vendor pricing—suppose managed integration avoids 120 initial hours and eight maintenance hours monthly. At $150 per loaded engineering hour, amortized over 12 months:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initial engineering avoided: 120 × $150 / 12 = $1,500/month
Maintenance avoided:          8 × $150      = $1,200/month
Illustrative spend ceiling:                  $2,700/month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would subtract security-review work, webhook infrastructure, migration costs, and any enterprise custody requirements from that ceiling.&lt;/p&gt;

&lt;p&gt;We would not count tenant authorization, reconciliation, audit correlation, or rate-limit backoff as eliminated work. Composio helps operate connections; it does not know our customer's roles or business transaction semantics.&lt;/p&gt;

&lt;p&gt;Our audit record would correlate tenant, immutable user, connected account, session, operation, provider status, and execution log ID without copying sensitive payloads unnecessarily. Separate projects would isolate development, staging, and production resources.&lt;/p&gt;

&lt;p&gt;For one stable provider, direct integration may remain cheaper. Across several providers, refresh handling and connection lifecycle work become more persuasive reasons to buy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We would deploy Composio when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We want managed authentication without moving provider tokens through our app.&lt;/li&gt;
&lt;li&gt;Our backend enforces immutable identity and connected-account ownership.&lt;/li&gt;
&lt;li&gt;We can use hosted execution and accept the selected custody arrangement.&lt;/li&gt;
&lt;li&gt;Provider scopes, consent branding, and quota ownership fit the product.&lt;/li&gt;
&lt;li&gt;Isolation, refresh, revocation, throttling, and webhook tests pass against real accounts.&lt;/li&gt;
&lt;li&gt;Our team owns reconnect UX and side-effect-safe recovery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold deployment when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser or model input selects arbitrary owners or account IDs.&lt;/li&gt;
&lt;li&gt;We depend on direct proxy &lt;code&gt;user_id&lt;/code&gt; alone for authorization.&lt;/li&gt;
&lt;li&gt;A local provider SDK requires a raw token we expect Composio to export.&lt;/li&gt;
&lt;li&gt;We require no vendor decryption capability but have selected default Cloud custody.&lt;/li&gt;
&lt;li&gt;We lack verified webhook delivery semantics for consequential workflows.&lt;/li&gt;
&lt;li&gt;We need benchmark-backed latency guarantees that we have not measured.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our conclusion is deliberately narrower than “OAuth solved.” Composio offers a useful managed credential-and-execution boundary. We still own the identity boundary and the consequences of every tool call.&lt;/p&gt;

&lt;p&gt;Before approval, we would work through the &lt;a href="https://docs.composio.dev/docs/production-readiness" rel="noopener noreferrer"&gt;production checklist&lt;/a&gt;, reproduce the &lt;a href="https://docs.composio.dev/docs/authentication/managed-auth-for-custom-tools" rel="noopener noreferrer"&gt;custom-tool authentication path&lt;/a&gt;, and obtain security answers against the &lt;a href="https://docs.composio.dev/docs/security/token-custody" rel="noopener noreferrer"&gt;custody contract&lt;/a&gt;. That is where a convenient integration becomes a defensible production decision.&lt;/p&gt;

</description>
      <category>composio</category>
      <category>oauth</category>
      <category>agentinfrastructure</category>
      <category>security</category>
    </item>
    <item>
      <title>Browser Use Anti-Detect: Production Stealth and Session Gotchas</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Sun, 29 Nov 2026 00:36:17 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/browser-use-anti-detect-production-stealth-and-session-gotchas-4poe</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/browser-use-anti-detect-production-stealth-and-session-gotchas-4poe</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated the Browser Use Anti-Detect Browser
&lt;/h2&gt;

&lt;p&gt;The expensive browser-agent failure is not always a bad model decision. Sometimes the agent never reaches the application: a proxy is rejected, a challenge replaces the page, or a returning login looks like a new device. More reasoning tokens cannot repair an infrastructure-level denial.&lt;/p&gt;

&lt;p&gt;Vendor-reported site access&lt;span&gt;Browser Use Cloud 90.5%/100&lt;/span&gt;&lt;span&gt;Anchor Browser 82%/100&lt;/span&gt;&lt;span&gt;Browserbase 78.5%/100&lt;/span&gt;&lt;span&gt;Hyperbrowser 73.5%/100&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Browser Use led its own Stealth Bench V2, but the sites were selected partly because it had previously passed where stock Chrome did not; these results are not a production success forecast.&lt;/p&gt;

&lt;p&gt;We evaluated the &lt;strong&gt;Browser Use anti-detect browser&lt;/strong&gt; around that boundary. Our question was not whether a browser could open a page. It was whether its identity, lifecycle, and billing semantics would support repeatable production workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our verdict is conditional: shortlist it for authorized automation, but do not confuse persistent login state with persistent device identity.&lt;/strong&gt; Browser Use preserves profile state while randomizing the fingerprint for each browser session. There is no fingerprint-pinning option in the published API contract. That distinction can disqualify it before price or stealth scores matter.&lt;/p&gt;

&lt;p&gt;We need to establish the evidence boundary up front. This review includes a source-verified interface walkthrough and a runnable acceptance probe. We did not have an authenticated cloud browser or a running local browser available, so we did not execute that probe, measure live block rates, or reproduce production load. The output below is explicitly simulated. We will not turn an integration recipe into a fictional deployment report.&lt;/p&gt;

&lt;p&gt;Under the hood, we are evaluating a hosted, hardened Chromium fork exposed through CDP. The service combines browser fingerprint changes, residential proxies, and CAPTCHA handling. We can drive it with Playwright or Puppeteer instead of delegating the entire workflow to a hosted agent.&lt;/p&gt;

&lt;p&gt;We keep those products separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Browser infrastructure:&lt;/strong&gt; our code controls the remote browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosted web agents:&lt;/strong&gt; we submit tasks and pay for a broader execution stack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Profiles:&lt;/strong&gt; saved browser state, not permanent virtual devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also restrict this evaluation to sites we own or have permission to automate. Stealth infrastructure is not permission to bypass an account ban or a site's access restrictions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We start with deterministic browser control. Adding an agent before establishing page access makes failures harder to classify.&lt;/p&gt;

&lt;p&gt;For a new integration, we use API V4 and authenticate with &lt;code&gt;X-Browser-Use-API-Key&lt;/code&gt;, without a Bearer prefix. Browser creation returns a &lt;code&gt;cdpUrl&lt;/code&gt;; our page code attaches to the existing context so managed settings and profile cookies apply.&lt;/p&gt;

&lt;p&gt;The following probe requires Node.js 20 or later and an optional Browser Use API key. Without the key, it exits before creating anything billable. No local Chromium download is necessary for the remote CDP connection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir browser-use-probe &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; browser-use-probe
npm init -y
npm install playwright
&lt;span class="c"&gt;# Commit package.json and package-lock.json after reviewing resolved versions.&lt;/span&gt;

&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;BROWSER_USE_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace-with-your-key"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;TARGET_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://example.com"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;EXPECTED_TEXT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Example Domain"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PROXY_COUNTRY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"us"&lt;/span&gt;

&lt;span class="c"&gt;# Optional: use an existing profile created through your account.&lt;/span&gt;
&lt;span class="c"&gt;# export PROFILE_ID="your-profile-id"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this as &lt;code&gt;probe.mjs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;chromium&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"playwright"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createHash&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:crypto"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BROWSER_USE_API_KEY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Missing BROWSER_USE_API_KEY; no browser created."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://api.browser-use.com/api/v4/browsers"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;TARGET_URL&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;EXPECTED_TEXT&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;"Example Domain"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"X-Browser-Use-API-Key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AbortSignal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do not print response bodies that might contain sensitive URLs.&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`API ${method} failed: HTTP ${response.status}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;surfaceDigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;colorDepth&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolvedOptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;webdriver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webdriver&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// This samples a few surfaces; it is not a complete fingerprint.&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"sha256"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hex"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cleanupFailed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;proxyCountryCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PROXY_COUNTRY&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;"us"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PROFILE_ID&lt;/span&gt;
      &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;profileId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PROFILE_ID&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdpUrl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Create response missing browser ID or CDP URL"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connectOverCDP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdpUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contexts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Managed context unavailable"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;waitUntil&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"domcontentloaded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;surfaceDigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;contentPresent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;exact&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isVisible&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;waitUntil&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"domcontentloaded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;surfaceDigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;httpStatus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;contentPresent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sampledSurfacesStableAcrossReload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;profileRequested&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PROFILE_ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;contentPresent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Probe failed; inspect restricted diagnostics."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CDP disconnect failed."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${endpoint}/${session.id}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"PATCH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"stop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Managed browser stop request accepted."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;cleanupFailed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"STOP FAILED: reconcile managed browser in dashboard."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cleanupFailed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Do not assume billing has stopped."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node probe.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative successful output—not an observed cloud result:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "host": "example.com",
  "httpStatus": 200,
  "contentPresent": true,
  "sampledSurfacesStableAcrossReload": true,
  "profileRequested": false
}
Managed browser stop request accepted.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We deliberately avoid labeling this &lt;code&gt;stealthPassed&lt;/code&gt;. Finding expected text on Example Domain proves neither anti-bot resistance nor workflow completion. Likewise, a stable digest covers only the sampled properties; it excludes canvas, WebGL, fonts, and network-level signals.&lt;/p&gt;

&lt;p&gt;The probe also has an operational limit: if browser creation succeeds remotely but its response is lost, the script may not receive an ID to stop. Our production design therefore needs an independent reconciliation process, not just &lt;code&gt;finally&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For fingerprint persistence, our acceptance procedure adds three separate checks on an owned diagnostic origin:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reload and reconnect to the &lt;strong&gt;same running browser&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Stop it, then create a &lt;strong&gt;new browser using the same profile&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create another browser with a &lt;strong&gt;different profile&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We compare browser-surface observations separately from a harmless cookie and local-storage marker. Login persistence must also be tested against the actual application. Cookie survival is not proof that its authentication system will accept the next session.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Could Not Verify and Documented Deployment Limits
&lt;/h2&gt;

&lt;p&gt;Our immediate roadblock was evidence, not a mysterious Chromium crash: without authenticated execution, we could not validate fingerprint persistence or real-site behavior. The integration review nevertheless exposed several deployment-breaking assumptions. These are documented constraints we would test, not failures we claim to have reproduced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The first is device identity.&lt;/strong&gt; We cannot configure a profile to retain one exact fingerprint across browser sessions. Profiles preserve cookies, local storage, and login state, while fingerprints are randomized per session. For applications that bind authentication to a long-lived device, we would require explicit reauthentication testing or choose infrastructure with persistent device identity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The second is silent emulation failure.&lt;/strong&gt; In our &lt;a href="https://docs.browser-use.com/cloud/browser/playwright-puppeteer-selenium" rel="noopener noreferrer"&gt;CDP integration review&lt;/a&gt;, we identified a constraint to test: window-resize and device-emulation commands are ignored by default while still returning success. A successful &lt;code&gt;setViewportSize()&lt;/code&gt; call therefore does not prove that the rendered viewport changed.&lt;/p&gt;

&lt;p&gt;Our workaround is to set &lt;code&gt;browserScreenWidth&lt;/code&gt; and &lt;code&gt;browserScreenHeight&lt;/code&gt; during creation and assert the actual page dimensions. When necessary, we also supply &lt;code&gt;allowResizing: true&lt;/code&gt; at creation time. We would keep that variant separate in stealth tests because resizing weakens the intended fingerprint consistency.&lt;/p&gt;

&lt;p&gt;User-agent overrides are a harder boundary: &lt;code&gt;Network.setUserAgentOverride&lt;/code&gt; remains ignored even with resizing enabled. We would not reuse a mobile-emulation test suite unchanged and call its results valid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The third is context isolation.&lt;/strong&gt; Calling &lt;code&gt;newContext()&lt;/code&gt; creates an incognito context that does not inherit the saved profile's cookies. We use the existing managed context. We also do not assume profile synchronization imports saved passwords or guarantees a persistent HTTP disk cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fourth is cleanup.&lt;/strong&gt; Closing CDP, calling Playwright's &lt;code&gt;browser.close()&lt;/code&gt;, or closing the SDK client does not stop the managed browser. We explicitly stop it through the API and reconcile failures independently.&lt;/p&gt;

&lt;p&gt;For workflows with external side effects, we apply the same principle discussed in &lt;a href="https://dev.to/articles/restate-ai-durable-execution-sdk-gotchas-2026"&gt;Restate AI: Crash Recovery, Side Effects, and SDK Gotchas&lt;/a&gt;: reconnection is not permission to repeat a submission. We check whether an action completed before retrying it.&lt;/p&gt;

&lt;p&gt;Other boundaries matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We use Playwright or Puppeteer for the documented remote WebSocket CDP path, not Selenium's local &lt;code&gt;debugger_address&lt;/code&gt; attachment mechanism.&lt;/li&gt;
&lt;li&gt;We treat hCaptcha handling as newer and not guaranteed.&lt;/li&gt;
&lt;li&gt;CAPTCHA solving is unavailable in the EU region.&lt;/li&gt;
&lt;li&gt;API-browser recording is off by default; Zero Data Retention projects never record.&lt;/li&gt;
&lt;li&gt;We treat CDP URLs, live views, traces, and recordings as sensitive access or data artifacts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these establishes memory spikes or latency regressions. We have no measurements supporting such claims.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We separate three questions: can the page load, can the workflow complete, and can the system sustain the required concurrency? A stealth percentage answers only part of the first.&lt;/p&gt;

&lt;p&gt;Our evidence comparison looks like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Evidence we can use&lt;/th&gt;
&lt;th&gt;Identity boundary&lt;/th&gt;
&lt;th&gt;Main decision risk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Browser Use Cloud&lt;/td&gt;
&lt;td&gt;Vendor-run Stealth Bench V2: 90.5% of visits got through&lt;/td&gt;
&lt;td&gt;Fresh fingerprint per session; reusable profile state&lt;/td&gt;
&lt;td&gt;Benchmark selection bias; workload fit unverified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anchor Browser&lt;/td&gt;
&lt;td&gt;82% in Browser Use's test; 1.7% stealth failure in Halluminate's separate test&lt;/td&gt;
&lt;td&gt;Must validate independently&lt;/td&gt;
&lt;td&gt;Scores come from different workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browserbase&lt;/td&gt;
&lt;td&gt;78.5% in Browser Use's standard-plan comparison; 3.4% stealth failure in Halluminate&lt;/td&gt;
&lt;td&gt;Must validate independently&lt;/td&gt;
&lt;td&gt;Enterprise Verified mode excluded from the vendor comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hyperbrowser&lt;/td&gt;
&lt;td&gt;73.5% in Browser Use's comparison; 2.7% stealth failure in Halluminate&lt;/td&gt;
&lt;td&gt;Must validate independently&lt;/td&gt;
&lt;td&gt;Ultra Stealth excluded from the vendor comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosted Playwright/Chromium&lt;/td&gt;
&lt;td&gt;Full control; no equivalent independently verified score here&lt;/td&gt;
&lt;td&gt;We own persistence and proxy configuration&lt;/td&gt;
&lt;td&gt;Browser maintenance and recovery become our responsibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Desktop anti-detect browser&lt;/td&gt;
&lt;td&gt;Potential fit for long-lived profile/device identity&lt;/td&gt;
&lt;td&gt;Product-specific persistence&lt;/td&gt;
&lt;td&gt;Desktop lifecycle and automation constraints&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We do &lt;strong&gt;not&lt;/strong&gt; combine those percentages into a leaderboard.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://browser-use.com/anti-detect-browser" rel="noopener noreferrer"&gt;Browser Use's Stealth Bench V2&lt;/a&gt;, the scope is 100 bot-protected sites, two visits per provider, and 60 seconds per visit. A provider-blind model judges whether the real site loaded. Each provider uses its own proxy and CAPTCHA solver, with standard-plan stealth configurations.&lt;/p&gt;

&lt;p&gt;The critical qualification is site selection: those sites were chosen because Browser Use historically passed where stock Chrome with a US proxy did not. We treat the 90.5% result as vendor-run evidence on a selected difficult set, not a production success forecast. We also include the &lt;a href="https://browser-use.com/developers" rel="noopener noreferrer"&gt;84% site-access result with CAPTCHA solving disabled&lt;/a&gt; in our benchmark review, without treating it as an EU workflow completion rate or our own live measurement.&lt;/p&gt;

&lt;p&gt;For an independent methodological cross-check, we use &lt;a href="https://www.halluminate.ai/blog/browserbench" rel="noopener noreferrer"&gt;Halluminate's BrowserBench&lt;/a&gt;. It contains 292 read-based tasks across 292 websites, generally requiring 5–25 steps. It holds the Browser Use agent framework and GPT-OSS model constant, with human grading as the primary evaluation.&lt;/p&gt;

&lt;p&gt;That benchmark measures proxy/CAPTCHA-related trajectory failures. Browser Use is the &lt;strong&gt;agent framework&lt;/strong&gt;, not a tested cloud-browser provider. Its results cannot independently validate Browser Use Cloud. Nor does the 15% share of all agent failures attributed to stealth mean a 15% stealth failure rate across all tasks.&lt;/p&gt;

&lt;p&gt;We also lack an independent product review of Browser Use Cloud in the available evidence. BrowserBench is useful, but it does not fill that gap.&lt;/p&gt;

&lt;p&gt;For our deployment gate, we would start with five authorized pages spanning a diagnostic origin, public content, an authenticated read, navigation, and a protected read. We would run repeated paired trials with randomized provider order and fixed country, assertions, and time budget. Challenges, explicit blocks, proxy failures, timeouts, and application failures need separate labels. A challenge that is solved is not a blocked workflow.&lt;/p&gt;

&lt;p&gt;We would report per-domain outcomes, sample counts, uncertainty, p50/p95 completion latency, and retry counts. Until then, we have no defensible cloud latency or load result. This is the same evaluation discipline we use in &lt;a href="https://dev.to/articles/inspect-ai-agent-evaluation-production-benchmark-2026"&gt;Inspect AI: Agent Evals, Logs, and Model-Upgrade Gates&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The cost arithmetic is clearer. At the listed &lt;strong&gt;$0.06 per browser-hour&lt;/strong&gt; and &lt;strong&gt;$5/GB residential traffic&lt;/strong&gt;, an illustrative two-minute attempt transferring 10 MB costs, using decimal GB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser:  (2 / 60) × $0.06 = $0.002
Traffic:  0.010 × $5       = $0.050
Total:                       $0.052 per attempt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At an assumed 80% completion rate, that is &lt;strong&gt;$0.065 per completed workflow&lt;/strong&gt;, excluding models, orchestration, engineering, and manual recovery. Those are planning assumptions, not measurements.&lt;/p&gt;

&lt;p&gt;Traffic dominates this example. An extra 10 MB costs as much as 50 browser-minutes. Resource blocking might help, but we would retest both application behavior and completion rate after changing it.&lt;/p&gt;

&lt;p&gt;For break-even planning, suppose self-hosting requires eight maintenance hours monthly at $100/hour. That is $800 before infrastructure. At $0.065 per completion, roughly 12,300 managed completions consume the same amount. This is not a universal crossover: self-hosting still needs proxies, and neither option's failure cost is known.&lt;/p&gt;

&lt;p&gt;The listed limit for new projects is 10 concurrent browsers shared across project keys, with higher limits based on spending. We would verify the account's actual limit, bound workers, stagger polling, and honor &lt;code&gt;Retry-After&lt;/code&gt;. More API keys do not create more project capacity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;We would approve a &lt;strong&gt;bounded pilot&lt;/strong&gt;, not an unconditional production rollout.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy this if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We have permission to automate the target sites.&lt;/li&gt;
&lt;li&gt;We need managed Chromium accessible through Playwright or Puppeteer.&lt;/li&gt;
&lt;li&gt;Saved profile state is sufficient without a pinned device fingerprint.&lt;/li&gt;
&lt;li&gt;Our own trials establish acceptable completion rates and recovery costs.&lt;/li&gt;
&lt;li&gt;We implement explicit browser stopping and orphan reconciliation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hold off or avoid it if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The application requires an unchanged device identity for months.&lt;/li&gt;
&lt;li&gt;We need faithful device emulation or arbitrary user-agent overrides.&lt;/li&gt;
&lt;li&gt;EU operation depends on managed CAPTCHA solving.&lt;/li&gt;
&lt;li&gt;We need independently reproduced Browser Use Cloud block-rate or load evidence before procurement.&lt;/li&gt;
&lt;li&gt;A reliable authorized API can replace browser interaction entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The architectural appeal is real: we can retain deterministic page logic while outsourcing browser hardening, proxy integration, and browser operation. The unresolved question is whether that bundle lowers &lt;strong&gt;cost per completed workflow on our domains&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We would begin with the &lt;a href="https://docs.browser-use.com/cloud/browser/quickstart" rel="noopener noreferrer"&gt;browser quickstart&lt;/a&gt;, validate the &lt;a href="https://docs.browser-use.com/cloud/browser/playwright-puppeteer-selenium" rel="noopener noreferrer"&gt;CDP limitations&lt;/a&gt;, and run the acceptance probe before introducing agent reasoning. Our purchase criteria are repeatable completion, acceptable identity behavior, and reliable control over browser billing—not a stealth score alone.&lt;/p&gt;

</description>
      <category>browserautomation</category>
      <category>browseruse</category>
      <category>playwright</category>
      <category>productioninfrastructure</category>
    </item>
    <item>
      <title>Cartesia Streaming TTS: Latency, WebSockets, and Cost per Call</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Sat, 28 Nov 2026 00:36:56 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/cartesia-streaming-tts-latency-websockets-and-cost-per-call-1i25</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/cartesia-streaming-tts-latency-websockets-and-cost-per-call-1i25</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated Cartesia for Voice Agents
&lt;/h2&gt;

&lt;p&gt;We brought Cartesia into our voice-infrastructure review because “fast TTS” is an incomplete purchasing criterion. We need to know when usable audio reaches our application, whether playback can remain continuous, and what interrupted or retried speech does to the bill.&lt;/p&gt;

&lt;p&gt;Public benchmarks are not production proof&lt;/p&gt;
&lt;p&gt;Public benchmarks and the documented WebSocket interface support a controlled proof of concept, but unmeasured latency, reliability, and billing leave production readiness unproven.&lt;/p&gt;

&lt;p&gt;Our production concern is the gap between &lt;strong&gt;receiving an audio chunk and playing it to a caller&lt;/strong&gt;. Connection establishment, text buffering, output decoding, playback buffering, and telephony transport all sit around synthesis. A vendor-level latency number cannot stand in for that entire path.&lt;/p&gt;

&lt;p&gt;Cartesia’s relevant interface is a persistent WebSocket carrying text into generation contexts and audio back out. We can append incremental LLM text to the same context instead of waiting for an entire response. That is a useful architectural fit for voice agents, but it introduces lifecycle and buffering decisions that a simple HTTP request hides.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our evidence boundary matters:&lt;/strong&gt; we reviewed the official interface and the supplied benchmark material, but we did not execute authenticated Cartesia requests. We had neither credentials nor live network access for this review. Consequently, we have no firsthand service latency, jitter, error-rate, retry, or billing measurements. The executable example below includes an explicitly simulated mode; it is not a Cartesia performance result.&lt;/p&gt;

&lt;p&gt;That leaves us with a narrower but still actionable verdict: Cartesia merits an instrumented proof of concept, not an unconditional production recommendation.&lt;/p&gt;

&lt;p&gt;We also keep the surrounding voice stack separate. Our &lt;a href="https://dev.to/articles/jambonz-self-hosted-voice-ai-concurrency-benchmark-2026"&gt;jambonz versus LiveKit concurrency review&lt;/a&gt; addresses infrastructure capacity; this review isolates the TTS boundary. Neither layer proves the other is production-ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We anchored our integration design to the &lt;a href="https://docs.cartesia.ai/api-reference/tts/websocket" rel="noopener noreferrer"&gt;official WebSocket reference&lt;/a&gt; and &lt;a href="https://docs.cartesia.ai/get-started/realtime-text-to-speech-quickstart" rel="noopener noreferrer"&gt;realtime quickstart&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The interface we reviewed establishes these configuration requirements:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Our integration choice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wss://api.cartesia.ai/tts/websocket&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API version&lt;/td&gt;
&lt;td&gt;Explicitly pin a supported version; the reference gives &lt;code&gt;2026-08-14&lt;/code&gt; as an example&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;sonic-3.6&lt;/code&gt;, not the moving &lt;code&gt;sonic-latest&lt;/code&gt; alias&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Voice&lt;/td&gt;
&lt;td&gt;One fixed voice ID throughout the comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;Raw, 44.1 kHz, &lt;code&gt;pcm_f32le&lt;/code&gt;, matching the quickstart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;A fresh generation context for each utterance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input completion&lt;/td&gt;
&lt;td&gt;Explicit &lt;code&gt;no_more_inputs()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would not copy a direct WebSocket authentication implementation from the truncated reference excerpt: it does not establish the complete authentication and response contract. The example instead uses the official SDK flow.&lt;/p&gt;

&lt;p&gt;The installation commands are straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv .venv
. .venv/bin/activate
python -m pip install &lt;span class="s1"&gt;'cartesia[websockets]'&lt;/span&gt;
python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.lock

&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CARTESIA_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace-with-your-server-side-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have not validated a particular SDK release exposing these methods. Before a real benchmark, inspect the installed package, confirm the quickstart works, and retain the resulting lockfile. Installing an unpinned package is a bootstrap step, not a reproducible benchmark environment. The scaffold below also relies on the SDK’s version configuration; a formal run must verify and record its effective wire-level API version.&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;bench_cartesia.py&lt;/code&gt;. Default execution uses synthetic events with invented timings. Passing &lt;code&gt;--live&lt;/code&gt; switches to the SDK and requires credentials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;statistics&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="no"&gt;TEXTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"Hello. How can I help you today?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Your appointment is on December third at nine thirty."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"The total is forty-two dollars and fifteen cents."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="no"&gt;VOICE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"f786b574-daa5-4673-aa0c-cbe3e8534c02"&lt;/span&gt;
&lt;span class="no"&gt;BYTES_PER_SECOND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;44100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;  &lt;span class="c1"&gt;# Mono float32 PCM.&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;done_ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connect_ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;arrivals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;sizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;gaps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arrivals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arrivals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"connect_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connect_ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"ttfa_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arrivals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;arrivals&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"done_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;done_ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"audio_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="no"&gt;BYTES_PER_SECOND&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"audio_chunks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"gap_mean_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gaps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;gaps&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"gap_stddev_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pstdev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gaps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;gaps&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"gap_max_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gaps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;gaps&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"retries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;live&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;live&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Synthetic fixture: these are not vendor measurements.&lt;/span&gt;
        &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;180.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s2"&gt;"\0"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;17640&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;270.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s2"&gt;"\0"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;17640&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;380.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s2"&gt;"\0"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;17640&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;390.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;35.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"SIMULATED"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;connected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;websocket_connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connect_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;connected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
        &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"sonic-3.6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;voice&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;VOICE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;output_format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"container"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"raw"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"encoding"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"pcm_f32le"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"sample_rate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;no_more_inputs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;receive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"chunk"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"done"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Generation ended without audio"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connect_ms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"LIVE"&lt;/span&gt;
                &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Stream ended without a done event"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="n"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ArgumentParser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"--live"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"store_true"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse_args&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;live&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cartesia&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Cartesia&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Cartesia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CARTESIA_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TEXTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;live&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"prompt_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"LIVE"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;live&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"SIMULATED"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"retries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run either mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python bench_cartesia.py &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; simulated.jsonl
&lt;span class="c"&gt;# Only after validating the installed SDK:&lt;/span&gt;
python bench_cartesia.py --live &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; live.jsonl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Illustrative output from the synthetic fixture—not observed Cartesia output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"SIMULATED"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"connect_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;35.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"ttfa_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;180.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"done_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;390.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"audio_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"audio_chunks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"gap_mean_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;100.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"gap_stddev_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;10.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"gap_max_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;110.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"retries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"prompt_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our TTFA clock starts immediately before &lt;code&gt;push()&lt;/code&gt; and stops at the first nonempty audio event delivered by the SDK. It excludes connection establishment and is not a packet-level first-byte measurement. It also excludes audible playback.&lt;/p&gt;

&lt;p&gt;The gap standard deviation is &lt;strong&gt;interarrival variability&lt;/strong&gt;, not a standardized network-jitter estimate. We need chunk durations and a playback-buffer simulation to determine whether those gaps cause underruns.&lt;/p&gt;

&lt;p&gt;This is deliberately a measurement scaffold, not a load generator. It opens a connection per prompt, performs no retries, and lacks a hard deadline. For a real trial, we would add supervised process deadlines, raw per-chunk logs, partial-audio accounting on failure, and separate persistent-connection runs. These limitations prevent a misleadingly polished script from masquerading as a production benchmark.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration Constraints and Review Limitations
&lt;/h2&gt;

&lt;p&gt;Our review had an immediate limitation: we could inspect the integration contract, but we could not complete the authenticated test. We therefore cannot honestly describe connection failures, SDK incompatibilities, or latency spikes as observed Cartesia defects.&lt;/p&gt;

&lt;p&gt;We did identify concrete integration risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input completion changes the experiment.&lt;/strong&gt; In our interface review, we mapped &lt;code&gt;push()&lt;/code&gt; to &lt;code&gt;continue: true&lt;/code&gt; and &lt;code&gt;no_more_inputs()&lt;/code&gt; to &lt;code&gt;continue: false&lt;/code&gt;. We would explicitly mark input completion to minimize latency, while verifying the installed SDK’s wire-level behavior before benchmarking. Forgetting completion can make an input-lifecycle mistake look like slow synthesis.&lt;/p&gt;

&lt;p&gt;Our scaffold follows that lifecycle. A follow-up experiment should distinguish complete-text submission from incremental text arriving on a fixed schedule. Sending every fragment immediately does not reproduce LLM streaming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Buffering is a separate variable.&lt;/strong&gt; In our configuration review, we identified a supported range of zero to 5,000 milliseconds for &lt;code&gt;max_buffer_delay_ms&lt;/code&gt;, with a default of 3,000 milliseconds. We do not interpret that default as an unconditional three-second delay. Its effect depends on continuation, completion, and flushing behavior.&lt;/p&gt;

&lt;p&gt;Our intended test matrix would vary buffering explicitly while retaining identical text-arrival timing. We would also listen to the results: reducing buffering is not a free quality improvement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The language fields have a hard conflict.&lt;/strong&gt; We found an explicit constraint against setting both &lt;code&gt;language&lt;/code&gt; and &lt;code&gt;locale&lt;/code&gt;. Our adapter design would normalize upstream configuration into one field before sending it, rather than allowing two services to independently populate both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Raw PCM needs an exact contract.&lt;/strong&gt; Our duration calculation assumes mono float32 PCM at 44.1 kHz. Changing the encoding without changing the denominator corrupts both generated-duration and per-minute-cost calculations. We would log encoding, sample rate, channel assumptions, and decoded byte counts alongside every measurement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retries can repeat speech.&lt;/strong&gt; We would not automatically replay an utterance after audio has reached a caller. Before first audio, a bounded retry may be acceptable. After playback begins, recovery needs an explicit conversational policy and cancellation of obsolete output.&lt;/p&gt;

&lt;p&gt;This is the same operational distinction we explore in &lt;a href="https://dev.to/articles/litellm-proxy-failover-routing-production-benchmark-2026"&gt;LiteLLM proxy failover and retry risk&lt;/a&gt;: request recovery is not necessarily safe user-visible recovery.&lt;/p&gt;

&lt;p&gt;Finally, we would keep permanent keys server-side and use ephemeral access tokens for browser integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We kept external benchmark results in their original scope rather than relabeling them as our measurements.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evidence or alternative&lt;/th&gt;
&lt;th&gt;Available result&lt;/th&gt;
&lt;th&gt;Our decision boundary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cartesia Sonic 3.6 in &lt;a href="https://benchmarks.coval.ai/providers/cartesia" rel="noopener noreferrer"&gt;Coval’s benchmark&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;Mean TTFA of 280 ms, ranked 18th of 30; last measured November 27, 2026&lt;/td&gt;
&lt;td&gt;A comparison point, not our WebSocket latency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sonic 3.6 intelligibility in the same benchmark&lt;/td&gt;
&lt;td&gt;1.3% WER, ranked second of 30&lt;/td&gt;
&lt;td&gt;Useful intelligibility evidence, not a naturalness score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sonic Turbo in &lt;a href="https://async.com/blog/tts-latency-vs-quality-benchmark/" rel="noopener noreferrer"&gt;Async’s November 2025 comparison&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;We found over three times slower TTFB for Sonic Turbo than AsyncFlow and Eleven Flash in this HTTPS comparison&lt;/td&gt;
&lt;td&gt;Older model and HTTPS transport; not a Sonic 3.6 WebSocket result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Eleven Flash and AsyncFlow in that comparison&lt;/td&gt;
&lt;td&gt;Competitor latency and listening comparisons&lt;/td&gt;
&lt;td&gt;Worth testing under our own identical transport and workload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosted TTS&lt;/td&gt;
&lt;td&gt;No matched measurements in this review&lt;/td&gt;
&lt;td&gt;Requires separate capacity, quality, operations, and GPU-cost testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Our live Cartesia evaluation&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;td&gt;No measured p95, throughput, error rate, or invoice-derived cost&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would not turn Coval’s 280 ms mean into a p95 promise. In our benchmark review, we could not verify the transport, client location, concurrency, or selected voice and output format behind that result. Its WER result also does not answer whether pronunciation, prosody, or emotional delivery suits our application.&lt;/p&gt;

&lt;p&gt;In our review of Async’s competitor-authored comparison, we checked the test conditions: HTTPS streaming from &lt;code&gt;us-central1&lt;/code&gt;, three warm-up runs per model, and 20 measured iterations per model, with median and p95 aggregation. We limit our interpretation to that configuration. Twenty iterations do not establish high-concurrency behavior, and the older Sonic Turbo result cannot be transferred to Sonic 3.6.&lt;/p&gt;

&lt;p&gt;For our deployment gate, we would run the fixed text set repeatedly at concurrency 1, then at increasing levels within account limits. We would separate new and reused sockets, retain failures in the denominator, and report first-attempt and eventual-success rates independently. Warm-up requests would remain visible rather than disappearing from cost accounting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Our practical cost model
&lt;/h3&gt;

&lt;p&gt;We found no verified Cartesia rate card in the supplied material. Consequently, a dollar figure presented as Cartesia’s current price would be invented.&lt;/p&gt;

&lt;p&gt;Instead, we use a worked example with &lt;strong&gt;hypothetical prices&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Character rate: $10 per million billable characters.&lt;/li&gt;
&lt;li&gt;Agent speech: 900 characters per connected call minute.&lt;/li&gt;
&lt;li&gt;Call duration: four minutes.&lt;/li&gt;
&lt;li&gt;Regenerated or duplicated billable characters: 5%.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Billable characters per call = 900 × 4 × 1.05 = 3,780
TTS cost per call            = 3,780 × $10 / 1,000,000
                            = $0.0378

TTS cost per connected minute = $0.0378 / 4
                              = $0.00945
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are scenario calculations, not a Cartesia quote. We would replace the assumed character rate and billable-character count with the actual contract and usage ledger.&lt;/p&gt;

&lt;p&gt;Generated-audio minutes require a different denominator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cost per generated minute =
    total attributable TTS spend / generated audio minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connected minutes include listening and silence. Generated minutes may include speech never played after an interruption. Mixing those denominators can make a vendor appear artificially cheap.&lt;/p&gt;

&lt;p&gt;For a break-even example, suppose one candidate costs $0.012 per call and another costs $0.020, while integration and migration cost $4,000:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Break-even volume = $4,000 / ($0.020 - $0.012)
                  = 500,000 calls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would only accept that calculation after matching quality, retries, abandonment, and operational overhead. Self-hosting deserves the same discipline: reserved capacity and engineering labor remain costs even when no one is speaking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;Our verdict is &lt;strong&gt;proceed to a controlled proof of concept; hold production sign-off&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We like the architectural fit: persistent transport, generation contexts, incremental text, and explicit input completion are appropriate primitives for voice-agent TTS. We have not established their latency or economics in our deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We would deploy after a pilot if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Our region, voice, encoding, and concurrency meet a defined TTFA budget.&lt;/li&gt;
&lt;li&gt;Playback-buffer tests show acceptable continuity.&lt;/li&gt;
&lt;li&gt;Cancellation prevents obsolete speech from reaching callers.&lt;/li&gt;
&lt;li&gt;Retry behavior is safe before and after playback starts.&lt;/li&gt;
&lt;li&gt;Usage records reconcile with invoice-derived cost per call.&lt;/li&gt;
&lt;li&gt;Listening tests pass our actual names, numbers, and domain vocabulary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold off if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The purchasing case depends on interpreting a public mean as a tail-latency guarantee.&lt;/li&gt;
&lt;li&gt;We cannot pin the model, SDK, and API version.&lt;/li&gt;
&lt;li&gt;Our only cost estimate divides list pricing by assumed speech duration.&lt;/li&gt;
&lt;li&gt;We need unsupported claims about concurrency or automatic failover.&lt;/li&gt;
&lt;li&gt;We cannot observe partial failures and discarded generation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our next step would be small and measurable: validate the &lt;a href="https://docs.cartesia.ai/get-started/realtime-text-to-speech-quickstart" rel="noopener noreferrer"&gt;official quickstart&lt;/a&gt;, lock the environment, run the fixed prompts, and reconcile generated audio with usage. Until those results exist, the honest production answer is not “Cartesia is fast enough.” It is: &lt;strong&gt;we know what to measure, but we do not yet have the evidence to approve deployment.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>streamingtts</category>
      <category>cartesia</category>
      <category>websocket</category>
      <category>voiceagents</category>
    </item>
    <item>
      <title>Distilabel Production Review: Cost, Dedup, and Quality Gotchas</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Fri, 27 Nov 2026 00:37:47 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/distilabel-production-review-cost-dedup-and-quality-gotchas-24je</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/distilabel-production-review-cost-dedup-and-quality-gotchas-24je</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated Distilabel
&lt;/h2&gt;

&lt;p&gt;We brought Distilabel into our review queue because generating instruction-response pairs is easy; producing a defensible training dataset is not. The expensive work starts when we ask which examples survived, why they survived, whether they duplicate existing material, and how much we spent on rejected outputs.&lt;/p&gt;

&lt;p&gt;Pilot, Not Production Approval&lt;/p&gt;
&lt;p&gt;The sandbox could not start, leaving installation, retries, and deduplication throughput unmeasured; Distilabel warrants a bounded pilot rather than production approval.&lt;/p&gt;

&lt;p&gt;Our production question was straightforward: can we replace a collection of generation scripts with an inspectable synthetic data pipeline without hiding cost or losing rows?&lt;/p&gt;

&lt;p&gt;Distilabel provides Python pipeline orchestration around generation and feedback tasks. Steps exchange batches of dictionaries, with keys representing dataset columns. Tasks can generate responses or assess them, and the resulting &lt;code&gt;Distiset&lt;/code&gt; can contain multiple output subsets. This is useful infrastructure, but it is not an automatic guarantee of correct labels, independent judgments, or exactly-once provider execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our execution boundary matters:&lt;/strong&gt; the supplied sandbox could not start because its &lt;code&gt;python:3.12-slim&lt;/code&gt; image was unavailable. We therefore did not complete installation, reproduce the public pipeline, or measure Distilabel throughput, retries, token charges, or deduplication performance. This is a source-verified architecture review with an executable contract example—not a completed production benchmark.&lt;/p&gt;

&lt;p&gt;I will not turn that infrastructure failure into invented timing numbers.&lt;/p&gt;

&lt;p&gt;For the review, we checked the &lt;a href="https://github.com/argilla-io/distilabel/" rel="noopener noreferrer"&gt;official Distilabel repository&lt;/a&gt;, the &lt;a href="https://huggingface.co/docs/hub/datasets-distilabel" rel="noopener noreferrer"&gt;Hugging Face integration guide&lt;/a&gt;, and a &lt;a href="https://github.com/fikreab-s/synth-data-distilabel-pipeline/tree/main" rel="noopener noreferrer"&gt;public Evol-Instruct pipeline&lt;/a&gt;. The public workflow is a useful reference architecture: seed topics, instruction evolution, response generation, quality filtering, deduplication, and business validation.&lt;/p&gt;

&lt;p&gt;Our judgment is conditional: Distilabel is worth evaluating when reusable task implementations and dataset lineage reduce engineering work. We would not approve unattended generation merely because a workflow finishes or a quality score increases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Documented Setup and a Simulated Contract Example
&lt;/h2&gt;

&lt;p&gt;We verified the installation instructions against the official README. Its base command is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade distilabel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We verified Python 3.9 or newer as the stated installation requirement; we did not execute a compatibility matrix. We also identified the &lt;code&gt;minhash&lt;/code&gt; extra for duplicate detection with &lt;code&gt;datasketch&lt;/code&gt; and &lt;code&gt;nltk&lt;/code&gt;, but did not install or test it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install &lt;span class="s2"&gt;"distilabel[minhash]"&lt;/span&gt;
python -m pip check
python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.resolved.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our deployment procedure would replace these unpinned discovery commands with an approved package version and a complete dependency lock. We would also retain the Python version, operating-system image digest, model revision, prompt hashes, and input dataset checksum.&lt;/p&gt;

&lt;p&gt;We checked the API example and used its &lt;code&gt;distilabel.models&lt;/code&gt; import, &lt;code&gt;Pipeline&lt;/code&gt; context, &lt;code&gt;TextGeneration&lt;/code&gt; task, and &lt;code&gt;pipeline.run(dataset=...)&lt;/code&gt; call as the basis for the adaptation below. We did not successfully execute it in our sandbox:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Requires access and authentication for the configured model/backend.&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datasets&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Dataset&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;distilabel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;InferenceEndpointsLLM&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;distilabel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pipeline&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Pipeline&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;distilabel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;TextGeneration&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;seeds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"row_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"seed-001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"instruction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Explain retry budgets for a payment API."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;Pipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"synthetic-data-smoke"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nc"&gt;TextGeneration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;InferenceEndpointsLLM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"meta-llama/Meta-Llama-3.1-8B-Instruct"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;generation_kwargs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="s2"&gt;"temperature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"max_new_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;distiset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;seeds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distiset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"__main__"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would check backend availability and the installed release before using this smoke test. A model identifier alone does not establish endpoint access or a free inference service.&lt;/p&gt;

&lt;p&gt;We also checked explicit step connections with &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, column mappings, and runtime parameters keyed by task name. Comparing the examples, we found &lt;code&gt;distilabel.llms&lt;/code&gt; in the Hugging Face integration pattern and &lt;code&gt;distilabel.models&lt;/code&gt; in the repository pattern. We treat that difference as an import-verification gate rather than assuming examples from different documentation snapshots are interchangeable.&lt;/p&gt;

&lt;h3&gt;
  
  
  A runnable, dependency-free contract example
&lt;/h3&gt;

&lt;p&gt;Before paying for generation, we want the acceptance logic to be testable without a model. The following standalone example simulates three instruction mutations, response generation, a transient failure, quality rejection, and exact deduplication.&lt;/p&gt;

&lt;p&gt;It &lt;strong&gt;does not execute Distilabel, reproduce Evol-Instruct research, calculate perplexity, or benchmark MinHash&lt;/strong&gt;. Its purpose is narrower: make row accounting and retry accounting explicit.&lt;/p&gt;

&lt;p&gt;Save it as &lt;code&gt;contract_demo.py&lt;/code&gt; and run &lt;code&gt;python contract_demo.py&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="n"&gt;seeds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"seed-{i:03d}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"instruction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Explain API topic {i}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;attempts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;rejected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;accepted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mock_generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;attempts&lt;/span&gt;
    &lt;span class="n"&gt;attempts&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"seed-002:constraints"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;TimeoutError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"injected transient timeout"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Deliberately make all three variants of a seed identical.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"instruction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"base_instruction"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"generation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Use bounded retries and explicit timeouts."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"fixture_quality"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"seed-000:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seeds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"deepen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"constraints"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"multistep"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{seed['id']}:{strategy}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"base_instruction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"instruction"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"strategy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mock_generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;break&lt;/span&gt;
            &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;TimeoutError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="k"&gt;raise&lt;/span&gt;
                &lt;span class="n"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"fixture_quality"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"quality"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="n"&gt;canonical&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"instruction"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"generation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;ensure_ascii&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;separators&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;","&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;":"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;digest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;canonical&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;digest&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"duplicate"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seeds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"simulated-contract-only"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"seeds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seeds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"candidates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"response_attempts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;attempts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"injected_retries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"quality_rejected"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"quality"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"duplicate_rejected"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"duplicate"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"accepted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected simulated stdout, derived from the fixture logic rather than a sandbox execution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"simulated-contract-only"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"seeds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"candidates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"response_attempts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"injected_retries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"quality_rejected"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"duplicate_rejected"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"accepted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We deliberately separate logical examples from attempts. Thirty candidate rows require 31 response attempts in this fixture, but that count excludes any real evolution or judge calls. A production ledger must include those stages too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution Limits and Unresolved Deployment Requirements
&lt;/h2&gt;

&lt;p&gt;The actual execution failure was environmental: the sandbox image was unavailable. We did not reach a Distilabel runtime failure. Beyond that hard boundary, our source inspection exposed several deployment gates that remain unresolved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, our public-pipeline reproduction stopped at source inspection.&lt;/strong&gt; The reference repository’s quickstart clones a different owner path from the repository supplied for this review. We would clone the reviewed repository explicitly, record its commit, and inspect its scripts before running them.&lt;/p&gt;

&lt;p&gt;We also cannot derive its expansion policy from “three evolutions.” Fifty seeds do not become 500 examples merely by applying three serial mutations once. Retaining intermediate generations, branching, or producing multiple outputs changes both row counts and cost. We need the exact expansion policy before budgeting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, we would gate parallel execution on row identity, not output count alone.&lt;/strong&gt; We inspected the historical &lt;a href="https://github.com/argilla-io/distilabel/issues/972" rel="noopener noreferrer"&gt;batch-size/replica failure case&lt;/a&gt; and selected its configuration as our regression target: 60 inputs, a predecessor batch size of 50, generation batches of 17, and eight replicas. The recorded outcome was 52 saved outputs, with missing rows occurring frequently but not on every run. We identified the affected versions as 1.3.2 and 1.4.0 (develop), not as evidence of a defect in every current release.&lt;/p&gt;

&lt;p&gt;We have not reproduced that case or established its status in a current release. We would test it repeatedly alongside single-replica and aligned-batch configurations. Matching counts are insufficient: duplicated IDs can conceal missing IDs. Our acceptance gate compares expected identities, observed identities, multiplicity, and explicit rejection records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third, a quality score is not a correctness certificate.&lt;/strong&gt; We inspected a composite quality formula combining inverse perplexity, diversity, and business-logic signals. Before adopting it, we would require normalized components and documented weights. Otherwise, a numerical threshold has little portable meaning.&lt;/p&gt;

&lt;p&gt;Low perplexity can reward familiar boilerplate. It does not establish factual accuracy or instruction compliance. Likewise, a judge drawn from the same model family as the generator is not independent validation. We would calibrate acceptance against human-reviewed examples and deterministic domain checks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fourth, deduplication requires a precise definition of “same.”&lt;/strong&gt; Exact hashing, token-set MinHash, and embedding similarity answer different questions. Instructions differing only in “allow” versus “deny” can have high lexical overlap but opposite training value.&lt;/p&gt;

&lt;p&gt;We would use exact normalized-pair deduplication first, then evaluate near-duplicate candidates against a labeled set. MinHash LSH is approximate candidate retrieval, not a guarantee that every pair above a Jaccard threshold is found. Normalization, tokenization, signature size, and representative selection belong in the dataset manifest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally, retries remain unmeasured.&lt;/strong&gt; Our fixture implements its own single retry; it demonstrates nothing about Distilabel or provider defaults. We would record retries at each layer and cap the combined budget. The operational distinction is the same one we discuss in &lt;a href="https://dev.to/articles/litellm-proxy-failover-routing-production-benchmark-2026"&gt;LiteLLM Proxy Failover&lt;/a&gt;: a request can fail locally after the upstream service has already done billable work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We have no measured Distilabel rows-per-second, dedup throughput, latency percentiles, or memory figures to publish. We also have no real token invoice. The public reference’s filtering and downstream accuracy tables are not our benchmark results, and we would not use them as capacity-planning inputs.&lt;/p&gt;

&lt;p&gt;Our comparison is therefore architectural:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Where we see value&lt;/th&gt;
&lt;th&gt;Operational work we retain&lt;/th&gt;
&lt;th&gt;Evidence boundary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Distilabel&lt;/td&gt;
&lt;td&gt;Reusable generation and feedback tasks; dataset-oriented pipelines&lt;/td&gt;
&lt;td&gt;Row lineage, scoring calibration, retry accounting, release qualification&lt;/td&gt;
&lt;td&gt;API patterns verified; execution unmeasured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain Python with provider SDKs&lt;/td&gt;
&lt;td&gt;Small, explicit workflows with custom rules&lt;/td&gt;
&lt;td&gt;Scheduling, persistence, recovery, schemas, tracing&lt;/td&gt;
&lt;td&gt;No comparative benchmark&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ray Data with custom inference&lt;/td&gt;
&lt;td&gt;Distributed preprocessing and inference-heavy workloads&lt;/td&gt;
&lt;td&gt;Cluster operation, partitioning, task implementation, data contracts&lt;/td&gt;
&lt;td&gt;Requires a separate distributed test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed generation or labeling service&lt;/td&gt;
&lt;td&gt;Reduced orchestration burden; possible human review&lt;/td&gt;
&lt;td&gt;Acceptance criteria, privacy review, auditing, export guarantees&lt;/td&gt;
&lt;td&gt;Requires a specific service quote and trial&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would not select Ray solely because the final dataset is large. Distribution adds its own deployment gates, covered in our &lt;a href="https://dev.to/articles/openshift-ai-ray-data-distributed-rag-2026"&gt;OpenShift AI and Ray Data review&lt;/a&gt;. The first step is identifying whether inference, scoring, storage, or deduplication is actually limiting progress.&lt;/p&gt;

&lt;p&gt;For budgeting, we use:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
C_{\text{accepted}} =&lt;br&gt;
\frac{C_{\text{evolution}} + C_{\text{response}} + C_{\text{judge}}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C_{\text{retry}} + C_{\text{compute}} + C_{\text{review}}}
{N_{\text{accepted}}}
]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That denominator is the business metric. Cost per generated row can look excellent while aggressive filtering makes the accepted dataset expensive.&lt;/p&gt;

&lt;p&gt;Here is an explicitly hypothetical break-even calculation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10,000 candidates;&lt;/li&gt;
&lt;li&gt;2,000 input and 700 output tokens per candidate across all model stages;&lt;/li&gt;
&lt;li&gt;assumed prices of $1 per million input tokens and $4 per million output tokens;&lt;/li&gt;
&lt;li&gt;10% additional token expenditure from retries;&lt;/li&gt;
&lt;li&gt;60% final acceptance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Base model cost is $48: $20 input plus $28 output. The assumed retry overhead raises it to $52.80. With 6,000 accepted examples, model cost is &lt;strong&gt;$0.0088 per accepted example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Add an assumed $1,200 for engineering, compute, and review: the total becomes &lt;strong&gt;$0.2088 per accepted example&lt;/strong&gt;. These are planning assumptions, not observed prices or performance.&lt;/p&gt;

&lt;p&gt;For a simplified manual alternative costing $2 per accepted example, automation breaks even at approximately:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
N = \frac{1200}{2 - 0.0088} \approx 603&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;That comparison assumes equal utility and treats the $1,200 as fixed campaign overhead. If synthetic examples require substantial per-example review or deliver weaker training value, the break-even point moves. We would compare downstream performance and review time before declaring a saving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;Our verdict is &lt;strong&gt;conditional adoption for a bounded pilot, not production approval&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We see a sensible abstraction for teams that need repeatable generation, feedback, and dataset export. We also see unresolved evidence requirements: no completed installation in our environment, no reproduced public workflow, no retry characterization, and no measured dedup throughput.&lt;/p&gt;

&lt;p&gt;We would deploy a pilot if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can pin a release and maintain the dependency lock.&lt;/li&gt;
&lt;li&gt;Every candidate has stable identity and an explicit terminal outcome.&lt;/li&gt;
&lt;li&gt;We can validate scores against a human-reviewed sample.&lt;/li&gt;
&lt;li&gt;We budget evolution, generation, judging, retries, and rejected rows.&lt;/li&gt;
&lt;li&gt;We test deduplication on domain-specific positive and negative pairs.&lt;/li&gt;
&lt;li&gt;We can rerun a shard without silently creating duplicate training records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would hold off if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need exactly-once external calls without additional controls.&lt;/li&gt;
&lt;li&gt;We intend to treat perplexity as factual validation.&lt;/li&gt;
&lt;li&gt;We lack an acceptance dataset or downstream evaluation.&lt;/li&gt;
&lt;li&gt;We require measured production capacity before committing infrastructure.&lt;/li&gt;
&lt;li&gt;A small script already meets our reliability and maintenance requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Maintenance ownership also affects our decision. During our repository review, we identified a maintenance handoff: the original authors had moved on, and community collaborators had taken on maintenance while working toward the next release. We would assess release cadence, review relevant fixes, and retain a rollback path rather than equating available code with a support commitment.&lt;/p&gt;

&lt;p&gt;Our next approval milestone is concrete: install a pinned release, reproduce a small end-to-end workflow, run the batch-boundary regression, inject provider failures, and measure duplicate-detection quality alongside throughput. Until then, the &lt;a href="https://github.com/argilla-io/distilabel/" rel="noopener noreferrer"&gt;official repository&lt;/a&gt; and &lt;a href="https://github.com/fikreab-s/synth-data-distilabel-pipeline/tree/main" rel="noopener noreferrer"&gt;public reference workflow&lt;/a&gt; are starting points—not substitutes for that qualification work.&lt;/p&gt;

&lt;p&gt;Distilabel may reduce orchestration effort. We would deploy it only when the accepted dataset, rather than the successful pipeline run, is what our tests certify.&lt;/p&gt;

</description>
      <category>distilabel</category>
      <category>syntheticdata</category>
      <category>dataquality</category>
      <category>mlops</category>
    </item>
    <item>
      <title>Docker MCP Gateway: Secret Isolation and Production Boundaries</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Thu, 26 Nov 2026 00:37:39 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/docker-mcp-gateway-secret-isolation-and-production-boundaries-p4i</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/docker-mcp-gateway-secret-isolation-and-production-boundaries-p4i</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated Docker MCP Gateway
&lt;/h2&gt;

&lt;p&gt;The production problem we wanted to address was credential sprawl, not MCP connectivity. Once several engineering teams connect multiple AI clients to overlapping tools, configuration becomes an access-control problem: which client holds which token, which servers can start, and who notices when an agent adds another integration?&lt;/p&gt;

&lt;p&gt;A boundary, not a guarantee&lt;/p&gt;
&lt;p&gt;The gateway scopes credentials and centralizes server selection, but enforcement remains untested in a pinned release and local configuration is trusted.&lt;/p&gt;

&lt;p&gt;Docker MCP Gateway gives us a potentially useful consolidation point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MCP client → Gateway → Enabled MCP servers → External services
                         ↑
                  Scoped credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We configure clients to reach the gateway instead of independently launching every backend. The gateway manages server lifecycle, routing, credentials, and access configuration. For containerized servers, that also moves execution away from an ordinary host process and into a Docker-managed boundary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our assessment is source-verified, not runtime-verified.&lt;/strong&gt; We reviewed the security contract and setup paths, but our review environment lacked both a Docker runtime and a pinned gateway binary. We did not execute the isolation tests below. We would rather publish a reproducible acceptance plan than manufacture a successful deployment narrative.&lt;/p&gt;

&lt;p&gt;Our architectural conclusion is nevertheless clear: &lt;strong&gt;the gateway is a useful enforcement location, but not a substitute for endpoint administration, credential authorization, or application-level permissions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We anchored that conclusion in the &lt;a href="https://github.com/docker/mcp-gateway/blob/main/docs/security.md" rel="noopener noreferrer"&gt;gateway security model&lt;/a&gt;. Its trusted base includes the local OS user, Docker daemon, Desktop components, credential store, configured interceptors, and local MCP configuration. We therefore do not treat a developer-controlled profile as an organization-wide policy boundary.&lt;/p&gt;

&lt;p&gt;We also separate two products before discussing deployment. The open-source gateway can run locally; &lt;strong&gt;MCP Gateway as part of Docker AI Governance is invite-only&lt;/strong&gt;. We cannot infer enterprise policy enforcement, audit retention, or administrative controls from the local CLI. We use the &lt;a href="https://docs.docker.com/ai/mcp-catalog-and-toolkit/mcp-gateway/" rel="noopener noreferrer"&gt;gateway setup guide&lt;/a&gt; to keep that distinction explicit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Planned Setup and Isolation Tests
&lt;/h2&gt;

&lt;p&gt;Our first setup decision is Desktop versus standalone Engine.&lt;/p&gt;

&lt;p&gt;For Desktop, we would use 4.62 or later to match the current &lt;a href="https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit" rel="noopener noreferrer"&gt;MCP Toolkit interface guide&lt;/a&gt;. We identified Desktop 4.59+ with MCP Toolkit enabled as the prerequisite for the Desktop installation path, but we would use 4.62+ to follow the current UI instructions.&lt;/p&gt;

&lt;p&gt;For Engine without Desktop, we would install an OS- and architecture-matched release binary as the Docker CLI plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p &lt;span class="s2"&gt;"$HOME/.docker/cli-plugins"&lt;/span&gt;

&lt;span class="c"&gt;# Download and verify a selected release binary first.&lt;/span&gt;
&lt;span class="c"&gt;# Set MCP_BINARY to its local path before running these commands.&lt;/span&gt;
: &lt;span class="s2"&gt;"${MCP_BINARY:?Set MCP_BINARY to the downloaded gateway binary}"&lt;/span&gt;
install -m 0755 &lt;span class="s2"&gt;"$MCP_BINARY"&lt;/span&gt; &lt;span class="s2"&gt;"$HOME/.docker/cli-plugins/docker-mcp"&lt;/span&gt;

docker version
docker mcp version
docker mcp gateway run --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We require an explicit release choice: the reviewed security model follows a moving &lt;code&gt;main&lt;/code&gt; branch, and the sources we reviewed do not establish which released binary implements every listed protection. Our rollout record must contain the actual binary version, checksum, and matching security-model revision.&lt;/p&gt;

&lt;h3&gt;
  
  
  A runnable profile preflight
&lt;/h3&gt;

&lt;p&gt;The following Bash example uses the documented profile workflow. It requires Docker, the plugin, registry connectivity, and a fresh profile name. It does not require a live GitHub token because it stops at configuration inspection rather than invoking a backend tool.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

&lt;span class="nv"&gt;PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"effloow-boundary-review"&lt;/span&gt;

&lt;span class="c"&gt;# For standalone Engine, bypass Desktop-specific feature checks.&lt;/span&gt;
&lt;span class="c"&gt;# Leave MCP_ENGINE_ONLY unset when using Docker Desktop normally.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"${MCP_ENGINE_ONLY:-0}"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;DOCKER_MCP_IN_CONTAINER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
  docker mcp feature &lt;span class="nb"&gt;enable&lt;/span&gt; profiles
&lt;span class="k"&gt;fi&lt;/span&gt;

docker version
docker mcp version

docker mcp catalog pull mcp/docker-mcp-catalog

docker mcp profile create \
  --name &lt;span class="s2"&gt;"$PROFILE"&lt;/span&gt; \
  --server catalog://mcp/docker-mcp-catalog/github

docker mcp profile tools &lt;span class="s2"&gt;"$PROFILE"&lt;/span&gt; --disable-all github
docker mcp profile show &lt;span class="s2"&gt;"$PROFILE"&lt;/span&gt;

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'\nPreflight complete: profile created; GitHub tools disabled.\n'&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'Next: inspect the server and explicitly enable approved tools.\n'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative output—not captured from an execution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Docker daemon and plugin version details]
[Catalog retrieval progress]
[Profile creation and tool configuration details]

Preflight complete: profile created; GitHub tools disabled.
Next: inspect the server and explicitly enable approved tools.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We avoid inventing exact vendor output. The final two lines are produced by the script; preceding messages vary by release.&lt;/p&gt;

&lt;p&gt;For a disposable test machine, we would remove the profile afterward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker mcp profile remove effloow-boundary-review
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the actual isolation exercise, we would replace the GitHub integration with two reviewed local container servers. Our fixture specification is intentionally simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server A declares only &lt;code&gt;SERVER_A_TOKEN&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Server B declares only &lt;code&gt;SERVER_B_TOKEN&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Each exposes a probe returning booleans for selected environment-variable presence, never raw credentials.&lt;/li&gt;
&lt;li&gt;Neither receives host mounts.&lt;/li&gt;
&lt;li&gt;Each exposes a harmless counter tool so we can distinguish rejection before execution from filtering afterward.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would populate dummy credentials through the selected backend, checking &lt;code&gt;docker mcp secret --help&lt;/code&gt; for Desktop usage. For Engine-only testing, the gateway also supports a &lt;code&gt;.env&lt;/code&gt; secrets source through &lt;code&gt;--secrets&lt;/code&gt;. We would keep that file outside the repository with restrictive permissions and use only disposable values.&lt;/p&gt;

&lt;p&gt;We do not include speculative catalog YAML: the sources we reviewed do not establish a complete fixture schema for a pinned release. Building the fixture from that release’s examples is an explicit prerequisite, not an invisible completed step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting the client
&lt;/h3&gt;

&lt;p&gt;After approving tools and configuring the fixture, our client launch configuration would use the explicit profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"servers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"MCP_DOCKER"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"docker"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"gateway"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"run"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"--profile"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"effloow-boundary-review"&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"stdio"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the &lt;code&gt;servers&lt;/code&gt; object for a VS Code-style MCP configuration; other clients have different enclosing formats. We do not place backend credentials in this client entry.&lt;/p&gt;

&lt;p&gt;Our release-acceptance matrix would be:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Probe&lt;/th&gt;
&lt;th&gt;Required behavior&lt;/th&gt;
&lt;th&gt;Status in this review&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Export an unrelated sentinel in the launching shell&lt;/td&gt;
&lt;td&gt;Neither server inherits it automatically&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resolve A’s declared credential&lt;/td&gt;
&lt;td&gt;A receives its authorized credential&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ask A to access B’s undeclared credential&lt;/td&gt;
&lt;td&gt;No cross-server resolution&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call a disabled tool by known name&lt;/td&gt;
&lt;td&gt;Rejected without backend execution&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Request an unapproved server through dynamic discovery&lt;/td&gt;
&lt;td&gt;Cannot expand beyond the intended policy&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Send a sentinel argument and inspect default call logs&lt;/td&gt;
&lt;td&gt;No raw argument keys or values&lt;/td&gt;
&lt;td&gt;Not executed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We would test both capability discovery and direct invocation. A hidden tool is not necessarily an inaccessible tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review Limitations and Deployment Risks
&lt;/h2&gt;

&lt;p&gt;The immediate roadblock in our review was environmental: without Docker and a pinned binary, we could not establish actual enforcement. That is a limitation of our assessment, not a gateway defect.&lt;/p&gt;

&lt;p&gt;The more consequential issues emerged when we translated the security model into deployment requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Secret scoping ends where authorized server access begins
&lt;/h3&gt;

&lt;p&gt;We read secret isolation as a restriction on credential delivery: a server should receive only secrets declared for it. We do &lt;strong&gt;not&lt;/strong&gt; interpret it as protection from a server intentionally authorized to use a powerful credential.&lt;/p&gt;

&lt;p&gt;If we give a malicious server a repository token, it can abuse that token within its granted permissions. Response filtering cannot reverse an external API action.&lt;/p&gt;

&lt;p&gt;We would also test exact, wildcard-like, and malformed secret-name lookups. We include secret-name validation in our acceptance criteria, but we have not verified resolver behavior in a particular release.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--block-secrets&lt;/code&gt; is enabled by default and scans tool arguments and text responses for secret-like values. We treat that as defense in depth, not comprehensive data-loss prevention. Detection patterns, false positives, and coverage of transformed or non-text data remain unmeasured here.&lt;/p&gt;

&lt;h3&gt;
  
  
  A profile is not automatically an immutable allowlist
&lt;/h3&gt;

&lt;p&gt;We distinguish three controls:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Server selection:&lt;/strong&gt; which backends belong to the selected profile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool selection:&lt;/strong&gt; which operations those backends expose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration authority:&lt;/strong&gt; who can change either selection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Toolkit supports dynamic discovery and adding servers during conversations. For a controlled rollout, we must verify that these paths cannot broaden the intended server set.&lt;/p&gt;

&lt;p&gt;We would exercise direct calls, dynamic execution, &lt;code&gt;mcp-exec&lt;/code&gt;, and code-mode paths where supported. We require consistent policy enforcement across these paths before approval; we have not yet verified that consistency in a pinned release.&lt;/p&gt;

&lt;p&gt;A developer who can edit trusted local configuration remains outside this boundary. We would not sell a local profile as centrally enforced enterprise governance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Container isolation does not mean denied network access
&lt;/h3&gt;

&lt;p&gt;Our biggest configuration warning is straightforward: &lt;strong&gt;network egress is not globally denied by default&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We would evaluate &lt;code&gt;disableNetwork&lt;/code&gt;, &lt;code&gt;allowHosts&lt;/code&gt;, and &lt;code&gt;--block-network&lt;/code&gt; for tighter restrictions, testing allowed and forbidden destinations separately rather than interpreting a flag name as proof of complete egress denial.&lt;/p&gt;

&lt;p&gt;Remote MCP destination restrictions are a separate control. The default remote-URL boundary requires public HTTPS and rejects private, loopback, link-local, and metadata-service destinations, including redirect checks. The development opt-out, &lt;code&gt;DOCKER_MCP_ALLOW_INSECURE_REMOTE_URLS=1&lt;/code&gt;, must not become a permanent production workaround.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client separation is not tenant separation
&lt;/h3&gt;

&lt;p&gt;We prefer stdio for the initial local rollout because it is local to the launching client.&lt;/p&gt;

&lt;p&gt;For SSE or streaming HTTP, we would retain default Bearer-token authentication, supplying the token through &lt;code&gt;MCP_GATEWAY_AUTH_TOKEN&lt;/code&gt; or allowing the gateway to generate it. The gateway restricts browser origins to localhost. Requests without &lt;code&gt;Origin&lt;/code&gt; remain acceptable for non-browser clients, but that does not remove token authentication. &lt;code&gt;/health&lt;/code&gt; is intentionally unauthenticated.&lt;/p&gt;

&lt;p&gt;We would test those behaviors independently. We would not treat a shared gateway token as evidence of per-user authorization or tenant isolation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Defaults need release-level verification
&lt;/h3&gt;

&lt;p&gt;Our release checks would cover &lt;code&gt;no-new-privileges&lt;/code&gt;, configured resource limits, no automatic host-environment inheritance, and bind-mount validation. Host binds default to read-only; writable binds require exact allowlist entries.&lt;/p&gt;

&lt;p&gt;We would retain default signature verification for Docker Hub &lt;code&gt;mcp/&lt;/code&gt; images and use digest references while verification is enabled. Third-party images do not gain Docker MCP signature trust merely by appearing in our configuration.&lt;/p&gt;

&lt;p&gt;Our deployment response is to inspect actual container settings and reject unexplained differences. We would not disable verification or broaden mount allowlists merely to make a first launch succeed.&lt;/p&gt;

&lt;p&gt;For workloads requiring a different isolation boundary, we would revisit the trade-offs in &lt;a href="https://dev.to/articles/firecracker-microvm-agent-code-execution-isolation-2026"&gt;Firecracker Agent Sandboxes&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We have no measured gateway latency, throughput, cold-start distribution, or resident-memory results. We therefore cannot recommend a production concurrency target.&lt;/p&gt;

&lt;p&gt;We can identify what needs measurement. The gateway may start a backend when its tool is first requested, so our benchmark must separate cold launch from warm calls. A shared gateway also concentrates operational dependencies: configuration errors, credential resolution, and gateway restarts can affect several clients.&lt;/p&gt;

&lt;p&gt;We use &lt;strong&gt;1 CPU and 2 GB per MCP server&lt;/strong&gt; as the default configured limits in our planning, not as observed resource consumption or reservations.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Why we would choose it&lt;/th&gt;
&lt;th&gt;Boundary we still own&lt;/th&gt;
&lt;th&gt;Main operating cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Direct client-to-server setup&lt;/td&gt;
&lt;td&gt;Small, trusted tool set&lt;/td&gt;
&lt;td&gt;Per-client credentials and execution configuration&lt;/td&gt;
&lt;td&gt;Repeated onboarding and rotation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local Docker MCP Gateway&lt;/td&gt;
&lt;td&gt;Shared local configuration and credential brokering&lt;/td&gt;
&lt;td&gt;Trusted endpoint, profiles, mounts, egress&lt;/td&gt;
&lt;td&gt;Packaging and policy regression tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom MCP proxy and runner&lt;/td&gt;
&lt;td&gt;Specialized identity or policy requirements&lt;/td&gt;
&lt;td&gt;Routing, lifecycle, secret scoping, isolation&lt;/td&gt;
&lt;td&gt;Implementation and security maintenance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker AI Governance offering&lt;/td&gt;
&lt;td&gt;Candidate for centrally managed requirements&lt;/td&gt;
&lt;td&gt;Controls requiring separate evaluation&lt;/td&gt;
&lt;td&gt;Commercial terms and integration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We have not evaluated the invite-only offering, and we have no basis for assigning it a price or verified capability advantage.&lt;/p&gt;

&lt;p&gt;Our break-even model is operational rather than compute-driven. As an &lt;strong&gt;illustrative assumption&lt;/strong&gt;, suppose 12 developers each use three clients. If consolidating backend configuration saves 15 minutes per client each month, that is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12 developers × 3 clients × 0.25 hours = 9 hours/month
9 hours × $100/hour = $900/month of engineering time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If gateway maintenance takes four hours monthly at the same loaded rate, the modeled benefit is $500 per month before infrastructure, licensing, and incident costs.&lt;/p&gt;

&lt;p&gt;Those are planning inputs, not measured savings. A team with one client and two stable tools may not recover the maintenance cost. A team repeatedly rotating credentials across many clients has a stronger case.&lt;/p&gt;

&lt;p&gt;For shared deployment, our load gate would include simultaneous sessions, backend crashes, restart recovery, and p95 cold versus warm latency. We would also measure whether policy checks add meaningful overhead relative to external tool execution. The same separation of routing behavior from backend behavior informs our &lt;a href="https://dev.to/articles/litellm-proxy-failover-routing-production-benchmark-2026"&gt;LiteLLM Proxy Failover review&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We would approve a controlled local pilot—not an unqualified production rollout.&lt;/strong&gt; The architecture addresses a real problem: reducing per-client credential configuration and putting backend selection behind one gateway. Our remaining uncertainty is enforcement in a pinned release, not whether centralization can be useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy a pilot if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We control the endpoint and trust its Docker daemon and local administrator.&lt;/li&gt;
&lt;li&gt;We can pin the plugin, server images, and reviewed configuration.&lt;/li&gt;
&lt;li&gt;We can restrict both servers and tools, including dynamic execution paths.&lt;/li&gt;
&lt;li&gt;We can use narrow credentials and avoid unnecessary mounts.&lt;/li&gt;
&lt;li&gt;We can run negative tests before distributing the setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hold off or choose another boundary if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need verified hostile-tenant isolation on a shared service.&lt;/li&gt;
&lt;li&gt;We expect secret scanning to prevent every form of exfiltration.&lt;/li&gt;
&lt;li&gt;We need centrally enforced policy against users who control local configuration.&lt;/li&gt;
&lt;li&gt;We need established concurrency, recovery, or latency guarantees immediately.&lt;/li&gt;
&lt;li&gt;We are depending on invite-only governance capabilities we have not evaluated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our next step would be a disposable Docker host, two minimal probe servers, and the acceptance matrix above. We would retain versions, container inspection output, and negative-test transcripts as release evidence.&lt;/p&gt;

&lt;p&gt;We would start with the &lt;a href="https://github.com/docker/mcp-gateway/blob/main/docs/security.md" rel="noopener noreferrer"&gt;open-source security model&lt;/a&gt;, follow the &lt;a href="https://docs.docker.com/ai/mcp-catalog-and-toolkit/mcp-gateway/" rel="noopener noreferrer"&gt;gateway installation path&lt;/a&gt;, and use the &lt;a href="https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit" rel="noopener noreferrer"&gt;Toolkit guide&lt;/a&gt; for the matching Desktop version. Our deployment decision would follow the observed boundary—not the presence of a gateway in the diagram.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>mcp</category>
      <category>security</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>LiteLLM Proxy Failover: Latency, Retries, and Production Risk</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Tue, 24 Nov 2026 00:35:50 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/litellm-proxy-failover-latency-retries-and-production-risk-1pfo</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/litellm-proxy-failover-latency-retries-and-production-risk-1pfo</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated LiteLLM Failover
&lt;/h2&gt;

&lt;p&gt;The gateway failure we worry about most is not a visible 503. It is a successful response that arrives after the application has abandoned the request, while retries continue consuming connections and upstream capacity.&lt;/p&gt;

&lt;p&gt;LiteLLM promises to handle routing between our application and multiple model providers. Underneath its OpenAI-compatible interface, the router selects deployments, retries eligible failures, applies cooldowns, and moves requests through configured fallback model groups.&lt;/p&gt;

&lt;p&gt;That distinction matters: &lt;strong&gt;fallback is not necessarily the first response to failure. It follows retry handling.&lt;/strong&gt; A generous retry policy can turn an available backup into a destination reached too late.&lt;/p&gt;

&lt;p&gt;Our review asks whether we would put that mechanism on a production request path. We examined the official fallback configuration, the published full-feature benchmark, the Pfizer resilience investigation, and a separate 30-day gateway field report.&lt;/p&gt;

&lt;p&gt;One boundary is important upfront: &lt;strong&gt;we did not execute a pinned LiteLLM installation for this review.&lt;/strong&gt; The walkthrough below is a runnable reproduction candidate, not a completed benchmark. We cannot honestly supply our own measured switching latency, error rate, or retry count. We keep external measurements attributed and separate from our calculations.&lt;/p&gt;

&lt;p&gt;Our architectural conclusion is nevertheless actionable: LiteLLM is a credible routing layer, but its production acceptance test must include deadlines, attempted upstream calls, and unaffected traffic—not just final HTTP status.&lt;/p&gt;

&lt;p&gt;We apply the same distinction between routing capability and deployment readiness in our &lt;a href="https://dev.to/articles/llm-d-v1-kubernetes-inference-gateway-production-benchmark-2026"&gt;llm-d production review&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We designed the reproduction around two local OpenAI-compatible endpoints. The primary returns a real HTTP 503; the backup returns a valid completion. No provider credentials or paid inference are needed.&lt;/p&gt;

&lt;p&gt;The proxy installation command is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv .venv
. .venv/bin/activate
python -m pip install &lt;span class="s1"&gt;'litellm[proxy]'&lt;/span&gt;
python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.observed.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The quotes protect the extras syntax from shell expansion. The supplied source material does not independently verify the installation page or a compatible package pin, so this command is a bootstrap path—not a reproducibility lock. Before accepting results, we would rebuild from a tested lockfile and record Python, LiteLLM, OpenAI SDK, and HTTP-client versions.&lt;/p&gt;

&lt;p&gt;For configuration, we use the model-group fallback shape in the &lt;a href="https://docs.litellm.ai/docs/proxy/reliability" rel="noopener noreferrer"&gt;official reliability guide&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# config.yaml
&lt;/span&gt;&lt;span class="na"&gt;model_list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;model_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;primary&lt;/span&gt;
    &lt;span class="na"&gt;litellm_params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openai/gpt-4o-mini&lt;/span&gt;
      &lt;span class="na"&gt;api_base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://127.0.0.1:8101/v1&lt;/span&gt;
      &lt;span class="na"&gt;api_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-only&lt;/span&gt;
      &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;model_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;backup&lt;/span&gt;
    &lt;span class="na"&gt;litellm_params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openai/gpt-4o-mini&lt;/span&gt;
      &lt;span class="na"&gt;api_base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://127.0.0.1:8102/v1&lt;/span&gt;
      &lt;span class="na"&gt;api_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-only&lt;/span&gt;
      &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="na"&gt;router_settings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;routing_strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;simple-shuffle&lt;/span&gt;
  &lt;span class="na"&gt;num_retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="na"&gt;allowed_fails&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;cooldown_time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
  &lt;span class="na"&gt;fallbacks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;backup&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;general_settings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;master_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sk-local-test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Different aliases make the fallback transition explicit. Two deployments sharing one alias would instead introduce within-group selection into the experiment.&lt;/p&gt;

&lt;p&gt;Save this standard-library mock as &lt;code&gt;mock.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;BaseHTTPRequestHandler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ThreadingHTTPServer&lt;/span&gt;

&lt;span class="no"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"PORT"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;STATUS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"STATUS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"200"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;DELAY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"DELAY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"NAME"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BaseHTTPRequestHandler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_POST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rfile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Content-Length"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;request_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monotonic_ns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"endpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"request_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;request_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;DELAY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;STATUS&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"chatcmpl-local"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"object"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"chat.completion"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"created"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"choices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="s2"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"assistant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"finish_reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"stop"&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="s2"&gt;"prompt_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"completion_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"total_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Injected outage"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"server_error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"service_unavailable"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STATUS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Content-Length"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end_headers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wfile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"end"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"endpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"request_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;request_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"ns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monotonic_ns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;STATUS&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;log_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;


&lt;span class="nc"&gt;ThreadingHTTPServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;serve_forever&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the endpoints and proxy in separate terminals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8101 &lt;span class="nv"&gt;STATUS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;503 &lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;primary python mock.py &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; primary.jsonl
&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8102 &lt;span class="nv"&gt;STATUS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;200 &lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;backup python mock.py &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; backup.jsonl
litellm --config config.yaml --host 127.0.0.1 --port 4000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then send a request without SDK-level retries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --silent --show-error --max-time 15 \
  --write-out &lt;span class="s1"&gt;'\nhttp=%{http_code} total_seconds=%{time_total}\n'&lt;/span&gt; \
  http://127.0.0.1:4000/v1/chat/completions \
  -H &lt;span class="s1"&gt;'Authorization: Bearer sk-local-test'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "primary",
    "messages": [{"role": "user", "content": "probe-0001"}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;strong&gt;simulated successful response excerpt&lt;/strong&gt;, not captured test output, looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"object"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"chat.completion"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"choices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"assistant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"backup"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"finish_reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"stop"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response proves little without the endpoint logs. We would calculate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client recovery latency:&lt;/strong&gt; request submission to completed fallback response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch gap:&lt;/strong&gt; backup request start minus the final primary response-end timestamp. This is a same-host approximation, not an internal router span.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attempt amplification:&lt;/strong&gt; all upstream request starts divided by submitted client requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client error rate:&lt;/strong&gt; failed requests divided by submitted requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deadline-miss rate:&lt;/strong&gt; requests exceeding the application deadline, including late HTTP 200 responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The switch gap can be slightly negative because a server-side log after writing a response can lag client receipt. For precise routing attribution, we would add gateway spans.&lt;/p&gt;

&lt;p&gt;Our execution matrix starts with a healthy primary, then disables fallback during a primary failure, then enables fallback. We would repeat with zero and two retries, immediate 503s, 429s, and a primary delayed beyond its attempt timeout.&lt;/p&gt;

&lt;p&gt;We would restart the proxy between cold-state runs, then run a separate continuous-outage sequence to observe cooldown behavior. A second request must not be assumed to skip the primary merely because the first failed.&lt;/p&gt;

&lt;p&gt;For load testing, we would add fixed-rate arrivals and explicitly count missed submissions. A sequential curl loop cannot establish capacity or tail latency.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Could Not Verify and Other Limitations
&lt;/h2&gt;

&lt;p&gt;Our review lacked execution evidence: no verified package lock, no local run, and no captured attempt traces. We would not replace those gaps with plausible-looking millisecond numbers.&lt;/p&gt;

&lt;p&gt;The configuration and production evidence highlight several additional risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Synthetic fallback flags are not a proxy fault injector.&lt;/strong&gt; For our proxy test design, we account for a version-specific constraint: starting with Proxy v1.85.0, incoming &lt;code&gt;mock_testing_fallbacks&lt;/code&gt;, &lt;code&gt;mock_testing_context_fallbacks&lt;/code&gt;, and &lt;code&gt;mock_testing_content_policy_fallbacks&lt;/code&gt; are stripped and have no effect. Our reproduction therefore uses actual upstream HTTP failures. A direct Router unit test and a proxy request do not exercise identical boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retries are a budget, not an attempt guarantee.&lt;/strong&gt; Two retries may suggest three primary attempts, but cooldown, deployment availability, error classification, and overrides can change what reaches the endpoint. We count observed calls rather than infer them from YAML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per-attempt timeouts are not an end-to-end deadline.&lt;/strong&gt; As an illustrative calculation, three primary attempts each consuming two seconds, followed by a two-second backup attempt, could consume eight seconds before backoff and overhead. That is not measured LiteLLM behavior or a universal upper bound. It is why we require explicit deadline budgeting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A clean error graph can conceal lost capacity.&lt;/strong&gt; In the &lt;a href="https://docs.litellm.ai/blog/pfizer-gateway-performance-and-resiliency" rel="noopener noreferrer"&gt;joint Pfizer/LiteLLM investigation&lt;/a&gt;, we find a particularly relevant warning: CI throughput moved from roughly 300 RPS to 156 RPS during upgrade validation, without an increased HTTP error rate.&lt;/p&gt;

&lt;p&gt;In our review of the regression, we traced the failure mechanism to Redis TLS selection: checking whether &lt;code&gt;ssl&lt;/code&gt; existed instead of whether it was true. With &lt;code&gt;ssl: false&lt;/code&gt; against plaintext Redis, best-effort cache operations could stall on the default five-second socket timeout and still let the request return HTTP 200.&lt;/p&gt;

&lt;p&gt;We identified PR #32590, shipped in v1.93.0, as the Redis fix boundary for our release checks. We would verify that fix in the selected release and dependencies rather than treat a version number as sufficient assurance. This regression was caught in CI, not evidence of a provider-failover outage in Pfizer production. Its fallback fault-injection work was still listed as work in progress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming requires a separate contract.&lt;/strong&gt; We would test failures before headers, before first content, and after partial output. Once the application consumes generated text, restarting elsewhere is not equivalent to transparently replaying an untouched request.&lt;/p&gt;

&lt;p&gt;Cross-provider fallback also changes semantics. We treat encrypted reasoning as a fallback compatibility constraint: a target on another provider or API key cannot decrypt the earlier deployment's encrypted reasoning. During fallback, incompatible encrypted content is dropped; readable Responses reasoning summaries are retained, while incompatible thinking blocks are dropped whole. Schema support, tool calling, context capacity, residency, and output quality also need explicit acceptance tests.&lt;/p&gt;

&lt;p&gt;Finally, the local configuration excludes Redis, budgets, callbacks, and spend persistence. Passing it would establish a narrow routing contract—not production readiness. We would add those dependencies incrementally, following the same observability discipline discussed in our &lt;a href="https://dev.to/articles/langfuse-clickhouse-ingestion-sizing-cost-2026"&gt;Langfuse ingestion review&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We keep two evidence sets separate.&lt;/p&gt;

&lt;p&gt;In our analysis of &lt;a href="https://docs.litellm.ai/blog/better-benchmarks" rel="noopener noreferrer"&gt;full-feature gateway performance&lt;/a&gt;, we keep the test conditions explicit: mock upstreams, four dedicated cores, 16 GiB per gateway, and one run per configuration. Routing uses simple-shuffle, two retries, three allowed fails, and a 30-second cooldown.&lt;/p&gt;

&lt;p&gt;Under those conditions, we identify Python overload as a capacity warning: the gateway served 78.9% of requests at 75 RPS and 29.3% at 100 RPS. Those are workload-specific overload observations, not universal LiteLLM capacity limits. Enabling retries in a benchmark does not establish provider-down switching performance.&lt;/p&gt;

&lt;p&gt;The Rust implementation in that article is a benchmark branch, with a fast path expected December 1. At this article's November 24 publication date, we would not treat those branch results as guaranteed performance from a pip-installed Python proxy.&lt;/p&gt;

&lt;p&gt;For our separate &lt;a href="https://dev.to/marcuswwchen/measuring-ai-gateway-failover-30-days-of-production-data-336k"&gt;30-day workload comparison&lt;/a&gt;, we examine the following measurements rather than treat them as results from our unexecuted local harness:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gateway&lt;/th&gt;
&lt;th&gt;Reported p50 overhead&lt;/th&gt;
&lt;th&gt;Reported p99 overhead&lt;/th&gt;
&lt;th&gt;Reported provider-down failover&lt;/th&gt;
&lt;th&gt;Reported memory at 1k RPS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;LiteLLM&lt;/td&gt;
&lt;td&gt;8 ms&lt;/td&gt;
&lt;td&gt;41 ms&lt;/td&gt;
&lt;td&gt;620 ms&lt;/td&gt;
&lt;td&gt;890 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bifrost&lt;/td&gt;
&lt;td&gt;3 ms&lt;/td&gt;
&lt;td&gt;11 ms&lt;/td&gt;
&lt;td&gt;180 ms&lt;/td&gt;
&lt;td&gt;412 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Portkey, self-hosted&lt;/td&gt;
&lt;td&gt;6 ms&lt;/td&gt;
&lt;td&gt;29 ms&lt;/td&gt;
&lt;td&gt;340 ms&lt;/td&gt;
&lt;td&gt;650 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are external, workload-specific observations—not our measurements. For our interpretation, we retain the workload conditions: mirrored traffic, cache disabled, and an OpenAI → Anthropic → Bedrock chain. We could not verify the LiteLLM version, exact fallback YAML, client deadline, or a sufficiently precise definition of “failover time” to reproduce the table.&lt;/p&gt;

&lt;p&gt;We therefore use it to identify candidates, not to rank gateways by their ability to meet our SLOs. We would shortlist Bifrost for a fresh routing-focused comparison, LiteLLM where provider integrations and callbacks matter, and managed offerings where operating the gateway is the larger cost.&lt;/p&gt;

&lt;p&gt;For economics, we separate attempts from billable completions. A rejected 503 is not automatically billed like successful generation.&lt;/p&gt;

&lt;p&gt;Consider this &lt;strong&gt;illustrative monthly planning model&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 million client requests.&lt;/li&gt;
&lt;li&gt;1% require fallback.&lt;/li&gt;
&lt;li&gt;Each affected request makes three primary attempts and one backup attempt.&lt;/li&gt;
&lt;li&gt;Unaffected requests make one attempt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total upstream attempts become:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;9.9 million + (100,000 × 4) = 10.3 million&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That is &lt;strong&gt;1.03× aggregate amplification&lt;/strong&gt;, but &lt;strong&gt;4× for the affected cohort&lt;/strong&gt;. Cooldown can reduce it; layered client retries can increase it.&lt;/p&gt;

&lt;p&gt;If every fallback completion costs an additional $0.002 relative to the primary, that cohort adds $200 in completion cost. We would add any billable abandoned generation separately.&lt;/p&gt;

&lt;p&gt;For a simple build-versus-operate comparison, assume $150/month in gateway infrastructure and six maintenance hours at $150/hour: $1,050/month. A managed alternative at an effective $0.00015 per request costs $1,500 at this volume. These are assumptions, not vendor quotes.&lt;/p&gt;

&lt;p&gt;The arithmetic break-even is seven million requests per month. That comparison excludes initial integration and migration work; it also excludes any managed base fee. Avoiding custom routing code can justify LiteLLM below that threshold, while recurring incident work can erase the apparent self-hosting savings above it.&lt;/p&gt;

&lt;p&gt;Error-budget math is equally unforgiving. At 10 million requests and 99.9% availability, the monthly allowance is 10,000 bad requests. If 100,000 outage-affected requests recover but 20% miss the application deadline, those 20,000 deadline failures consume twice the allowance—even with eventual HTTP 200 responses.&lt;/p&gt;

&lt;p&gt;To measure blast radius, we would run failing-primary traffic beside direct-to-backup traffic and an independent healthy cohort. We would compare each cohort's deadline misses, throughput, queueing, and attempts. Aggregate success rate cannot reveal whether one provider's outage degraded unrelated tenants.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We would deploy LiteLLM when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its provider integrations and callbacks replace meaningful application complexity.&lt;/li&gt;
&lt;li&gt;Every fallback target passes quality, schema, security, and residency checks.&lt;/li&gt;
&lt;li&gt;The application deadline accommodates the measured retry and fallback path.&lt;/li&gt;
&lt;li&gt;Client retries are coordinated with gateway retries.&lt;/li&gt;
&lt;li&gt;Release gates track submitted traffic, completed traffic, deadline misses, and upstream attempts.&lt;/li&gt;
&lt;li&gt;Healthy tenants remain healthy during injected provider outages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold off when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A purchase decision depends on treating the reported 620 ms as a guaranteed failover bound.&lt;/li&gt;
&lt;li&gt;The team cannot reproduce its package and dependency set.&lt;/li&gt;
&lt;li&gt;Streaming recovery is assumed rather than tested.&lt;/li&gt;
&lt;li&gt;The backup shares the primary's constrained quota or failure domain.&lt;/li&gt;
&lt;li&gt;The proposed “high availability” design is one irreplaceable proxy instance.&lt;/li&gt;
&lt;li&gt;Monitoring counts only HTTP errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our verdict is &lt;strong&gt;conditional adoption, not an unconditional performance endorsement&lt;/strong&gt;. LiteLLM offers the right routing primitives, but the supplied evidence does not establish a universal switching-latency SLO or multi-tenant isolation guarantee.&lt;/p&gt;

&lt;p&gt;We would start with the &lt;a href="https://docs.litellm.ai/docs/proxy/reliability" rel="noopener noreferrer"&gt;official fallback guide&lt;/a&gt;, run the two-endpoint contract check, and then add production features and concurrency. For agent workloads, we would also review &lt;a href="https://dev.to/articles/restate-ai-durable-execution-sdk-gotchas-2026"&gt;durable execution and side-effect boundaries&lt;/a&gt;: routing a generation twice must not accidentally become permission to execute a business action twice.&lt;/p&gt;

</description>
      <category>litellm</category>
      <category>aigateways</category>
      <category>failover</category>
      <category>reliability</category>
    </item>
    <item>
      <title>Google ADK on Agent Runtime: Deployment and State Boundaries</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Mon, 23 Nov 2026 00:37:11 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/google-adk-on-agent-runtime-deployment-and-state-boundaries-b71</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/google-adk-on-agent-runtime-deployment-and-state-boundaries-b71</guid>
      <description>&lt;h2&gt;
  
  
  Why We Evaluated Google ADK on Agent Runtime
&lt;/h2&gt;

&lt;p&gt;We brought Google ADK into our review because deploying a multi-agent service introduces an awkward split: the agent code can be small while the operational surface is not. Discovery, credentials, conversation history, durable writes, and deployment readiness all become separate failure domains.&lt;/p&gt;

&lt;p&gt;Evaluate, not standardize yet&lt;/p&gt;
&lt;p&gt;Agent Runtime reduces hosting work, but deployment success, production limits, and economic superiority remain unverified.&lt;/p&gt;

&lt;p&gt;Our question was whether Agent Runtime removes enough of that work to justify adopting its managed session and memory services instead of operating an agent service backed by Redis and Postgres.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our verdict is conditional: Agent Runtime is worth a deployment proof of concept, but we do not have evidence for production performance or cost claims here.&lt;/strong&gt; Our local execution attempt stopped before ADK installation because the &lt;code&gt;python:3.12-slim&lt;/code&gt; image was unavailable. We did not obtain ADK CLI output, deploy an endpoint, or reproduce a managed-service failure. We will not substitute invented transcripts for those missing results.&lt;/p&gt;

&lt;p&gt;What we can provide is a source-grounded architecture review, executable preparation steps, and concrete acceptance gates.&lt;/p&gt;

&lt;p&gt;We used three substantive primary references: the &lt;a href="https://codelabs.developers.google.com/adk-a2a-agent-runtime" rel="noopener noreferrer"&gt;ADK/A2A codelab&lt;/a&gt;, the &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Agent Runtime ADK quickstart&lt;/a&gt;, and the &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/create-an-adk-agent" rel="noopener noreferrer"&gt;ADK agent development guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In our architecture review, we traced the managed deployment path: agent serialization and upload, followed by provisioning of an authenticated A2A endpoint. Managed sessions preserve conversation history and state through &lt;code&gt;VertexAiSessionService&lt;/code&gt;. A remote ADK agent discovers the deployed specialist through its agent card.&lt;/p&gt;

&lt;p&gt;That removes hosting machinery, not application architecture. We still need to decide what constitutes a committed booking, which identity owns a conversation, and whether another session can immediately observe a write.&lt;/p&gt;

&lt;p&gt;We also keep three storage concepts separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Session state:&lt;/strong&gt; structured context used during agent execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Bank:&lt;/strong&gt; cross-session memory functionality that needs its own write and retrieval contract.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business records:&lt;/strong&gt; authoritative data requiring explicit authorization, concurrency control, and retention rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Treating those as interchangeable would be our first production mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-On Walkthrough: Setup, Execution &amp;amp; Output
&lt;/h2&gt;

&lt;p&gt;We start with credential handling. A service-account JSON key is not a prerequisite. For local authentication, we would use Application Default Credentials; in Cloud Shell, we would not need an additional authentication step. We prefer short-lived credentials or workload identity over distributing a long-lived key.&lt;/p&gt;

&lt;p&gt;For the initial setup, we would use &lt;code&gt;roles/aiplatform.user&lt;/code&gt; and &lt;code&gt;roles/storage.admin&lt;/code&gt;. We would not assign those roles indiscriminately to every production identity. We would separate deployment permissions from runtime permissions and narrow access after identifying the actual operations.&lt;/p&gt;

&lt;p&gt;For an isolated environment, the installation path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv .venv
. .venv/bin/activate

python -m pip install --upgrade pip
python -m pip install \
  &lt;span class="s2"&gt;"google-cloud-aiplatform[agent_engines,adk]&amp;gt;=1.112"&lt;/span&gt;

python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.resolved.txt
adk --help
adk create --help
adk web --help
adk api_server --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use &lt;code&gt;&amp;gt;=1.112&lt;/code&gt; as the SDK installation requirement for this preparation path, not as a tested version pin. Our repeatability gate is to preserve the resolved dependencies, Python version, and starter-repository commit together.&lt;/p&gt;

&lt;p&gt;Next, configure a disposable project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GOOGLE_CLOUD_PROJECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-disposable-project"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GOOGLE_CLOUD_LOCATION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"us-central1"&lt;/span&gt;

gcloud config &lt;span class="nb"&gt;set&lt;/span&gt; project &lt;span class="s2"&gt;"$GOOGLE_CLOUD_PROJECT"&lt;/span&gt;
gcloud auth application-default login

gcloud services &lt;span class="nb"&gt;enable&lt;/span&gt; \
  aiplatform.googleapis.com \
  cloudresourcemanager.googleapis.com \
  storage.googleapis.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would scaffold the reservation specialist with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adk create reservation_agent \
  --model gemini-3.5-flash \
  --project &lt;span class="s2"&gt;"$GOOGLE_CLOUD_PROJECT"&lt;/span&gt; \
  --region &lt;span class="s2"&gt;"$GOOGLE_CLOUD_LOCATION"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We retain that model identifier as part of the supplied codelab instructions, not as a model-availability verification. Before spending time debugging agent code, we would verify access to the selected model in the project and its required location.&lt;/p&gt;

&lt;p&gt;The expected generated layout is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reservation_agent/
├── __init__.py
├── agent.py
└── .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For local development, run the UI and API server separately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Run from the parent directory containing reservation_agent.&lt;/span&gt;
adk web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Stop the web process before using the default port again.&lt;/span&gt;
adk api_server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands start local development surfaces; they do not deploy to Agent Runtime. Starting them and executing a model-backed agent are also different tests. The latter still needs model access and credentials.&lt;/p&gt;

&lt;p&gt;We would use the following small probe to capture the API server’s startup readiness. It requires only Python’s standard library and a running local server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# probe_local.py&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;

&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"http://127.0.0.1:8000/openapi.json"&lt;/span&gt;
&lt;span class="n"&gt;started&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monotonic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;specification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;specification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"elapsed_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monotonic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;started&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"local HTTP readiness only"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;URLError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TimeoutError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"local HTTP readiness only"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python probe_local.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative response, not captured output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"openapi"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"3.1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"elapsed_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.012&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"local HTTP readiness only"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That simulated response demonstrates the output format, not ADK performance. A successful OpenAPI fetch proves neither model execution nor persistent sessions.&lt;/p&gt;

&lt;p&gt;For managed deployment, we would keep two paths distinct. We would evaluate the &lt;code&gt;AdkApp&lt;/code&gt; deployment path separately from the A2A path, which adds A2A hosting and remote-agent integration. We would not assume an ordinary &lt;code&gt;AdkApp&lt;/code&gt; deployment automatically validates the A2A path.&lt;/p&gt;

&lt;p&gt;The available excerpts establish deployment architecture but do not include the complete deployment invocation. We therefore cannot present a verified deploy command. Our next execution step is the complete codelab, preserving its deployment script and dependencies rather than improvising a mixture of SDK generations.&lt;/p&gt;

&lt;p&gt;In our setup plan for the full restaurant example, we also account for Cloud SQL and Toolbox infrastructure. We treat the approximately 10–15-minute setup window as an estimate for that broader infrastructure script, not as a measured Agent Runtime deploy-to-first-traffic time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Could Not Verify
&lt;/h2&gt;

&lt;p&gt;The actual failure in our execution attempt was environmental: the Python container image was unavailable. We did not capture the exact Docker stderr. Consequently, we have no reproduced ADK error string to publish.&lt;/p&gt;

&lt;p&gt;The remaining issues below are architecture findings and required tests, not incidents we observed in a running deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  App-scoped state is a risky reservation database
&lt;/h3&gt;

&lt;p&gt;In our review of the reservation implementation, we found &lt;code&gt;app:reservation:&lt;/code&gt; keys indexed by phone number. We treat cross-session persistence as the intended behavior, not as a verified guarantee across backends.&lt;/p&gt;

&lt;p&gt;We would not carry that data model unchanged into a multi-tenant service. App-wide sharing is not tenant authorization, and possession of a phone number is not proof of ownership.&lt;/p&gt;

&lt;p&gt;Our production design would store bookings in Postgres or another transactional database. Session state would hold a booking identifier and limited workflow context. Database constraints would enforce uniqueness; idempotency keys would protect booking creation against retries.&lt;/p&gt;

&lt;p&gt;We would also test state visibility at event boundaries. A Python dictionary assignment is not sufficient evidence that another session can immediately read a committed value.&lt;/p&gt;

&lt;h3&gt;
  
  
  SessionService is an abstraction, not one universal storage contract
&lt;/h3&gt;

&lt;p&gt;Our session lifecycle tests would cover creation, retrieval, listing, deletion, and event appends. We would first identify the supported methods and signatures in the installed ADK version, then run the applicable tests against each selected backend.&lt;/p&gt;

&lt;p&gt;For the managed session path, we would evaluate &lt;code&gt;VertexAiSessionService&lt;/code&gt;. A local implementation accepting a large state object would not establish that the managed service accepts it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We could not verify a numeric session-state payload cap or request quota from the supplied material.&lt;/strong&gt; We therefore cannot responsibly publish a familiar-looking limit or a supposedly reproduced rejection.&lt;/p&gt;

&lt;p&gt;Our acceptance test would measure serialized UTF-8 bytes, increase payload size gradually, and capture the complete managed response. We would distinguish a fixed payload limit from rate quota exhaustion and local serialization errors.&lt;/p&gt;

&lt;p&gt;Regardless of that eventual threshold, documents and large tool results belong in an external artifact store, with references in session state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory Bank needs a separate consistency test
&lt;/h3&gt;

&lt;p&gt;The available excerpts do not establish Memory Bank’s exact SDK method signatures, generation limits, quotas, or write-to-search visibility guarantees. We would not invent an API call from a navigation heading.&lt;/p&gt;

&lt;p&gt;Our required test is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Record a distinctive preference in session A.&lt;/li&gt;
&lt;li&gt;Explicitly initiate the supported memory ingestion or generation operation.&lt;/li&gt;
&lt;li&gt;Track its completion separately from the originating agent response.&lt;/li&gt;
&lt;li&gt;Search from session B using the same authorized user scope.&lt;/li&gt;
&lt;li&gt;Measure time until the expected memory becomes retrievable.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Until that test passes, our application cannot promise immediate cross-session recall. Memory also cannot be the authority for whether a payment or reservation committed.&lt;/p&gt;

&lt;h3&gt;
  
  
  A2A discovery is part of the request path
&lt;/h3&gt;

&lt;p&gt;An agent card describes capabilities and an endpoint. Fetching the card and calling its advertised endpoint are separate network operations.&lt;/p&gt;

&lt;p&gt;Our private-networking test would check DNS, TLS, authentication, routing, and advertised URLs from the orchestrator’s actual runtime identity and network. A card reachable from a developer laptop is not enough.&lt;/p&gt;

&lt;p&gt;We have no reproduced private-network resolution failure here. We would capture the real exception rather than label every discovery problem a DNS error: unauthorized requests, inaccessible hosts, and stale endpoint URLs need different fixes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Runtime and model locations can diverge
&lt;/h3&gt;

&lt;p&gt;In our code review, we identified why the &lt;code&gt;GeminiGlobal&lt;/code&gt; subclass is needed in this setup: &lt;code&gt;A2aAgent.set_up()&lt;/code&gt; overwrites &lt;code&gt;GOOGLE_CLOUD_LOCATION&lt;/code&gt; with the runtime region, while the selected Gemini 3-family endpoint requires &lt;code&gt;global&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our configuration rule is to separate runtime placement from model endpoint selection. We would isolate any workaround involving SDK internals and retest it on upgrades.&lt;/p&gt;

&lt;p&gt;Finally, persistent state does not make side effects exactly-once. We apply the same recovery discipline discussed in our &lt;a href="https://dev.to/articles/restate-ai-durable-execution-sdk-gotchas-2026"&gt;Restate AI review&lt;/a&gt;: retries must be safe at the business-operation boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We have no load-test results, cold-start distribution, memory-footprint measurements, or cloud bill for this evaluation. Our comparison is therefore architectural.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision area&lt;/th&gt;
&lt;th&gt;ADK with managed Runtime and Sessions&lt;/th&gt;
&lt;th&gt;Self-managed LangGraph with Redis/Postgres&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hosting&lt;/td&gt;
&lt;td&gt;Managed agent deployment surface&lt;/td&gt;
&lt;td&gt;Team operates application hosting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session persistence&lt;/td&gt;
&lt;td&gt;Managed backend integration&lt;/td&gt;
&lt;td&gt;Explicit checkpoint and storage design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Business transactions&lt;/td&gt;
&lt;td&gt;Still require suitable business storage&lt;/td&gt;
&lt;td&gt;Can share existing transactional infrastructure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cross-session memory&lt;/td&gt;
&lt;td&gt;Evaluate Memory Bank separately&lt;/td&gt;
&lt;td&gt;Build or integrate a memory pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Private networking&lt;/td&gt;
&lt;td&gt;Validate discovery and invocation from runtime&lt;/td&gt;
&lt;td&gt;Control routing, but own its operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cold starts&lt;/td&gt;
&lt;td&gt;Must measure under actual configuration&lt;/td&gt;
&lt;td&gt;Depends on hosting and replica policy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost evidence here&lt;/td&gt;
&lt;td&gt;No measured unit cost&lt;/td&gt;
&lt;td&gt;No measured baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main trade-off&lt;/td&gt;
&lt;td&gt;Less hosting work; service-contract dependence&lt;/td&gt;
&lt;td&gt;More control; more operational ownership&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Our latency instrumentation would separate deployment completion, endpoint readiness, card discovery, authentication, session access, model generation, and tool execution.&lt;/p&gt;

&lt;p&gt;“First request was slow” would not establish a container cold start. We would need traces connecting that request to instance initialization. We would also separate model latency from runtime overhead and compare equivalent workflows.&lt;/p&gt;

&lt;p&gt;For cost, our useful unit is a &lt;strong&gt;successfully completed business session&lt;/strong&gt;, not an HTTP request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Managed cost per completed session =
  (runtime + sessions + memory + storage + networking
   + observability + allocated operations labor)
  / successful sessions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The self-managed denominator must be identical. Its numerator includes application compute, Redis, Postgres, backups, observability, and operations labor. Model charges should be included consistently or excluded consistently.&lt;/p&gt;

&lt;p&gt;Here is a planning example—not vendor pricing or a measured baseline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Self-managed fixed infrastructure and allocated labor: $1,200/month.&lt;/li&gt;
&lt;li&gt;Managed fixed allocation: $300/month.&lt;/li&gt;
&lt;li&gt;Hypothetical managed variable premium: $0.003/completed session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The break-even volume is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;($1,200 - $300) / $0.003 = 300,000 completed sessions/month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below that volume, the hypothetical fixed-cost saving exceeds the premium. Above it, the assumed self-managed option becomes cheaper. Different labor allocation or retry rates can reverse the result.&lt;/p&gt;

&lt;p&gt;We would count telemetry as well. Multi-agent fan-out can increase spans and logs independently of user sessions; our &lt;a href="https://dev.to/articles/langfuse-clickhouse-ingestion-sizing-cost-2026"&gt;Langfuse ingestion review&lt;/a&gt; explains why that deserves its own budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;We would proceed with a limited Agent Runtime proof of concept when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The team already operates within Google Cloud’s identity and billing model.&lt;/li&gt;
&lt;li&gt;Reducing agent-hosting work is more valuable than controlling every runtime detail.&lt;/li&gt;
&lt;li&gt;Session state can remain small and reference-oriented.&lt;/li&gt;
&lt;li&gt;Business records remain in a transactional system.&lt;/li&gt;
&lt;li&gt;Private A2A discovery can be tested from the deployed orchestrator.&lt;/li&gt;
&lt;li&gt;Cross-session memory can have an explicitly tested visibility contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would withhold production approval when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An exact state-size or quota number is required but has not been verified.&lt;/li&gt;
&lt;li&gt;Immediate Memory Bank read-after-write visibility is a product requirement.&lt;/li&gt;
&lt;li&gt;The design uses app-scoped state as an unrestricted customer database.&lt;/li&gt;
&lt;li&gt;First-request latency has a strict SLO without cold-path measurements.&lt;/li&gt;
&lt;li&gt;The cost case assumes managed storage eliminates operations entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our recommendation is &lt;strong&gt;evaluate, not standardize yet&lt;/strong&gt;. The managed architecture is credible, but this review does not establish deployment success, production limits, or economic superiority.&lt;/p&gt;

&lt;p&gt;The next investment should be a small, instrumented run of the &lt;a href="https://codelabs.developers.google.com/adk-a2a-agent-runtime" rel="noopener noreferrer"&gt;official A2A codelab&lt;/a&gt;, cross-checked against the &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;ADK runtime quickstart&lt;/a&gt;. We would require preserved CLI logs, one real managed-service rejection, cross-session visibility measurements, and a bill-backed cost calculation before signing off.&lt;/p&gt;

</description>
      <category>googleadk</category>
      <category>agentruntime</category>
      <category>multiagentsystems</category>
      <category>sessionstate</category>
    </item>
    <item>
      <title>Chonkie for Production RAG: Token vs Semantic Chunking</title>
      <dc:creator>Jangwook Kim</dc:creator>
      <pubDate>Sat, 21 Nov 2026 00:37:34 +0000</pubDate>
      <link>https://dev.to/jangwook_kim_e31e7291ad98/chonkie-for-production-rag-token-vs-semantic-chunking-55hh</link>
      <guid>https://dev.to/jangwook_kim_e31e7291ad98/chonkie-for-production-rag-token-vs-semantic-chunking-55hh</guid>
      <description>&lt;h2&gt;
  
  
  Why We Brought This Tool Into Our Lab
&lt;/h2&gt;

&lt;p&gt;We put Chonkie on our evaluation list because chunking is an easy place to make an expensive, nearly invisible RAG mistake. A boundary change can increase vector count, separate an instruction from its exception, or silently truncate evidence at the embedding layer. The ingestion job still finishes successfully.&lt;/p&gt;

&lt;p&gt;Published chunking throughput&lt;span&gt;Chonkie token 4.82 MB/s&lt;/span&gt;&lt;span&gt;LangChain token 4 MB/s&lt;/span&gt;&lt;span&gt;LlamaIndex token 0.09 MB/s&lt;/span&gt;&lt;span&gt;Chonkie semantic, default settings 0.33 MB/s&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the upstream 100,000-article benchmark on a Google Colab A100, Chonkie's default semantic path had lower throughput than its token path; recall and runtime memory were not established.&lt;/p&gt;

&lt;p&gt;Our question was narrower than “Which RAG framework wins?” We wanted to know whether semantic boundaries justify their additional ingestion work compared with fixed token windows.&lt;/p&gt;

&lt;p&gt;Chonkie gives us both approaches behind a similar interface. Token chunking partitions text using token counts. Semantic chunking uses embeddings to group sentences by meaning. Neither choice fixes a broken parser, missing access-control metadata, or an unsuitable retrieval model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our provisional decision is to start with token chunking and require measured retrieval improvement before adopting semantic chunking.&lt;/strong&gt; That is an engineering baseline, not a finding that token chunking always retrieves better.&lt;/p&gt;

&lt;p&gt;We need to establish the evidence boundary immediately: we reviewed the installation instructions, API examples, published benchmarks, and an external production case study. We did &lt;strong&gt;not&lt;/strong&gt; complete a local TokenChunker-versus-SemanticChunker execution. We therefore have no firsthand chunk throughput, peak RSS, chunk counts, or recall results to publish. The commands below are a runnable preflight, not a disguised successful benchmark.&lt;/p&gt;

&lt;p&gt;That distinction matters. We will not turn an upstream speed table into an Effloow lab measurement or infer retrieval quality from ingestion throughput.&lt;/p&gt;

&lt;p&gt;We also keep this evaluation separate from the embedding-model decision covered in our &lt;a href="https://dev.to/articles/voyage-cohere-nemotron-embedding-rag-benchmark-2026"&gt;production RAG embedding comparison&lt;/a&gt;. Changing the chunker and embedding model simultaneously would make a recall regression much harder to diagnose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation and Preflight Script
&lt;/h2&gt;

&lt;p&gt;Our first gate is dependency and API verification. The official &lt;a href="https://docs.chonkie.ai/oss/installation" rel="noopener noreferrer"&gt;installation path&lt;/a&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install chonkie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a local sentence-transformer-based semantic configuration, we would install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install &lt;span class="s2"&gt;"chonkie[st]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We distinguish that from &lt;code&gt;chonkie[semantic]&lt;/code&gt;, which currently selects Model2Vec support. Installing the semantic extra does not mean that an arbitrary sentence-transformer model and all its dependencies are available. We also avoid &lt;code&gt;chonkie[all]&lt;/code&gt; for a two-chunker comparison: unrelated providers make dependency isolation harder.&lt;/p&gt;

&lt;p&gt;“No external secrets” is achievable with local models. “No network access” requires additional preparation: model weights and tokenizer assets must already exist in the deployment image or cache.&lt;/p&gt;

&lt;p&gt;We would start our semantic run with this configuration, checking it against the installed release before execution (&lt;a href="https://docs.chonkie.ai/oss/chunkers/choosing-a-chunker" rel="noopener noreferrer"&gt;configuration reference&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;chonkie&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;SemanticChunker&lt;/span&gt;

&lt;span class="n"&gt;chunker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SemanticChunker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;embedding_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"all-MiniLM-L6-v2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;chunk_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;similarity_threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;chunker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We treat that as an API example, not a version-independent guarantee. The sources we reviewed do not establish an exact TokenChunker constructor, its default tokenizer, its overlap behavior, or a pinned release. Guessing those details would undermine the comparison before timing began.&lt;/p&gt;

&lt;p&gt;Our runnable preflight inspects the installed package without constructing a model or downloading weights:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; chonkie_preflight.py &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import inspect
import json
import platform
from importlib import import_module, metadata

report &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"python"&lt;/span&gt;: platform.python_version&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s2"&gt;"constructors"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="s2"&gt;"benchmark_executed"&lt;/span&gt;: False,
&lt;span class="o"&gt;}&lt;/span&gt;

try:
    report&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"chonkie_version"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; metadata.version&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"chonkie"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    package &lt;span class="o"&gt;=&lt;/span&gt; import_module&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"chonkie"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
except Exception as exc:
    report&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"installation_error"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;exc&lt;span class="o"&gt;)&lt;/span&gt;.__name__,
        &lt;span class="s2"&gt;"message"&lt;/span&gt;: str&lt;span class="o"&gt;(&lt;/span&gt;exc&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="o"&gt;}&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;report, &lt;span class="nv"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    raise SystemExit&lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; name &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"TokenChunker"&lt;/span&gt;, &lt;span class="s2"&gt;"SemanticChunker"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    try:
        cls &lt;span class="o"&gt;=&lt;/span&gt; getattr&lt;span class="o"&gt;(&lt;/span&gt;package, name&lt;span class="o"&gt;)&lt;/span&gt;
        signature &lt;span class="o"&gt;=&lt;/span&gt; inspect.signature&lt;span class="o"&gt;(&lt;/span&gt;cls&lt;span class="o"&gt;)&lt;/span&gt;
        report&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"constructors"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;name&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"signature"&lt;/span&gt;: str&lt;span class="o"&gt;(&lt;/span&gt;signature&lt;span class="o"&gt;)&lt;/span&gt;,
            &lt;span class="s2"&gt;"parameters"&lt;/span&gt;: list&lt;span class="o"&gt;(&lt;/span&gt;signature.parameters&lt;span class="o"&gt;)&lt;/span&gt;,
            &lt;span class="s2"&gt;"has_chunk"&lt;/span&gt;: callable&lt;span class="o"&gt;(&lt;/span&gt;getattr&lt;span class="o"&gt;(&lt;/span&gt;cls, &lt;span class="s2"&gt;"chunk"&lt;/span&gt;, None&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
            &lt;span class="s2"&gt;"has_chunk_batch"&lt;/span&gt;: callable&lt;span class="o"&gt;(&lt;/span&gt;getattr&lt;span class="o"&gt;(&lt;/span&gt;cls, &lt;span class="s2"&gt;"chunk_batch"&lt;/span&gt;, None&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="o"&gt;}&lt;/span&gt;
    except Exception as exc:
        report&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"constructors"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;name&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"error_type"&lt;/span&gt;: &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;exc&lt;span class="o"&gt;)&lt;/span&gt;.__name__,
            &lt;span class="s2"&gt;"error_message"&lt;/span&gt;: str&lt;span class="o"&gt;(&lt;/span&gt;exc&lt;span class="o"&gt;)&lt;/span&gt;,
        &lt;span class="o"&gt;}&lt;/span&gt;

print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;report, &lt;span class="nv"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY

python chonkie_preflight.py
python -m pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.observed.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Illustrative failure output, not captured execution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"3.11.9"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"constructors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"benchmark_executed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"installation_error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PackageNotFoundError"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"No package metadata was found for chonkie"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We deliberately show an illustrative failure rather than invent successful signatures or performance numbers. In an environment with Chonkie installed, the script emits the actual release and constructor signatures.&lt;/p&gt;

&lt;p&gt;For a completed comparison, we would require the following execution contract:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Freeze inputs.&lt;/strong&gt; Store UTF-8 documents, SHA-256 hashes, stable document IDs, and hand-labeled query/evidence pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify configuration.&lt;/strong&gt; Record the actual constructor arguments, tokenizer identity, embedding revision, device, thread settings, and dependency lock.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate startup from work.&lt;/strong&gt; Measure imports and model loading independently from warm chunking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolate processes.&lt;/strong&gt; Run each strategy in a fresh process so semantic-model allocations cannot contaminate the token baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time identical inputs.&lt;/strong&gt; Report input bytes per second, chunks per second, chunk counts, and repeated-run variability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure retrieval separately.&lt;/strong&gt; Use the same retrieval encoder, index settings, queries, and ranking procedure for both outputs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For memory, we require process-level peak RSS, not just Python allocation tracing. Native tokenizer and model allocations can sit outside the latter. On Linux, &lt;code&gt;/usr/bin/time -v&lt;/code&gt; can provide a process high-water mark, but we would label whether that includes model loading and retained output chunks.&lt;/p&gt;

&lt;p&gt;For recall, we would score retrieved chunks against labeled source evidence. With multiple required evidence spans, recall@k is the fraction recovered in the top k chunks, averaged across queries. A document-level hit is insufficient when the retrieved chunk misses the answer-bearing passage.&lt;/p&gt;

&lt;p&gt;We would also evaluate under a fixed retrieved-token budget. Semantic chunking can produce differently sized chunks; equal k does not necessarily mean equal context cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Could Not Verify and What We Would Test Next
&lt;/h2&gt;

&lt;p&gt;Our immediate roadblock was an incomplete reproducibility contract, not a reproduced Chonkie crash. We lacked a pinned package release, a verified TokenChunker configuration, and provisioned embedding assets. That blocked an honest local comparison.&lt;/p&gt;

&lt;p&gt;The production risks below are the checks we would implement next. We distinguish them from failures we have personally reproduced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tokenizer alignment comes before chunk-size tuning.&lt;/strong&gt; A chunk labeled “512 tokens” is meaningful only relative to its tokenizer. It does not prove that the retrieval encoder accepts that text without truncation.&lt;/p&gt;

&lt;p&gt;We would count every emitted chunk using the actual retrieval tokenizer, including special-token allowance and any document prefix. This is especially important when a sentence-transformer configuration has a chunk budget that appears larger than the model’s input limit. The relevant model limit must be checked rather than inferred from &lt;code&gt;chunk_size&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unicode integrity needs an explicit invariant.&lt;/strong&gt; In the &lt;a href="https://chunkwise.github.io/case_study/design_decisions_and_challenges/" rel="noopener noreferrer"&gt;Chunkwise case study&lt;/a&gt;, we found a concrete warning about token-window decoding around multi-byte characters. We treat that as a tokenizer-and-version-specific regression target, not proof that every Chonkie release corrupts Unicode.&lt;/p&gt;

&lt;p&gt;Our fixture would include curly quotes, dashes, ellipses, accented text, and emoji. We would check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether emitted text introduces U+FFFD replacement characters.&lt;/li&gt;
&lt;li&gt;Whether chunk text matches the intended source substring.&lt;/li&gt;
&lt;li&gt;Whether offsets use characters, bytes, or another coordinate system.&lt;/li&gt;
&lt;li&gt;Whether repeated passages make substring-based offset recovery ambiguous.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would not “fix” this by stripping non-ASCII text. NFC normalization and whitespace normalization can change offsets and must be versioned transformations with a mapping back to the original document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overlap is part of the experiment, not a harmless default.&lt;/strong&gt; We have not verified TokenChunker’s overlap parameters in a pinned release. We would inspect the installed signature and behavior before supplying one.&lt;/p&gt;

&lt;p&gt;Our first comparison would use no overlap wherever supported, followed by a separately labeled overlap experiment. Otherwise, duplicated context can masquerade as a semantic-boundary advantage.&lt;/p&gt;

&lt;p&gt;For fixed windows of size (S) and overlap (O), a long-document approximation gives a text-volume multiplier of:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\frac{S}{S-O}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;At 512 tokens with 64-token overlap, that is approximately 1.143: about 14.3% more emitted token volume before edge effects. This is arithmetic, not a Chonkie measurement. It still illustrates why overlap affects embedding work, storage, and duplicate retrieval results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chunk objects need an application-owned serialization boundary.&lt;/strong&gt; We have not verified the returned metadata schema. We would not assume &lt;code&gt;json.dumps(chunk)&lt;/code&gt; works or that an automatic object conversion produces vector-database-compatible metadata.&lt;/p&gt;

&lt;p&gt;Our storage adapter would explicitly extract text and validated primitive fields. We would store document ID, normalized-source hash, chunk index, verified offsets, configuration hash, and tokenizer/model revisions. Embeddings would remain separate from metadata.&lt;/p&gt;

&lt;p&gt;A successful JSON encoding is only the first test. We also need round-trip equality and compatibility with the target index’s restrictions on nested objects, nulls, and numeric types.&lt;/p&gt;

&lt;p&gt;Finally, we would distinguish semantic boundary embeddings from retrieval embeddings. Using the same model does not automatically mean those computations or representations are reusable. We would verify reuse before crediting any cost savings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale, Latency &amp;amp; Cost vs. Alternatives
&lt;/h2&gt;

&lt;p&gt;We use the &lt;a href="https://github.com/chonkie-inc/chonkie/blob/main/BENCHMARKS.md" rel="noopener noreferrer"&gt;upstream benchmark table&lt;/a&gt; as a sizing reference, not a purchasing guarantee. Its 100,000-Wikipedia-article results use a Google Colab A100 instance.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Strategy or library&lt;/th&gt;
&lt;th&gt;Published reference result&lt;/th&gt;
&lt;th&gt;What we can conclude&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chonkie token&lt;/td&gt;
&lt;td&gt;58 seconds; 4.82 MB/s&lt;/td&gt;
&lt;td&gt;A useful throughput reference for that workload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LangChain token&lt;/td&gt;
&lt;td&gt;70 seconds; 4 MB/s&lt;/td&gt;
&lt;td&gt;A smaller gap than the largest marketing speed factors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LlamaIndex token&lt;/td&gt;
&lt;td&gt;50 minutes; 0.09 MB/s&lt;/td&gt;
&lt;td&gt;A large reported gap requiring configuration scrutiny&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chonkie semantic, default settings&lt;/td&gt;
&lt;td&gt;13 minutes 59 seconds; 0.33 MB/s&lt;/td&gt;
&lt;td&gt;Semantic work is materially more expensive in this reference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sentence or recursive splitting&lt;/td&gt;
&lt;td&gt;No matched local result here&lt;/td&gt;
&lt;td&gt;Worth testing before paying for semantic segmentation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We cannot extract recall, runtime memory, or a universal winner from this table. The semantic section includes another Chonkie row with insufficient configuration detail to explain the difference, so we exclude it from our cost model.&lt;/p&gt;

&lt;p&gt;The published default semantic time divided by the token time is approximately 14.5. That is a ratio between those reported rows, not an isolated measurement of embedding overhead or an expected CPU slowdown.&lt;/p&gt;

&lt;p&gt;For our ingestion planning, we use a separate load-test reference covering 1,014 documents totaling 40 MB, with individual documents ranging from approximately 1 KB to 10 MB. We retain token job times of 5:22–12:47 and semantic job times of 9:39–37:28 as workload-specific ranges—not local measurements, p95 latency, or results comparable to the A100 benchmark. We would verify hardware, concurrency, and chunker settings before applying these ranges to our deployment.&lt;/p&gt;

&lt;p&gt;Package size is not a measure of runtime memory. We use the 15 MiB default-install figure only as a package-footprint reference, not as a worker-memory measurement. We do &lt;strong&gt;not&lt;/strong&gt; translate that into a 15 MiB worker RSS claim. Semantic dependencies, weights, allocator behavior, and concurrency require separate measurement.&lt;/p&gt;

&lt;p&gt;Our cost model is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\Delta C =&lt;br&gt;
C_{\text{extra chunking compute}}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C_{\text{extra retrieval embedding}}&lt;/li&gt;
&lt;li&gt;C_{\text{extra index storage}}&lt;/li&gt;
&lt;li&gt;C_{\text{operational work}}
]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a purely hypothetical break-even calculation, suppose semantic processing costs an additional $120 per monthly ingestion cycle. At 60,000 queries per month, it must save more than $0.002 per query, assuming no other benefits or costs. Avoiding retries, reducing context, or preventing expensive retrieval failures could justify it—but only measured improvements count.&lt;/p&gt;

&lt;p&gt;For self-hosted local embeddings, there is no embedding API invoice. There is still CPU/GPU time, memory residency, image distribution, and re-indexing expense.&lt;/p&gt;

&lt;p&gt;Our practical alternative is not only another library. It is a cheaper boundary strategy inside the same library. We would test sentence or recursive chunking before concluding that semantic segmentation is necessary.&lt;/p&gt;

&lt;p&gt;At larger scale, bounded queues and worker memory matter more than a short in-memory timing loop. We use the same deployment discipline discussed in our &lt;a href="https://dev.to/articles/openshift-ai-ray-data-distributed-rag-2026"&gt;distributed RAG deployment gates&lt;/a&gt;: characterize a worker before multiplying it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Final Verdict: When to Deploy, When to Skip
&lt;/h2&gt;

&lt;p&gt;We consider Chonkie a credible candidate for an isolated chunking layer. We do not yet consider this evidence sufficient to approve a semantic re-indexing migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We would deploy a token-based baseline if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can pin the package, tokenizer, and configuration.&lt;/li&gt;
&lt;li&gt;Every chunk passes the retrieval encoder’s actual length checks.&lt;/li&gt;
&lt;li&gt;Unicode and source-offset integrity pass regression tests.&lt;/li&gt;
&lt;li&gt;Application-owned metadata survives serialization and index insertion.&lt;/li&gt;
&lt;li&gt;Labeled retrieval quality meets the product threshold.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would trial semantic chunking if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Error analysis shows that token boundaries separate necessary evidence.&lt;/li&gt;
&lt;li&gt;Sentence and recursive baselines do not resolve that problem.&lt;/li&gt;
&lt;li&gt;We can provision local embedding assets predictably.&lt;/li&gt;
&lt;li&gt;Recall improves under both fixed-k and fixed-context-budget evaluation.&lt;/li&gt;
&lt;li&gt;The gain pays for additional ingestion and operational cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We would hold off if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The proposed justification is simply that semantic chunks “look better.”&lt;/li&gt;
&lt;li&gt;We cannot distinguish cold-start time from steady-state processing.&lt;/li&gt;
&lt;li&gt;A package-size figure is being used to size worker memory.&lt;/li&gt;
&lt;li&gt;We have no labeled evidence set or rollback-capable index.&lt;/li&gt;
&lt;li&gt;Defaults can change without producing a new configuration identity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our recommendation is deliberately conditional: &lt;strong&gt;use token chunking as the cost baseline; adopt semantic chunking only if measured retrieval gains justify its added cost.&lt;/strong&gt; The missing result is not another speed claim. It is a pinned, same-corpus comparison with memory measurements and evidence-level retrieval scoring.&lt;/p&gt;

&lt;p&gt;We would keep the &lt;a href="https://docs.chonkie.ai/oss/installation" rel="noopener noreferrer"&gt;official installation instructions&lt;/a&gt;, &lt;a href="https://github.com/chonkie-inc/chonkie" rel="noopener noreferrer"&gt;Chonkie repository&lt;/a&gt;, and our own frozen evaluation artifacts together in the deployment record. Until that record includes actual recall and RSS results, we would call this a promising implementation choice—not a production benchmark win.&lt;/p&gt;

</description>
      <category>rag</category>
      <category>chonkie</category>
      <category>chunking</category>
      <category>aiinfrastructure</category>
    </item>
  </channel>
</rss>
