<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Thom Leigh on Medium]]></title>
        <description><![CDATA[Stories by Thom Leigh on Medium]]></description>
        <link>https://medium.com/@thom.leigh?source=rss-8404af7e159c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AuTTSxfFOvRF2U66</url>
            <title>Stories by Thom Leigh on Medium</title>
            <link>https://medium.com/@thom.leigh?source=rss-8404af7e159c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 17:39:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thom.leigh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pipecat: The Hardest Way to Deploy Voice and Multimodal Conversational AI]]></title>
            <link>https://medium.com/@thom.leigh/pipecat-the-hardest-way-to-deploy-voice-and-multimodal-conversational-ai-0706ae7a21cd?source=rss-8404af7e159c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0706ae7a21cd</guid>
            <category><![CDATA[ai-voice-agent]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[multimodal]]></category>
            <dc:creator><![CDATA[Thom Leigh]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 16:59:01 GMT</pubDate>
            <atom:updated>2025-09-19T16:59:01.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="An arrow pointing at a divide between a node graph and a series of rusty pipes." src="https://cdn-images-1.medium.com/max/1024/1*WXw2Ijj6tz_oUatxCZ00og.png" /><figcaption>Switchboard or Pipecat? Pros and Cons</figcaption></figure><h3>Introduction</h3><p>Developers working on real-time voice and multimodal AI agents often start with <a href="https://github.com/pipecat-ai/pipecat"><strong>Pipecat</strong></a>, an open-source Python framework for voice bots. <a href="https://medium.com/@cloudiafricaa/pipecat-the-easiest-way-to-build-voice-and-multimodal-conversational-ai-7072860ed05a">Pipecat makes it easy to prototype conversational pipelines</a> by orchestrating speech recognition (STT), language models, and text-to-speech (TTS) services in Python. However, when it comes to deploying these voice agents on mobile platforms (iOS/Android) as on-device features, Pipecat faces significant technical limitations due to its Python-based engine and server-oriented design. Let’s discuss some of the challenges and opportunities in transitioninion from Pipecat prototypes to a native audio graph in production using <a href="https://switchboard.audio/">Switchboard</a>.</p><h3>Pipecat’s Architecture and Mobile Deployment Challenges</h3><p><strong>Server‑Client Architecture:</strong> Pipecat is fundamentally designed as a client/server system rather than a library embedded in a mobile app. The core bot logic <a href="https://www.daily.co/blog/build-a-voice-agent-for-android-with-gemini-multimodal-live/">runs in a Python server process</a> (e.g. on a PC or cloud), and client SDKs connect to it over the network. In a typical setup, a mobile app uses Pipecat’s iOS/Android SDK to stream microphone audio and receive responses, while <a href="https://www.daily.co/blog/build-a-voice-agent-for-android-with-gemini-multimodal-live/">the Python Pipecat backend handles the AI processing in real time</a>. This separation means the “brain” of the voice assistant lives off-device (on a server), communicating via WebRTC or websockets (<a href="https://www.daily.co/blog/build-a-voice-agent-for-android-with-gemini-multimodal-live/">the Pipecat <strong>RTVI</strong> protocol</a>) for low-latency streaming. This architecture is effective for development and web demos, but it immediately raises issues for on-device deployment: the mobile app itself contains no AI logic beyond networking.</p><p><strong>Python Engine on Mobile:</strong> Running Pipecat’s Python engine directly on an iOS or Android device is not officially supported or practical. Pipecat requires a CPython 3 runtime and numerous Python packages and native dependencies (e.g. for audio processing, networking, ML APIs) that are normally installed on a server. In fact, <a href="https://www.zegocloud.com/blog/daily-co-vs-zegocloud-comparison">Pipecat’s production deployment model expects you to containerize the Python app (e.g. as a Docker image) and host it in the cloud</a>. Packaging a Python interpreter and all of Pipecat’s dependencies into a mobile app would be extremely heavy and complex. iOS in particular has strict restrictions on executing dynamic or interpreted code in apps. Distributing a full Python environment inside an App Store app (with the ability to run arbitrary Python) would likely violate Apple’s guidelines, which prefer native compiled code. Even if one attempted to embed Python, the footprint (dozens of megabytes of interpreter and libraries) and performance overhead would be prohibitive for a real-time voice assistant. In short, Pipecat’s architecture — a server-side Python framework — is inherently at odds with the constraints of mobile on-device deployment. Pipecat was optimized for flexibility and integration ease over portability; it leverages Python’s rich ecosystem (async IO loops, web frameworks, AI service SDKs, etc.) at the cost of being <a href="https://www.zegocloud.com/blog/daily-co-vs-zegocloud-comparison">tethered to environments where Python can freely run</a> (desktops, servers, cloud).</p><p><strong>Technical Limitations on iOS/Android:</strong> There are several specific architectural choices in Pipecat that make on-device mobile use challenging:</p><ol><li><strong>Language/runtime:</strong> Pipecat is written in Python, which has no native support on iOS and limited support on Android. Mobile apps are typically written in Swift/Obj-C (iOS) or Java/Kotlin/C++ (Android); to run Python you’d need a compatibility layer or embed an interpreter, which is non-trivial.</li><li><strong>Real-time audio handling:</strong> Pipecat relies on frameworks like <a href="https://www.daily.co/blog/build-a-voice-agent-for-android-with-gemini-multimodal-live/">WebRTC for streaming audio between client and server</a>. On mobile, the Pipecat client SDK uses the platform’s audio capture and then sends data out. If you tried to run Pipecat on-device, you would need Python libraries to interface with the microphone and speaker in real-time, which is not something Python does natively on iOS.</li><li><strong>Concurrency and performance:</strong> Pipecat’s use of async Python and multi-threaded I/O could conflict with mobile app event loops. The Python Global Interpreter Lock (GIL) also limits parallel execution, which is an issue on multicore mobile CPUs.</li><li><strong>External dependencies:</strong> Pipecat pipelines often depend on external AI services (cloud APIs for STT, LLM, TTS). Running on-device would either require those API calls (thus needing internet anyway) or bundling large ML models locally (which would be a huge resource burden in Python).</li><li><strong>Security:</strong> <a href="https://docs.pipecat.ai/getting-started/web-mobile">Pipecat’s design assumes a server will hold API keys and secrets</a> (so they aren’t exposed in client apps). A pure on-device Pipecat would have to embed keys in the app (risking exposure) or avoid cloud services entirely. All these factors underscore that Pipecat was not built with <em>native mobile deployment</em> as a goal. It’s intended to run off-device and connect via network. As the documentation notes, the recommended approach is to keep the bot logic on a server (or Pipecat Cloud) and have a thin client on mobile. In practice, trying to shoehorn Pipecat’s Python engine into an iOS/Android app is unrealistic for production. At most, developers use Pipecat to prototype the conversation logic on a PC, then expose it via APIs or replace it for mobile.</li></ol><h3>Switchboard: Enabling Native Mobile Support</h3><p><strong>Mobile-Focused Runtime:</strong> Switchboard takes a fundamentally different approach that enables <em>native</em> on-device voice AI. It is an SDK and runtime for real-time audio pipelines built in high-performance C++ and designed to be cross-compiled to every major platform. Instead of a Python process, Switchboard provides a lightweight audio engine that runs inside your mobile app. Developers define an audio/voice processing graph (via a JSON config or using provided APIs), and the Switchboard engine executes it locally in real time. This architecture eliminates the need for a separate server; the voice agent can live entirely within the iOS or Android application process. Crucially, Switchboard’s runtime is implemented in C++ for speed and compiled directly for each platform (iOS, Android, Windows, macOS, Linux, etc.), so it runs natively. From the mobile OS perspective, it’s just another native library, which avoids the policy and performance issues that a Python interpreter would entail. In fact, one of Switchboard’s goals is to let developers <em>“build without being constrained by the limited use cases of iOS, Android, and other native platforms”</em>, meaning it abstracts away low-level audio handling and provides capabilities that normally would be hard to implement under mobile OS constraints.</p><p><strong>Cross-Platform Language Compatibility:</strong> A key strength of Switchboard is its language/runtime compatibility across platforms. The core engine is C++, but Switchboard offers idiomatic bindings for multiple languages and environments so developers can work in their native platform language. For example, it provides a Swift API for iOS, a Kotlin/Java API for Android, a JavaScript API (for web or Node integration), Python bindings for desktop prototyping, and C++ APIs for integration into games or other engines<a href="https://switchboard.audio/#:~:text=APIs%20%26%20Language%20Bindings%20%E2%80%94,Swift%2C%20Kotlin%2C%20JavaScript%2C%20C%2B%2B%2C%20Python">9</a>. This means a mobile developer can call Switchboard’s functions directly from Swift or Kotlin, just like any native SDK; no need for network layers or separate processes. The runtime architecture is consistent: whether on iPhone or Android or PC, the same Switchboard engine runs, but you invoke it through the appropriate language binding. The result is native mobile support by design: Switchboard aligns with iOS and Android’s development models. For instance, on iOS, you’d include the Switchboard SDK (as a framework or Swift Package) and it runs within the app’s sandbox, processing audio with low latency. On Android, it uses JNI to expose the C++ engine to Java or Kotlin. Because it’s compiled, there are no App Store rule issues, the logic is baked into the app binary. Switchboard effectively bridges the gap between high-level app code and low-level audio processing, something that Pipecat could not do on device.</p><p><strong>Runtime Architecture &amp; Performance:</strong> Switchboard’s runtime uses a modular audio graph architecture. You build a pipeline of “nodes” e.g. a microphone input node, an STT (speech-to-text) node, an LLM inference node, a TTS node, output to speaker, etc., and the engine executes the graph with highly optimized C++ code. It supports both on-device modules and API-based modules in the same pipeline. For example, one node could run an on-device wake-word detector or VAD (voice activity detection) model, then another node calls a cloud API for STT, then another runs a local filter, etc. This <em>hybrid</em> approach is ideal for mobile: latency-sensitive pieces can run locally, heavy ML can optionally be offloaded to cloud, all coordinated by the engine. Switchboard is built for real-time performance: it advertises sub-10ms processing latency per module and stable low-latency execution even under load. Unlike a Python loop, the C++ engine can leverage multiple threads and is tuned for audio processing without garbage collection pauses. Switchboard also offers features like dynamic graph reconfiguration and event callbacks to adapt to network or user changes on the fly, features important in a mobile context where conditions can change (e.g. network dropout or user pressing a button). Furthermore, Switchboard has a library of pre-built nodes for common functions (STT, TTS, effects, mixers, etc.) and allows custom extensions in C++ or via its API. This makes it extensible yet efficient. In short, Switchboard’s architecture is a mobile-native runtime: compiled, optimized, and integrated with platform audio. It provides the language and runtime compatibility (Swift, Kotlin, etc.) that Pipecat lacks, enabling voice AI logic to run on-device (even offline, if using local models) rather than requiring a separate Python server.</p><h3>Transitioning from Pipecat Prototypes to Switchboard in Production</h3><p>Many teams leverage Pipecat during the proof-of-concept stage, then switch to a framework like Switchboard for the production stage on mobile. This is a natural progression given each tool’s strengths. With Pipecat, a small team can quickly script a voice bot prototype, for example, connecting a Twilio phone call to an LLM and TTS in a few dozen lines of Python, or building a web demo where users talk to an AI agent. The open-ended Python environment allows rapid experimentation with different APIs or conversation logic. However, when it’s time to deliver a polished mobile app with that voice assistant functionality, the limitations of a Python server become apparent, as discussed. Rewriting or porting the solution is the only viable path for on-device deployment. Switchboard is explicitly designed to ease this transition: its creators emphasize that the SDK “saves time from prototyping through production while providing lasting flexibility,” especially for cross-platform products. In practice, this means a developer can take the lessons and logic from a Pipecat prototype and reimplement them as a Switchboard audio graph. For instance, if a Pipecat prototype used Deepgram’s API for transcription and ElevenLabs for TTS via cloud calls, the production app might use Switchboard with a Whisper model node on-device for transcription and an offline TTS node (or still ElevenLabs via a controlled API call node), achieving similar functionality without a separate server.</p><p>As an example case, consider a startup that built a voice-enabled customer support bot. They might first use Pipecat to prove out the conversation flow and multi-service integration (because Pipecat can easily hook into different NLP APIs in Python). The prototype runs on a cloud server during user tests. When moving to a mobile app deployment, the team pivots to Switchboard: they embed the voice assistant logic into the app itself for better responsiveness and reliability. The architecture shifts from a cloud-based bot to an on-device bot. Thanks to Switchboard’s cross-language support, the team can implement the voice pipeline in Swift for iOS and reuse the same pipeline definition for Android in Kotlin, with the heavy lifting handled by the common C++ engine. Several developers in the voice AI community have followed this pattern using Pipecat (or similar Python frameworks) as a “training ground” for their AI logic, then adopting a Switchboard-style native solution for the final product. This approach balances speed and innovation (during R&amp;D) with performance and user experience (in production). It’s worth noting that Switchboard’s own documentation targets AI voice assistant developers and real-time communications apps, indicating its role as a production-grade alternative to earlier prototype-centric tools.</p><p>In summary, Pipecat and Switchboard solve different stages of the voice AI development lifecycle. Pipecat offers flexibility and speed for assembling conversational AI prototypes, but its Python engine and server-bound design impose hard limits on mobile deployment. It cannot realistically run on-device within an iOS or Android app due to runtime, performance, and platform policy constraints. Switchboard, on the other hand, was architected to bring voice AI into mobile and other native environments. With a C++ real-time engine, multi-language SDKs, and hybrid on-device/cloud processing, Switchboard enables the kind of low-latency, on-device voice interactions that users expect from modern mobile apps. Projects that begin with a Pipecat-style approach often migrate to Switchboard (or a similar native solution) to achieve their final deployment goals. This combination lets developers harness the best of both worlds: the rapid iteration of a high-level prototype and the efficiency of a production-ready, mobile-native runtime. The result is that voice AI features can move from demo to delivered: running seamlessly on the very devices in users’ hands.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0706ae7a21cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>