All jobs / AI engineer / Open-Source & Local Models
AI engineer interview question · 3–5 years
A self-hosted model loads fine on the GPU and answers short prompts. With long documents, or several users at once, it runs out of memory.
A self-hosted model runs out of GPU memory only on long prompts or with several users. Why, and how do you plan capacity properly?
The strongest answer
Weights are only part of it: the KV cache grows with context length and with concurrent sequences. I budget weights plus cache for the longest context and the concurrency I must serve, and cap both
Why it works
Exactly — the model “fitting” is only the start. Serving memory is the weights plus per-token cache for everything in flight, and limits on context and concurrency keep you inside it.
What a good answer covers
- Serving memory: weights plus KV cache.
- Cache grows with context length.
- And with concurrent requests.
- Budget for both; cap both.
Answers that fall short
- Close, but not the strongest: It is running out of memory, so we need a GPU with more memory on it
Maybe, but without knowing what consumes the memory you cannot size the new card either. Explain the cache first. - Weak: Long prompts take more time but not more memory, so this must be a driver or library bug
Every token held in context keeps cached attention state on the GPU, so memory grows with length and with each concurrent request. - Red flag: Quietly truncate every prompt to a short length so the crashes stop, and tell nobody
Silent truncation turns a crash into wrong answers nobody can explain, which is worse — and hiding it is worse still.
Who gets asked this
More Open-Source & Local Models questions
- You serve a model through an inference server such as vLLM. What does continuous batching give you, and what…
- Leadership asks whether to self-host an open-weight model or keep paying for a hosted API. How do you frame…
- A customer insists that the model must run locally “for privacy”. What do you do with that requirement?
- What is the difference between an “open-weight” model and an open-source one, and why does it matter to you…
- What does a bigger model buy you, what does it cost, and how do you choose a size?
- What is quantization, and what do you give up for it?
- The team wants to serve real users from the laptop prototype’s local runner. What do you tell them?