Stage 05 of 09Beyond text

Multimodal and voice

Vision, generation, and real-time voice, built to stay fast and grounded on a live call.

visionspeech-to-textrealtime voice

Vision and documents

Recommended

Read images and dense documents, extract structure, and ground the result.

Concepts

Vision-language modelsRead screenshots, charts, and photos directly, no separate OCR step.

Vision-language models (VLMs) accept images alongside text in a single prompt, letting the model read a screenshot, interpret a chart, or extract data from a photo without a separate OCR pipeline in front of it. Models like GPT-4o and Claude 3.5 can answer questions directly about what they see, describe layouts, and identify values in tables.

In production this eliminates an entire preprocessing stage and its failure modes. The trade-off is that token cost scales with image resolution, so you want to resize or crop images aggressively and only send the region that matters to the query.

Sources

Full definition in the glossary
Layout-aware parsingPreserve tables and reading order from dense, messy PDFs.

Dense PDFs carry meaning in structure, not just in words: a value in a table cell means something different from the same value in a header or footnote, and reading order matters in multi-column layouts. Layout-aware parsers preserve this structure by returning bounding boxes, reading-order sequences, and explicit table cells rather than a flat stream of tokens.

Without it, a downstream model sees a jumbled text dump and makes wrong inferences about relationships between numbers and labels. Services like Amazon Textract and Google Document AI return block-level geometry so your extraction logic can use position and structure as signals alongside the raw text.

Sources

Bounding-box groundingPoint to exactly where on the page an answer came from.

When you extract a field from a document, returning the bounding box of the source region ties the answer to a specific location on the page. A downstream reviewer or UI can highlight that exact span, making the extraction auditable rather than a black box.

This matters most in regulated workflows, financial processing, and anything where a human needs to spot-check or correct results. Grounding also helps catch hallucinations: if the model points to a region that contains different text, the extraction is wrong regardless of how plausible the answer looks.

Sources

Technologies

Textract / Document AIHosted OCR and layout extraction for documents at scale.

Amazon Textract and Google Document AI are managed services that handle the messy work of document ingestion at scale: rotating skewed scans, handling varied DPI, extracting tables, key-value pairs, and form fields, and returning structured JSON with geometry. Both expose synchronous and asynchronous APIs so you can process single pages with low latency or batch thousands of documents overnight.

Choosing between them usually comes down to your cloud footprint and which document types each handles better for your corpus. Either way, offloading layout extraction to a purpose-built service lets you focus prompt engineering effort on what the model does with the structured output rather than on parsing.

Sources

In production

The discipline that separates a shipped system from a demo.

Ground to the pageReturn the bounding box or source span so a human can verify each extracted field.

Every extracted field should come back with the bounding box or source span that produced it, not just the value. This one habit transforms document extraction from a system people must trust blindly into one they can verify on demand, which is the difference between a prototype and a production workflow.

In practice, store coordinates alongside extracted values, surface them in review UIs, and include them in structured outputs sent downstream. When something is wrong, reviewers immediately see what region the model read and can correct both the value and the source attribution.

Sources

Eval on real documentsBenchmark on your messiest scans, not clean sample PDFs.

OCR and extraction accuracy on clean sample PDFs bears little relation to accuracy on your actual document corpus. Real documents come with fax artifacts, inconsistent fonts, rotated pages, handwritten annotations, and domain-specific jargon that trips up generic models.

The only meaningful benchmark is accuracy on the worst documents you will actually process, measured on the fields that matter to your application. Build a test set from your messiest scans early, before you commit to a vendor or model, and keep adding to it every time a new failure mode surfaces in production.

Sources

Image generation

Optional

Generate and edit imagery with control over the output.

Concepts

Diffusion modelsText-to-image generation with control over style and composition.

Diffusion models learn to reverse a process of adding noise to images, step by step, until they can generate a new image from pure noise guided by a text prompt. Modern variants like FLUX and Imagen 3 produce photorealistic results with strong prompt adherence and controllable style.

For engineering teams, the key parameters are the number of inference steps (which trades speed for quality), guidance scale (how strictly the model follows the prompt), and the seed (which controls reproducibility). Understanding these lets you tune generation for your use case rather than treating the model as a black box.

Sources

Full definition in the glossary
Inpainting and editingChange one part of an image while keeping the rest untouched.

Inpainting masks a region of an existing image and regenerates only that area, leaving the rest pixel-perfect. It enables targeted edits, such as changing a product color, swapping a background, or removing an object, without reshooting or rebuilding the entire image.

The practical challenge is mask quality: a sloppy mask boundary produces visible seams, and the regenerated region must match the surrounding lighting, perspective, and texture. Production pipelines usually combine inpainting with a cleanup pass and human review for brand-critical imagery.

Sources

Technologies

FLUX / ImagenFrontier image models for generation and editing.

FLUX (from Black Forest Labs) and Google Imagen are the current frontier open-weight and API-based image models for commercial generation tasks. FLUX 1.1 Pro delivers fast, high-fidelity generation with strong prompt adherence; Imagen 3 on Vertex AI integrates tightly into Google Cloud pipelines and offers both generation and editing endpoints.

For most production use cases, access these via managed APIs or Replicate rather than running inference yourself, because GPU requirements are substantial and latency targets matter. Evaluate on your specific prompts and style requirements before choosing, since model behavior varies meaningfully across domains.

Sources

In production

The discipline that separates a shipped system from a demo.

Moderate generationsFilter for unsafe or off-brand imagery before it ever reaches a user.

Every image generation pipeline that serves users needs a moderation layer between the model output and the user-facing surface. Models can produce unsafe, off-brand, or legally problematic imagery in response to benign prompts, and adversarial users will probe for exactly these outputs.

Moderation should run before the image is stored or returned, not as a post-hoc review. Use the provider's built-in safety filters as a first pass, add domain-specific classifiers for brand guidelines, and log every flagged generation for periodic review. The cost of moderation is orders of magnitude cheaper than the cost of a brand incident.

Sources

Speech

Recommended

Move cleanly between speech and text in both directions.

Concepts

Streaming STTTranscribe as the person speaks rather than after they finish.

Streaming speech-to-text sends audio chunks to the transcription model as the speaker talks, returning partial transcripts in real time rather than waiting for silence to trigger a batch request. This makes the system feel responsive: you can display rolling captions, start processing the user's intent before they finish, and trigger voice activity detection with low latency.

The engineering challenge is handling partial results correctly. Intermediate transcripts are unstable and will be revised as more audio arrives, so systems that act on partials need to track whether a segment has been finalized. Services like Deepgram and Whisper-based deployments expose this distinction in their streaming protocols.

Sources

Neural TTSNatural, on-brand synthetic voices instead of robotic playback.

Neural text-to-speech converts text into natural-sounding audio using deep learning rather than concatenative or formant synthesis. Modern systems produce voices that are nearly indistinguishable from human speech in prosody, rhythm, and expressiveness, and they support voice cloning from a short audio sample.

For product teams, the key choices are latency mode (buffered versus streaming), voice consistency across sessions, and control over pacing and emphasis. Streaming TTS is critical for voice agents: the first audio chunk must start playing within a few hundred milliseconds or the conversation feels unnatural.

Sources

Full definition in the glossary

Technologies

WhisperOpen, robust speech-to-text across many languages.

Whisper is OpenAI's open-weight speech recognition model trained on 680,000 hours of multilingual web audio. It handles a wide range of accents, languages, and recording conditions without fine-tuning, and it can transcribe and translate in one pass.

Because it is open-weight, teams can run it on their own infrastructure for latency, cost, or data-residency reasons. The standard large-v3 model achieves strong word error rates on clean audio, but real-world WER on noisy call audio or domain-specific jargon is meaningfully worse; always benchmark on your actual audio before committing to a model size and deployment strategy.

Sources

Full definition in the glossary
ElevenLabsNatural neural text-to-speech and voice cloning.

ElevenLabs provides neural text-to-speech and voice cloning via API, with models tuned for low-latency streaming output. Its streaming endpoint begins returning audio within roughly 400ms of receiving text, which fits inside the per-stage budget of a realtime voice pipeline.

Voice cloning lets you create a consistent brand voice or match a specific person's voice from a short sample. In production, the main concerns are model consistency across a long conversation session, rate limits under load, and content-policy handling, which can filter legitimate use cases if prompts are not phrased carefully.

Sources

In production

The discipline that separates a shipped system from a demo.

Measure WER on your audioAccents, jargon, and noise wreck generic STT; test on real calls, not demos.

Word error rate (WER) on a provider's benchmark dataset tells you almost nothing about WER on your actual audio. Call center audio has background noise, cross-talk, and domain jargon; accented speakers push up deletion errors; product names and acronyms inflate substitution rates.

The practice is simple: collect a representative sample of your real audio, transcribe it with your candidate models, and measure WER against human transcripts. Do this before you go to production, and repeat it whenever the audio distribution changes, such as when you open a new call type or add a language. A model that looks great on demos can be unusable on your data.

Sources

Realtime voice

Optional

Hold a natural conversation with sub-second replies and barge-in.

Concepts

Speech-to-speech modelsSkip the text hop for noticeably lower conversational latency.

Speech-to-speech models process audio input and produce audio output directly, without an intermediate text representation. This removes the cascading latency of STT, LLM token generation, and TTS as three sequential round trips, replacing them with a single model pass that preserves prosody, emotion, and timing cues that text cannot carry.

