← Questions

Apply model edits to a file with an AST and model routing

0
CursorAI system

An AI code editor lets a user ask for a change; a strong model answers with a sketch of the edit (the changed functions, with comments standing in for untouched code). Design the system that turns that sketch into an exact, reviewable edit of the file within about two seconds, and the router that decides which model (a fast small one or a frontier one) handles each request: tab completions, inline edits, chat and agent steps. Cover the apply step (structural versus model rewrite), validation, latency and cost numbers, and fallbacks when a model provider degrades.

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing