How Brilliant Used Faster Inference to Remove an Entire Cache Layer

With a dedicated GLM-5.2 endpoint on Wafer, Brilliant reported ~250 ms time to first token and 300+ output tokens per second. That speed let its engineers remove speculative prefetching, simplify their stack, and lower inference costs.

~250 ms
Time to first token
300+ tok/s
Output generation speed
50%
Inference cost reduction

Performance reported by Brilliant.

  • GLM-5.2
  • Dedicated Endpoint
  • AI Tutoring

A Personal Tutor for More People

Brilliant is making personal tutoring in math and coding more accessible. Its AI tutor, Koji, works inside interactive lessons, using the problem on screen and the learner’s attempts to help them work through the next step. The goal is to build the learner’s ability to solve problems. We’re proud to support that work.

Meet Koji

Help at the moment a learner gets stuck.

A learner works through a problem. Koji provides guidance in the lesson, so they can understand the next step and keep going.

Product demo from Brilliant

For this to work well, Koji needs to respond in less than 2 seconds when a learner asks for help. To respond quickly enough, Brilliant had built extra infrastructure to speed up responses.

Generating Answers Before Anyone Asked

Koji sometimes asks Yes or No questions, like “Does this make sense?” In those cases, Brilliant starts preparing the follow-up response to either option so they can deliver it instantly when the user taps their answer. This generalizes to other scenarios, like multiple choice questions (“Is it A, B, or C?”).

This speculative prefetching kept those interactions fast, but it also meant generating answers that might never be used.

A large share of Brilliant’s traffic went to this background work. Its engineers also had to maintain the code that generated, stored, and served those responses.

Before Wafer

Prepare answers before the learner asks

Brilliant generated complete responses to expected user inputs, then stored those responses in an application cache.

  1. 01

    Generate ahead

    Prepare multiple possible answers.

  2. 02

    Store responses

    Save the complete answers in a cache.

  3. 03

    Learner selects

    The learner selects a response.

  4. 04

    Tutor responds

    Return the corresponding saved answer.

Unselected answers can go unused. The cache still needs to be built and maintained.

With Wafer

Generate the answer when the learner asks

The optimized dedicated endpoint made on-demand responses fast enough for Brilliant to remove its speculative cache layer.

  1. 01

    Learner asks

    A question starts the request.

  2. 02

    Dedicated GLM-5.2

    Wafer generates the answer on demand.

  3. 03

    Tutor responds

    The answer goes straight to the learner.

No speculative answer generation. No application cache of pre-generated responses.

Simplified application workflow. The removed cache stored complete answers. Model prefix caching is separate.

An Endpoint Tuned to Brilliant’s Tutor

We worked with Brilliant to deploy GLM-5.2 on a dedicated Wafer endpoint. We tested sample requests and structured tool responses, then tuned the serving configuration for the tutor’s request volume and response requirements.

The setup combined prompt-prefix caching with speculative decoding and a serving configuration tuned for low request concurrency. We also identified shared instructions appearing after problem-specific content in Brilliant’s prompts and recommended moving them to the beginning. This let the endpoint reuse more of the prompt computation across requests.

On Wafer, Brilliant reported ~250 ms time to first token and 300+ output tokens per second. The team had previously reported 85 to 100 output tokens per second on Fireworks GLM-5.2 Fast.

Reported output speed

Output tokens/sec · Higher is faster

  • FireworksGLM-5.2 Fast
    85–100 output tokens per second
  • WaferDedicated endpoint
    300+ output tokens per second

That performance gave Brilliant a new option: generate answers when learners actually asked for them.

Deleting the Workaround

Brilliant tested the tutor without prefetching, removed the feature, and completed its migration to Wafer. The team could delete an entire application cache layer and stop generating those answers in advance.

The response times on Wafer have been fast enough that we were able to remove the entire prefetching layer. This was a huge simplification in our stack and lowered our inference costs by 50%!

Ben GoldsmithBrilliant

Koji could answer on demand, and Brilliant’s engineers had a simpler backend to maintain. The speed improvement removed work from both the inference system and the team building the tutor.

Build Your Real-Time AI Application With Wafer

Talk to Wafer about a dedicated deployment tuned to your application.