The OpenAI Realtime API exposes this capability over a WebSocket connection. The trade-off is less predictability: the model may speak before it has finished reasoning, and interrupting or steering the conversation requires voice-activity detection and careful session management rather than a simple text buffer.

Sources

Turn detection (VAD)Know when the caller has actually finished speaking.

Voice activity detection (VAD) is the component that decides when the caller has finished speaking and the system should respond. Poor endpointing is one of the most user-visible failures in voice agents: respond too early and you cut the caller off mid-thought; wait too long and the silence feels broken.

Silero VAD is a lightweight, accurate, open-source option that runs in under 1ms per audio chunk and can be embedded in the audio processing pipeline before the transcript is sent to the model. Tuning the speech-probability threshold and the minimum silence duration for your audio conditions, rather than relying on defaults, is the difference between a demo that works in quiet office audio and a system that works on real calls.

Sources

Full definition in the glossary
Barge-inLet the caller interrupt mid-sentence, like a real conversation.

Barge-in is the ability for a caller to interrupt the agent mid-utterance and have the agent stop speaking and start listening immediately. Without it, the user must wait for the agent to finish every sentence before they can correct a misunderstanding or add context, which makes the interaction feel robotic and frustrating.

Implementing barge-in correctly requires the audio pipeline to keep monitoring the microphone while TTS is playing, run VAD on the incoming audio, and cancel the outgoing audio stream and model response as soon as speech is detected. The OpenAI Realtime API and LiveKit both expose mechanisms for this, but wiring them together reliably, including handling false positives from room echo, takes deliberate implementation.

Sources

Technologies

OpenAI Realtime APISpeech-to-speech over a single live socket.

The OpenAI Realtime API streams speech-to-speech over a single persistent WebSocket or WebRTC connection, keeping the audio session alive for a full conversation turn without re-establishing connections on every utterance. It handles turn detection, interruption, and audio input and output as first-class protocol events.

For production deployments, the connection management overhead is significant: you need to handle reconnects, session timeouts, and out-of-order events gracefully. Most teams layer LiveKit or a similar WebRTC transport on top to handle the media routing and browser-facing connection, using the Realtime API for the model side only.

Sources

LiveKitRealtime audio transport for voice agents.

LiveKit is an open-source, WebRTC-based media transport layer designed for low-latency audio and video in AI agent pipelines. It handles the browser-to-server audio routing, room management, and media encoding, so your agent code can focus on STT, model, and TTS logic without building WebRTC infrastructure from scratch.

The LiveKit Agents framework provides Python and Node.js SDKs with built-in connectors for common STT, TTS, and LLM providers, plus a plugin for the OpenAI Realtime API. For voice agents that need to run at scale, LiveKit's hosted cloud handles the media routing tier, and its self-hosted option satisfies data-residency requirements.

Sources

In production

The discipline that separates a shipped system from a demo.

Budget end-to-end latencySTT plus model plus TTS must land under ~800ms or the conversation feels broken.

A conversational voice agent has roughly 800ms of total budget from when the user stops speaking to when the agent's first audio byte reaches their ear. That budget must cover VAD endpointing, audio encoding and transmission, STT transcription, LLM first-token latency, TTS time-to-first-audio-chunk, and network delivery. Each stage compounds, so a 300ms STT plus a 400ms LLM plus a 250ms TTS already exceeds the budget before counting network.

The practice is to break the budget down per stage, measure each one under production network conditions, and optimize the bottleneck rather than all stages equally. Streaming TTS is often the highest-leverage fix because it lets audio start playing while the model is still generating text.

Sources

Handle barge-in and silenceInterruption and endpointing are the gap between a demo and a usable call.

Interruption handling and endpointing are the two places where demos fall apart and real calls succeed or fail. Endpointing errors make the agent talk over the caller or pause awkwardly; missing barge-in makes users repeat themselves and lose trust in the system.

Handling both correctly requires tuning VAD thresholds for your specific audio environment, testing with real callers who have accents and hesitations, and building the state machine that cancels in-flight TTS cleanly when a barge-in is detected. Silence handling also includes graceful fallbacks when the caller goes quiet unexpectedly, which is different from the normal end-of-turn silence the VAD looks for.

Sources

Insurance · Voice

We shipped this layer in AVOX.

An insurance voice agent that handles policy, claim, and payment questions over the phone through MCP tools. Fast, fully auditable, and built to hold its response time under heavy call volume.

Time to respond
900ms
Read the case study

Put this whole roadmap on your team.

Every layer above is someone you can hire, production-proven and embedded in your team in days. Tell us what you are building and we will line up a shortlist.