Reliability
Retries, timeouts, caches, limits and budgets.
0 of 9 solved · 0 of 210 XPStart: Debounce: do not call the model on every keystroke
- 1Debounce: do not call the model on every keystrokeAn autocomplete that sends a prompt per keystroke saturates the server. Wait until the user stops typing.Easy · 10 min · 10 XP
- 2An LRU cache for model answersWhen two users ask the same question there is no need to generate again. Keep the latest answers and drop the least used.Medium · 15 min · 20 XP
- 3Retries with exponential backoffA busy model fails now and then. Retry without hammering the server: 100, 200, 400 ms.Medium · 15 min · 20 XP
- 4Cut slow calls with AbortControllerA saturated model server can take minutes. Set a time limit and actually cancel the request.Medium · 15 min · 20 XP
- 5Limit concurrent requestsSending 50 prompts at once to a local model only fills its queue. Process them two at a time and keep the order.Medium · 20 min · 20 XP
- 6An embeddings cache keyed by content hashRe-indexing should not recompute what has not changed. Store each vector under the hash of its text and send the model only what is new.Medium · 20 min · 20 XP
- 7Structured output with a retry budgetWhen the model's JSON fails validation, hand the error back and let it correct, with a cap on attempts and characters.Medium · 20 min · 20 XP
- 8Rate limiting with a token bucketYour API in front of the model should accept short bursts without letting anyone hog it. A token bucket does both.Medium · 20 min · 20 XP
- 9Capstone: a client that survives a slow backendCapstonePuts the track together in one client: an LRU cache, a timeout with AbortController and retries with growing waits.Hard · 35 min · 60 XP