# Design a Multimodal Assistant at Very Large Scale

> How to design one assistant for text, photos and voice at very large scale: media, routing, latency and cost, for your AI interview.

**In short:** A multimodal assistant reads text, photos and voice in one chat. At very large scale, media goes straight to storage and is shrunk, a router picks the model, live voice and slow jobs are split, and a per-minute budget for model tokens keeps peaks under control.

AI and LLM interview question Q374, LLM system design. Advanced, occasional (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/design-a-multimodal-assistant-at-very-large-scale

## Say it in 30 seconds

A multimodal assistant takes text, photos and voice in one chat. At very large scale I send media straight to storage, shrink it, and keep only a file ID in the chat. A router picks a small or large model for each request. Live voice uses a realtime model so it stays quick. Slow photo jobs go to a queue. A token budget per minute stops one peak from breaking everyone else.

## Say it in 2 minutes

A multimodal assistant takes more than typed text. A customer can send a photo of a cracked phone, record a voice note about a bill, or type a chat. At very large scale, the hard part is getting big files in without choking your servers, keeping live voice fast, and not running out of tokens at peak.

I split the work. Media goes straight to cloud storage with a signed upload link, then gets checked and shrunk. The chat keeps a short file ID, not the file. A router reads each request and sends easy ones to a small model and hard ones to a large one. Live voice uses a realtime model that listens and speaks without a separate transcription step, which lowers the delay before the reply.

Slow jobs, such as a claim photo, go to a queue, and the customer is told when to expect an answer. At peak I rate-limit each customer, scale the workers up, and keep reserved room for live calls. I also set a token budget per minute, because image tokens count toward those limits. That way the system slows down on purpose, so it does not fail for everyone.

I would say honestly that the numbers here are made up. Before launch I would measure the real ones with load tests and a cost dashboard.

## What is a multimodal assistant, in plain words?

A multimodal assistant takes more than typed text. In one chat, a customer can send a photo, record a voice note, or type a question. The assistant reads all of it and answers in one thread.

Think of a triage nurse at a busy hospital front desk. A patient may hand over a form, show a rash, or describe pain on the phone. The nurse sends each case to the right place, and only the hard ones reach the doctor. A multimodal system works the same way: cheap steps first, and the big model only when it is needed.

- **Token:** The unit a model counts: a small chunk of text, or a patch of a picture, that sets the bill and the speed limit.
- **Visual token:** One small block of a picture that the model counts as a unit of work.
- **Router:** Code that reads each request and picks the model that handles it.
- **Realtime voice:** A model that listens and talks in one stream, with no separate transcription step.
- **File ID:** The ID a model provider gives an uploaded file, sent in place of the file.

Our made-up case is a mobile operator with 30 million customers. People send photos of damaged phones for insurance claims, voice notes about bills, and text chats. A typical message reads "My bill went up again and nobody has called me back." On a Monday peak, the same assistant handles tens of thousands of chats at once.

## How do photos and voice get in without slowing everything?

Avoid pushing a photo through your own web servers. The app asks for an upload slot, the phone sends the file straight to cloud storage, and a check runs on the type and size. The chat then keeps the provider's file ID, not the file.

1. **Upload straight to storage:** The phone uses a signed upload link, a temporary web address that lets it send the file straight to storage, so your servers never carry the bytes.
2. **Check before anything runs:** Reject the wrong file type and anything too large. Store the file's ID with the customer's record.
3. **Shrink to what the model needs:** Resize and compress the photo. A compressed format such as JPEG or WebP sends fewer bytes, but heavy compression can make text on a bill hard to read.
4. **Upload once, reuse the file ID:** Upload the file once to the model provider, keep the file_id it returns, and send that ID on later turns, so the bytes are not resent.

> "Upload the image once, then reference the returned file_id in subsequent messages instead of resending base64 data." (Anthropic, Claude vision docs)

Why shrink? A model turns a picture into visual tokens, and one token covers a small square of pixels. A 1,000 by 1,000 pixel photo works out to 36 by 36 squares, which is 1,296 tokens by the vendor's formula. A 512 by 512 thumbnail is 361. Big photos are also resized by the model, so check the largest size your model accepts.

Files are also an attack path. OWASP lists images among the inputs that can alter a model's behaviour, and describes an attacker hiding an instruction in an image below the human visual threshold. Treat text found in photos and voice notes as untrusted, the same as a web page.

## How do you keep replies fast at peak?

Live voice and slow jobs are different. A voice call has to answer while the customer is still talking, so it gets its own path. A claim photo can wait a short while for its check, so it goes to a queue.

> "One of the most powerful features of the Realtime API is voice-to-voice interaction with the model, without an intermediate text-to-speech or speech-to-text step." (OpenAI, Realtime API)

*Diagram, Two speeds for one assistant: Live voice and slow jobs take separate paths, then meet in one reply. A live call never waits behind a queue of claim photos.*
1. A live call goes straight to a realtime model.
2. A photo or voice note waits in a queue, after upload.
3. The live answer is spoken back during the call.
4. The queued job posts its answer later, in the same thread.

Live voice uses a realtime model, so the audio is not turned into text and back before an answer. The alternative is a speech model that turns audio into text, which adds a step. Speech models of that kind are trained on large amounts of audio transcripts.

1. **Scale the workers with the queue:** Add capacity as the queue grows. AWS's guidance is to use auto-scaling (adding servers automatically as load grows), rate limits and throttling, and to design for bursts.
2. **Rate-limit each customer:** One customer in a loop must not use up the peak for everyone else.
3. **Batch requests on your own GPUs:** If you host the model yourself, serve many requests together. vLLM documents continuous batching, which adds new incoming requests to the batch that is already running. GPU memory limits how many fit, and the PagedAttention paper says poor memory handling can waste much of it.
4. **Reserve room for live calls:** Keep a set share of capacity for voice, so a queue of photos can never block a call.

Latency, the wait before a reply starts, is a budget you set in advance. AWS calls inference latency, the time a model takes to produce a reply, critical for real-time applications. Pick a target for each path, then measure it. Meta tested adding image, video and speech to Llama 3 through a compositional approach, which joins separate parts to one language model. The paper says those versions were not yet broadly released. A model that takes every input natively is the other route. Each one trades quality, speed and cost differently.

## How do you keep cost and limits under control?

Tokens are both the bill and the speed limit. OpenAI's docs say image tokens count toward tokens per minute limits, so a flood of photos can use up the shared per-minute budget.

Choose the detail level on purpose. OpenAI says its detail setting controls how an image is prepared, so a routine check can use less detail and a claim photo more.

*Diagram, Routing each request to the cheapest model that can do it: The router reads each request first and sends it to the cheapest model that can handle it. Disputed or long work takes the large model, and every reply is checked before it goes out.*
1. The request arrives with its text, photo or audio.
2. The router sends simple work to the small model.
3. Disputed or long work goes to the large model.
4. A small-model answer goes out after its check.
5. A large-model answer goes out after the same check.

Here is a capacity check with made-up peak numbers. It turns photos per minute into image tokens per minute and compares the total with a budget.

```python
import math

PATCH = 28  # pixels per side of one visual token (Claude vision docs)
BUDGET = 1_000_000  # made-up: image tokens we may send each minute
PEAK_PHOTOS = 1_200  # made-up: photos per minute at the Monday peak

def visual_tokens(width, height):
    return math.ceil(width / PATCH) * math.ceil(height / PATCH)

for label, side in [("Customer original 1000 x 1000", 1000), ("Our resize 512 x 512", 512)]:
    per_photo = visual_tokens(side, side)
    per_minute = per_photo * PEAK_PHOTOS
    verdict = "fits the budget" if per_minute <= BUDGET else "over budget, so degrade"
    print(f"{label}: {per_photo} tokens a photo, {per_minute:,} a minute, {verdict}")
```

Output:

```text
Customer original 1000 x 1000: 1296 tokens a photo, 1,555,200 a minute, over budget, so degrade
Our resize 512 x 512: 361 tokens a photo, 433,200 a minute, fits the budget
```

At peak, the original photo breaks the budget and the resized one fits. So the rule is to shrink first, then lower the detail for routine checks, then queue the rest. Live calls keep their share throughout.

### How would you handle a Monday peak with three times the usual load?

Decide the order before the peak comes, so nobody is improvising in the middle of it.

1. **Protect live calls first:** Keep the reserved voice share. A call is the one path where a delay is heard at once.
2. **Shrink photos harder:** Use a smaller size and lower detail for routine checks only, and keep text on bills readable.
3. **Queue the slow jobs:** Claim photos wait in line, and the customer sees roughly when to expect an answer.
4. **Send easy cases to the small model:** The large model works only on the disputed bills.
5. **Watch the queue age and the budget:** If the oldest job waits too long, stop taking new photos rather than slowing live calls.

Say clearly what you would not do: never drop a live call to save a photo, and never send a photo to the large model just because the small one is busy.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: one assistant for text, photos and voice, with files kept out of the chat.
- [ ] The media path: direct upload, shrink, then reuse by ID.
- [ ] Live voice and slow jobs split, and what happens to each at peak.
- [ ] A router that sends each request to the cheapest model that can do it.
- [ ] A token budget per minute, and how the system degrades when it is used up.
- [ ] Honest trade-offs, and numbers measured with load tests.

**Common traps**

- Trap: "Send every file through our API server, it's simpler." Better: Your servers then carry every byte and slow down at peak. Upload straight to storage and send an ID.
- Trap: "The biggest model handles everything." Better: It is the most expensive path for easy checks. Route small first, and escalate only when needed.
- Trap: "We'll just add more servers at peak." Better: Scaling helps only with rate limits and a budget. Without them, one spike starves the live calls.

## Can you spot the mistake?

**Spot the mistake:** A design doc for the Monday peak. Which line is the mistake?

A. Photos go to cloud storage with a signed upload link.
B. Every turn resends the full photo bytes inside the chat payload.
C. Live calls use a realtime model, and claim photos go to a queue.
D. A router picks the small or large model from the request size.

**Answer:** B. Resending the bytes on every turn makes each request bigger and slower as the chat grows. Upload once, then reuse the file ID.

**Quick check:** A cracked-phone photo lands at the Monday peak. What protects the live voice calls first?

A. Send the photo to the large model at once
B. Queue the photo and keep reserved capacity for live calls
C. Turn off the router so every request is treated the same
D. Remove the file ID from later turns

**Answer:** B. Slow jobs wait in a queue, and reserved capacity keeps live calls answering while the peak passes. A bigger model does not protect a call.

## Can you answer these from memory?

**Flash cards**

- **What is a multimodal assistant?** One assistant that takes text, photos and voice in one chat, and answers in one thread.
- **Why keep files out of the chat?** Resending bytes on every turn adds size and delay. Upload once to the provider, then send its file_id.
- **What is a visual token?** One small block of a picture that the model counts. Claude's docs use 28 by 28 pixels.
- **Live voice or a queue?** Live calls use a realtime model at once. Photos and voice notes wait in a queue.
- **What does a router do?** Reads each request and sends it to the cheapest model that can handle it.
- **How do you survive a peak?** Rate limits, scaling, reserved live capacity, a token budget, and a queue for slow jobs.

## Likely follow-up questions

- Q369 How do you design for low latency? https://designervenkat.online/interview/ai/how-do-you-design-for-low-latency
- Q372 Design an eval and monitoring platform. https://designervenkat.online/interview/ai/design-an-eval-and-monitoring-platform
- Q373 Design invoice extraction. https://designervenkat.online/interview/ai/design-invoice-extraction
- Q451 What is multimodal RAG? https://designervenkat.online/interview/ai/what-is-multimodal-rag
- Q452 Native multimodal vs pipeline approach? https://designervenkat.online/interview/ai/native-multimodal-vs-pipeline-approach
- Q455 How do you evaluate multimodal outputs? https://designervenkat.online/interview/ai/how-do-you-evaluate-multimodal-outputs

## Learn it in depth

- [AI that sees, hears and reads](https://designervenkat.online/learn/ai-engineering/multimodal-ai)
- [Watching cost and speed](https://designervenkat.online/learn/ai-engineering/cost-latency-monitoring)
