System Design: Voice Assistant (Walnut Voice: Wake Word, Streaming Speech, Turn-Taking, Actions That Run Once, Many Devices, Holiday Peaks, Privacy)
We design a voice assistant and call it Walnut Voice. It listens for a short phrase, hears a request and answers out loud. It also sets timers, turns on lights and books tables.
It runs on Walnut speakers, Walnut phones and the Walnut app. People wake it by saying "Hey Walnut", or press a button in the app and in a car.
In our cloud, speech becomes text and a language model chooses the answer. Then the answer becomes speech again.
The device does what must be fast, private or work without the internet. It hears the wake word, stops an answer, rings timers and turns on lights.
Every number here is our own planning assumption, and the design is our own. All times are US Eastern. All people, companies, devices and IDs are made up; the cities are real.
How to read this post. It takes about 90 minutes, so read it in parts:
1. Requirements
1.1 What we are building
Walnut Voice serves about 300 million active devices in about 120 million homes, which make about 2 billion requests a day. It answers out loud about 1 second after the person stops, and acts once in the home and in the world.
The story takes place in Columbus, Ohio, on Thursday 26 November 2026. That day is Thanksgiving, a US holiday when families meet for a big meal, often a roast turkey.
Karen and Tom Hughes are at home with their children: Lily is 12 and Noah is 8. Tom's mother Ruth, 78, is visiting. The home has a kitchen speaker, a living room speaker and Karen's Walnut phone.
Dev Raman is our on-call engineer, in Seattle. What happens, and how it ends:
- 07:30. Karen says "Hey Walnut, start a turkey timer for 4 hours" in the kitchen, and her phone hears it too. Only the kitchen speaker answers, 0.61 seconds after she stops. The timer lives on the speaker.
- 07:31. Karen asks Walnut Voice to remember that the turkey went in at 7:30. At 10:00 Tom asks, and learns it.
- 08:05. Tom asks how long a 20-pound turkey takes at 325 degrees: about 9 kg, at about 163 °C. His answer begins 1.04 seconds after his last word.
- 09:15. The internet goes down for 20 minutes. Tom's dining room lights still turn on within 2 seconds. Ruth's question about snow gets "I cannot reach the internet right now", and at 09:36 she hears the forecast.
- 11:30. The turkey timer rings in the kitchen, and Karen stops it.
- 11:32. Ruth asks the living room speaker to book a table for six at Maple Table, a restaurant, for Friday at 7 PM. After her yes, a network drop loses Maple Table's first answer. The table is still booked once, as confirmation number MT-4821, and Ruth then asks for the number again.
- 13:00. Noah interrupts a long answer about turkeys: "Hey Walnut, stop! Tell me a joke." It stops 50 ms after his wake word ends, and Walnut Voice keeps only the part he heard.
- 15:10. A pie ad on the living room TV says "Hey, all-nut pie lovers!" The speaker's light turns on. The cloud check stops the upload after 0.4 seconds, and nothing is kept.
- 18:00 to 22:00. Millions of new speakers from early Black Friday sales are set up. Black Friday, the day after Thanksgiving, is a big day for sales. No existing user is turned away: Dev is paged at 19:41 and borrows 80 GPUs from 19:44 to 22:10.
- 19:40. Lily sets up her new speaker. It works by 19:44 with a shorter welcome, and knows the family's voices at once.
- 20:40. A video on Lily's tablet plays a command people cannot hear: buy a $500 gift card. Nothing is bought, and Karen gets a notice.
- 22:30. Karen deletes the day's history in the app. Two seconds later the day's key is destroyed, so no copy of that day's words and audio can be read. The 41 transcripts and 29 recordings leave our live stores within 11 minutes.
The hard part has four sides:
- Fast and natural. People expect an answer as fast as a person's, yet three models run one after another.
- Always listening, rarely sending. 300 million devices hear every word in their rooms, and almost all of it must stay there.
- Actions in a messy world. Networks drop, people interrupt and several devices hear one request. A table must still be booked once.
- A holiday peak. One evening a year brings 3 times the daily average load, much of it from new devices.
1.2 Words we use
Sound and speech:
| Word | Meaning here |
|---|---|
| Wake word | The phrase that starts a request: "Hey Walnut" |
| Wake check | A model that scores from 0 to 1 how much a sound is like the wake word. Two run on the device, one in the cloud |
| False wake | A sound that is not the wake word but passes the device's checks |
| Pre-roll | The 0.5 seconds of sound before the wake word, sent so the cloud check hears the whole phrase |
| Audio upload | One request's audio, sent in 20 ms frames from the pre-roll until the cloud says stop |
| Sound print | A short code made from audio. The same ad played twice gives the same print. Two people saying "Hey Walnut" do not |
| Opus | A common format for compressed speech |
| Speech-to-text | A model that turns speech into words as they are spoken: partial words first, then final words with times |
| Text-to-speech | A model that turns text into speech |
| End of turn | The moment we decide the person has finished |
| Barge-in | A person speaking over the assistant to stop or change its answer |
| Heard until | How far an answer had played when it stopped, in milliseconds |
Models and GPUs:
| Word | Meaning here |
|---|---|
| Language model | A model that reads and writes text, one token at a time |
| Token | A piece of a word. 100 tokens are about 75 English words |
| Small model | Our language model with 8 billion weights, the numbers it learned in training. It carries out commands and passes questions on |
| Large model | Our language model with 70 billion weights of 1 byte each. It answers questions and plans actions |
| CPU | An ordinary processor. It is cheaper than a GPU for short jobs |
| GPU | A chip that runs models. Ours have 180 GB of memory and cost about $8.17 an hour each |
| Stream | One turn a GPU is serving, also called a GPU stream. Each step writes one token for every stream |
| First token | The first piece of a model's answer. Time to first token is how long it takes |
| KV cache | GPU memory holding what the model already read in a turn, so it need not read it again |
| Batch work | GPU jobs that can wait hours, such as testing a new model. On a busy night they give their GPUs back |
Turns and actions:
| Word | Meaning here |
|---|---|
| Request, turn | One thing a person asks, from the wake word to the end of the answer |
| Command | A request that is an action in clear words, such as "stop". The large model answers the others, called questions |
| Directive | An order from the cloud to a device, such as "set a timer" |
| Tool | A function the model may ask us to run, such as book_table |
| Idempotency key | A unique ID sent with an action. A partner that sees it twice acts only once |
| Intent key | A code made from the home, the tool and its main details. The same intent key again within 24 hours needs a new yes |
| Follow-up window | The 8 seconds after an answer, when the device listens with no wake word |
Homes, devices and people:
| Word | Meaning here |
|---|---|
| Home, household | All devices and people on one Walnut account |
| Profile | One person in a home: an adult or a kid. A voice that matches no profile is a guest |
| Voice ID | Telling who speaks by comparing their voice with the home's voice prints |
| Voice print | 256 numbers made from a person's voice when they set up voice ID |
| Voice code | A 4-digit code an adult sets for buying by voice |
| Local hub | Code on each speaker that gives orders to lights and plugs over the home network |
| Local smart-home standard | A shared way for lights, plugs and locks from any maker to take orders over the home network |
| Firmware | The speaker's own software, updated by download |
Where things run:
| Word | Meaning here |
|---|---|
| Region | Where we run servers: US East, US West, Europe and Asia. Columbus uses US East |
| Paired region | The region that keeps a copy of another's important data. US East and US West are a pair |
| Zone | One data center building in a region. Each region has three |
| p50, p95 | The value that 50, or 95, of every 100 requests stay under |
| Shed | To turn off extra work on purpose so the main work keeps going |
| CDN | A content delivery network: a company that keeps copies of files on servers in many cities, near the people who download them |
IDs in the story:
| ID | What it names | Example from the story |
|---|---|---|
| hh_20417 | A household ID | The Hughes home |
| dev_4410 | A device ID | The kitchen speaker |
| dev_4411 | A device ID | The living room speaker |
| dev_4412 | A device ID | Karen's Walnut phone |
| dev_5502 | A device ID | Lily's new speaker |
| tu_7f31 | A turn ID | Karen's turkey timer, 07:30 |
| tu_9a62 | A turn ID | Ruth's "Yes" to the booking, 11:32:20 |
| tm_8841 | A timer ID | The turkey timer, ringing at 11:30:03 |
| act_5508 | An action ID, made from the turn ID and the tool call number, and sent as the idempotency key | Ruth's booking at Maple Table |
| ik_9c41 | An intent key | Ruth's booking: Maple Table, Friday 19:00, six people |
| MT-4821 | A confirmation number from Maple Table | Ruth's table |
| dk_7702 | A day key ID | Encrypts the words and audio of every Hughes turn on 26 November |
1.3 Every kind of request and change
| Kind | What it is | How big or how often | Part that handles it | Outside company that takes part |
|---|---|---|---|---|
| Wake event | A device's two checks pass, and an audio upload starts | 2.3 billion a day: 2 billion requests and 300 million false wakes | Voice gateway, Wake check | none |
| Command | Timers, alarms, lights, volume, stop | 60% of requests, 1.2 billion a day | Small model, Action service, the devices | Makers of lights and plugs |
| Question | A request the large model must answer | 40% of requests, 800 million a day | Large model | A weather data company |
| Outside action | Bookings, rides and food orders | About 20 million a day | Action service | Partners such as Maple Table |
| Purchase by voice | Buying with the card on the account | About 2 million a day | Action service, Voice ID service | A card payment company |
| Arbitration | Two or more devices hear one request, and one must answer | About 30% of requests | Arbiter | none |
| Device setup | A new device joins a home | About 200,000 a day; 2.75 million an hour at Thanksgiving evening's peak | Setup service, Device registry | A CDN company, for firmware |
| Memory | "Remember that..." and later questions | About 10 million new facts a day | Memory store | none |
| History and deletes | People read or delete what was said | About 1 million deletes a day | Privacy service | none |
| Notices | A refused purchase, told to the adults' apps | A few thousand a day | Action service | A push notification company |
| Settings | Profiles, the voice code and what a home keeps | A few million a day | Account service, Profile store | none |
| Offline command | Lights, timers and stop with no internet | Not seen by the cloud | Local hub, on-device commands | Makers of lights and plugs |
1.4 Functional requirements
- Wake. Hear "Hey Walnut" on speakers and phones, and take a button press in the app and the car.
- Answer. Turn speech into text, choose an answer with a language model, and speak it as it is made.
- Take turns. Decide when the person has finished, and stop at once when interrupted.
- Act. Run timers, alarms, lights and plugs. Play music, and use outside services such as restaurant bookings.
- Confirm and run once. Read back bookings, messages and purchases in full, and wait for a yes. Run each action once.
- Share a home. When several devices hear one request, one answers. Tell people apart by voice, with profiles for adults and kids.
- Context and memory. Answer follow-up questions, and keep facts a person asks it to remember.
- Set up devices. Register a new device, give it its wake word model and link it to a home.
- Privacy. Show what was said, and delete it on request. Keep recordings only by choice, with human review opt-in. Refuse commands hidden in sound.
- Offline basics. Timers, alarms, stop and local lights work with no internet.
Out of scope:
- business phone lines and outgoing calls;
- training the speech and language models;
- a store for outside developers' voice apps;
- the music and podcast catalogs, which come from partners.
1.5 Non-functional requirements
- Fast answers. First audio at p50 within 1.1 seconds after the person stops for a question, 650 ms for a command. Within 2 seconds at p95.
- Quick stop. A speaking device goes quiet within 150 ms after the end of "Hey Walnut".
- Wake word. At least 94 of 100 real wake words are caught. Fewer than 2 false uploads a day per device reach the cloud, and about 1 a week gets an answer.
- Nothing before the wake word. No sound leaves a device before its two checks pass, except that request's 0.5-second pre-roll.
- Actions once. A booking or purchase happens at most once per yes, through retries, drops and restarts.
- Offline basics. With no internet, timers ring on time and local lights turn on within 2 seconds.
- Available. 99.95% of requests in a month get an answer, which allows about 22 minutes of failure.
- Peak. Thanksgiving evening's 69,000 requests a second are served with no existing user refused.
- Region loss. Devices of a lost region connect to its paired region within 5 minutes.
- Deletion. A deleted day leaves our live stores within 1 hour. Its key is destroyed at once, so every other copy is unreadable.
1.6 The numbers
We use three load words. The daily average spreads a day's total over 86,400 seconds. The busy evening is 2 times that, and Thanksgiving evening 3 times.
Each GPU pool also keeps 20% spare, so a lost zone or a busy minute does not fill it. So each GPU count is given twice: for the load, then with spare.
| Number | How we get it | Result | What it decides |
|---|---|---|---|
| Requests | 2 billion a day ÷ 86,400 seconds = 23,000 a second. The busy evening is 46,000. Thanksgiving evening is 69,000 | 69,000 a second at the design peak | Every part is sized for it. Beyond it, new turns are delayed or shortened, never running ones |
| Open connections | 300 million devices × 10 KB of memory each = 3 TB. One ping every 60 seconds = 5 million pings a second | 300 million connections, 3 TB | The Voice gateway only holds connections and no turn state. A restart loses connections, not data |
| False wakes | 300 million devices × about 1 false wake a day = 300 million a day ÷ 86,400 = 3,500 a second. The cloud check scores every upload: 69,000 + 3,500 = 72,500 a second × 5 ms of CPU | 13% of a day's uploads; about 360 CPU cores | A check on CPUs runs before speech-to-text. CPUs are cheaper than GPUs for a 5 ms job |
| Audio up | 69,000 requests a second × 4 seconds of audio each = 276,000 uploads at once × 24 kbit/s | About 6.6 Gb/s | The network is cheap, so the heavy speech models run in the cloud |
| Speech GPUs | Speech-to-text: 276,000 uploads ÷ 400 streams a GPU = 690. Text-to-speech: 0.6 × 2 seconds of speech for a command + 0.4 × 12 for a question = 6 seconds a request. 69,000 × 6 = 414,000 seconds of speech a second ÷ 600 a GPU = 690 | 1,380 GPUs; 1,656 with spare | False wakes the cloud check rejects never reach these GPUs |
| Model GPUs | Small model, every request: 69,000 × 0.3 seconds = 20,700 streams ÷ 200 a GPU = 104. Large model, 40% of requests: 27,600 × 1.2 seconds = 33,120 streams ÷ 62 a GPU = 534 | 638 GPUs; 766 with spare | Commands stop at the small model. All requests on the large model would need 69,000 × 1.2 ÷ 62 = 1,335, or 1,602 with spare: 836 more |
| Voice ID GPUs | 69,000 voices a second ÷ about 2,000 a GPU | 35 GPUs; 42 with spare | A small model, so it adds little cost |
| Cost per request | With spare: speech-to-text 828 + text-to-speech 828 + small model 125 + large model 641 + voice ID 42 = 2,464 GPUs × $8.17 an hour × 24 hours = $483,000 a day ÷ 2 billion requests | About $0.00024 a request | The small model saves 836 GPUs, about $164,000 a day. At night the fleet's spare GPUs run batch work |
| Recordings | 2 billion requests × 30% from homes that save recordings × 12 KB = 7.2 TB a day. 12 KB is 4 seconds at 24 kbit/s. Kept up to 18 months, about 548 days | About 3.9 PB | An object store, with one key per home per day so a delete makes every copy unreadable |
How long each request holds a GPU stream:
- Text-to-speech, 600 seconds of speech a second per GPU. One GPU serves about 40 streams. Each makes speech about 15 times faster than it plays.
- Small model, 0.3 seconds. A command's action takes about 60 ms. Then the short line to say, about 10 tokens at 40 a second, brings it to about 0.31 seconds. A question stops after 60 ms, so the average is about 0.21 seconds and 0.3 is a safe size.
- Large model, 1.2 seconds. A spoken answer is about 36 tokens: 12 seconds of speech at 3 tokens a second. The first token takes 0.3 seconds, then 36 tokens ÷ 40 a second = 0.9 seconds.
What these numbers tell us. The hard part is time and GPUs, not bytes. A request has about 1 second across three models, and GPUs are almost the whole cost. So each request goes to the cheapest model that can do it.