Building a Production Coding Agent Model with Speed and Intelligence

cursor · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production coding-agent model training for an AI IDE

Cursor needed a coding-agent model that was fast enough for synchronous developer flow while still smart enough to solve real software engineering tasks, use IDE tools, and improve from production-like reinforcement-learning rollouts.

Constraints:

Architecture

Cursor built Composer as a specialized coding-agent model trained with reinforcement learning in a production-like IDE environment. The system combines a trainer for model updates, a Ray-backed inference server for rollouts and tool execution, and environment servers/cloud VMs that load user code, run tools, edit files, and mirror Cursor's production agent surface. Composer is optimized for fast token generation, parallel tool calls, semantic code search, and agent behavior that searches and reads before editing.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  cursor-ide[Cursor IDE] --> cursor-backend[Cursor backend]
  cursor-backend --> composer-model[Composer model]
  composer-model --> tool-interface[Tool interface]
  tool-interface --> semantic-search-tool[Semantic search tool]
  tool-interface --> environment-servers[Environment servers]
  environment-servers --> cloud-vm-fleet[Cloud VM fleet]
  composer-model --> inference-server[Inference server]
  inference-server --> environment-servers
  inference-server --> training-server[Training server]
  training-server --> custom-kernel-training-stack[Custom kernel training stack]
  custom-kernel-training-stack --> inference-server
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Cursor IDE Developer-facing environment where users submit coding tasks and Composer operates in foreground workflows. Cursor backend, Composer model
Cursor backend Receives user queries and routes them into the agent/model execution path. Cursor IDE, Composer model, Tool interface
Composer model Specialized fast coding-agent model that plans tool use, reads/searches files, edits code, and runs commands. Cursor backend, Tool interface, Inference server, Semantic search tool
Tool interface Cursor agent tool surface for reading files, editing files, codebase search, lint inspection, and terminal commands. Composer model, Semantic search tool, Environment servers
Semantic search tool Custom embedding-backed code search that lets the agent find files through natural-language queries. Tool interface, Composer model
Training server PyTorch-based model training stack that consumes rollout advantages and updates model weights. Inference server, Custom kernel training stack
Custom kernel training stack Low-precision training kernels that speed mixture-of-experts training and weight shipment to inference. Training server, Inference server
Inference server Ray-backed rollout manager that executes tool-calling rollouts, load-balances uneven work, and exchanges weights/advantages with training. Composer model, Training server, Environment servers
Environment servers Production-like Cursor environments used during RL rollouts to run tools and return tool results. Inference server, Tool interface, Cloud VM fleet
Cloud VM fleet Secure sandbox fleet, originally aligned with Cursor cloud agents, that loads code and executes agent actions for training and offline agents. Environment servers

Data flow

In product use, a Cursor user submits a query, Composer decides which IDE tools to call, reads/searches/edits/runs commands, and returns a result quickly enough to keep the developer in the loop. In training, the inference server runs multiple rollouts in Cursor-like environments, scores outputs, sends advantages back to the trainer, receives updated weights, and load-balances uneven rollouts across threads, processes, and cloud VM environments.

4 supporting quotes
“a user kind of submits a query to our backend. The agent reads that query and then decides to make a series of tool calls”transcript, stated
“we score the output, we decide which one is better and then we update the parameters of our model based on that change”transcript, stated
“the inference server can basically send these advantages back to the trainer, which is like nudging it up or down uh based on the roll out”transcript, stated
“each one of these VMs loads up the user's code. It allows the agent to kind of like make file changes, run tools, and edit code in a secure sandbox”transcript, stated

Why this architecture

Cursor built a specialized model and production-matching RL stack because a generic frontier-only strategy left developers waiting, while a mocked training environment would not teach the agent to use Cursor's real tools. The co-designed IDE, cloud-agent infrastructure, semantic search, custom kernels, and rollout load balancing let the model learn fast, practical tool use in conditions close to actual product use.

4 supporting quotes
“inside of cursor. and we wanted to take that same approach for a very low latency model and apply it to coding with agents. But honestly, we weren't really sure if it would work. So, we started prototyping some early versions of what this model could look like, started to put it out and get some”transcript, stated
“our goal with reinforcement learning here is to try to mirror the cursor production environment as close as we possibly can”transcript, stated
“having both the coding agent, the IDE, as well as what we're doing with the model research and training our own models is we can kind of co-design these things together”transcript, stated
“trained composer in the exact same environment that we're using at inference time. And so the model kind of becomes a power user of this tool”transcript, stated

Models used: Cursor Composer · Tab autocomplete model · custom embedding model · large mixture-of-experts model · GPT 5.1 Codex · Sonnet 4.5

Scale

Alternatives considered (roads not taken)

Use only the most powerful frontier model for coding-agent work

Rejected because: The middle latency band broke flow; Cursor wanted either very fast synchronous work or long autonomous background execution, so Composer optimized the fast foreground lane.

“airplane Wi-Fi sometimes cuz if it's taking 10 or 20 minutes, you're in this weird I think Swiss called it semi async valley of death where you either want something that's really fast or you want the most powerful most intelligent model that can run for you know a”transcript, stated
“you either want something that's really fast or you want the most powerful most intelligent model that can run for you know a significantly long amount of time”transcript, stated

Mock or simulate the Cursor environment loosely during training

Rejected because: Cursor wanted exact tool formats, tool responses, and environment behavior so the model would transfer to production use.

“If we want to mimic the production cursor environment as close as possible, we need to use exactly the same tool format and the tool response”transcript, stated
“We could mock it, we could simulate it out. Um, but one of the really nice benefits is we get to give the model uh specific tools”transcript, stated

Run coding tools serially by default

Rejected because: Parallel tool calls made Composer feel faster and helped reach a checkpoint developers would use daily.

“one big change here that helped actually push this towards a level where we had a checkpoint where people would use it was being able to call tools in parallel”transcript, stated
“helpful. So for example, instead of reading a file one by one, you can read 10 files in parallel with tool calling. And as you saw in the demo earlier, it makes composer feel much faster when you have that. And we think this is kind of just the start. there's a lot more we”transcript, stated

Wait for uneven RL rollouts to finish together

Rejected because: Rollouts finish at different times, so the inference server load-balances across threads and processes to reduce idle time.

“The challenge here uh is that they all complete at different times. So kind of a naive version of this there will be a lot of wasted time”transcript, stated
“do load balancing across the different threads and processes to basically shift the work around and and not have a bunch of idle time”transcript, stated

Build a general-intelligence model

Rejected because: Cursor focused RL, data, and compute on the narrower objective of excellent coding models.

“at cursor we're not trying to build general intelligence. We're not trying to build AGI. We're trying to build very good coding models”transcript, stated
“RL can work surprisingly well for training very specific models and you know giving it this high quality data and a decent amount of compute”transcript, stated

Patterns

fine-tuning-adaptation (model-training)

Cursor used reinforcement learning rollouts in a production-like coding environment to adapt Composer into a specialized coding-agent model.

“our goal with reinforcement learning here is to try to mirror the cursor production environment as close as we possibly can”transcript, stated
“as we trained and kind of threw more compute at it the performance continued to increase”transcript, stated

tool-use-orchestration (agent-architecture)

Composer chooses among file reading, editing, search, lint, and shell tools, including deciding when to call them serially or in parallel.

“reading files, editing files, searching your codebase, looking at lints, and then also running terminal or shell commands”transcript, stated
“And the agent then is able to autonomously decide, do we call these serially or do we run these in parallel?”transcript, stated

eval-driven-development (evaluation)

Cursor judged Composer checkpoints against internal benchmarks based on its own repositories and whether its developers would use the checkpoint daily.

“we really worked on making this internal benchmark that represented our usage on our own repos and how we actually built software”transcript, stated
“a checkpoint that our developers would use every single day to build the product and to build all of our software”transcript, stated

latency-optimization (production-performance)

Composer trades a small amount of absolute frontier intelligence for much faster generation and parallel tool use so coding agents can remain foreground and flow-preserving.

“where it really shines is it's about four times more efficient at token generation than models at a similar level of intelligence”transcript, stated
“This really does help keep you in the flow and is a kind of a different”transcript, stated

hybrid-search (agent-context)

Cursor gives Composer semantic codebase search from a custom embedding model so the agent can retrieve likely files before editing.

“we've trained our own embedding model that allows you to do semantic search”transcript, stated
“it allows the agent to make natural langu natural language queries to find files that it might want to edit”transcript, stated

Tradeoffs

Optimize Composer for fast foreground coding rather than maximum frontier intelligence

Chose near-frontier speed-oriented model over the slowest most capable frontier model for every coding task.

Rationale: Cursor wanted to avoid the semi-async latency valley and keep developers in flow while preserving enough intelligence for real work.

“It's like up against recent Frontier models but kind of slightly below the latest frontier”transcript, stated
“it's about four times more efficient at token generation than models at a similar level of intelligence”transcript, stated

Train in production-like environments

Chose cloud VM environments that mirror Cursor production over mocked or simplified tool simulations.

Rationale: Production fidelity gives the model real tool affordances and helps transfer learned behavior to the product.

“we have an environment that very closely matches the production cursor environment and we can then use that for training”transcript, stated
“We could mock it, we could simulate it out. Um, but one of the really nice benefits is we get to give the model uh specific tools”transcript, stated

Use custom low-precision kernels

Chose custom kernels for low-precision mixture-of-experts training over slower standard training implementation.

Rationale: Cursor needed to speed up training and make updated weights easier to ship back to inference.

“develop a library of custom kernels that allowed for very low precision training”transcript, stated
“this allows us to just speed up the training process in a big way and also make it much easier to ship to our inference server”transcript, stated

Let Composer call tools in parallel

Chose parallel tool execution when useful over serial file-by-file tool use.

Rationale: Parallel reads and searches reduce end-to-end wait time and make Composer feel faster to developers.

“being able to call tools in parallel and being able to very effectively use our semantic search tool”transcript, stated
“instead of reading a file one by one, you can read 10 files in parallel with tool calling”transcript, stated

Specialize on coding instead of broad AGI

Chose high-quality coding data and domain-specific RL over general-intelligence model training.

Rationale: Cursor's product goal was excellent coding agents, and RL worked well for the specific task.

“We're not trying to build AGI. We're trying to build very good coding models”transcript, stated
“RL can work surprisingly well for training very specific models and you know giving it this high quality data and a decent amount of compute”transcript, stated

Gotchas (what bit them)

A fast model was not useful until it was smart enough for daily coding.

Root cause: The early Cheetah/Slug-style model had appealing speed but did not yet meet users' intelligence threshold for regular work.

Resolution: Cursor built internal production-like benchmarks and RL training until developers would use the checkpoint every day.

“they really like the speed, but the feedback we got was it's not really smart enough yet to be a daily driver”transcript, stated
“if we had a model that was both fast and smart and a checkpoint that our developers would use every single day”transcript, stated

RL training quality depended on matching production tool behavior.

Root cause: Training with different tool formats or responses would create a gap from how Composer behaves inside Cursor.

Resolution: Cursor built environment servers and cloud VMs that closely match the production Cursor environment.

“The first one is trying to match the training and inference environment. So when the model is actually being used in the product.”transcript, stated
“we need to use exactly the same tool format and the tool response”transcript, stated

Rollout workloads had uneven lengths and could waste compute.

Root cause: Different rollouts use different numbers of tokens, tool calls, package installs, and command durations.

Resolution: The inference server load-balances across threads and processes instead of waiting for the slowest rollout.

“One might make a lot of tool calls, one might make not as many, and they'll complete a different time”transcript, stated
“do load balancing across the different threads and processes to basically shift the work around and and not have a bunch of idle time”transcript, stated

The model initially edited too aggressively.

Root cause: Early agent behavior made too many or unnecessary edits before gathering enough context.

Resolution: More RL training improved search/read-before-edit behavior.

“in the beginning, the model was was kind of making too many edits. Sometimes the edits were made unnecessarily”transcript, stated
“the model actually got surprisingly better at learning to search and read files more. So, it would go and find the right thing before it tried to make edits”transcript, stated

Model research turned into an infrastructure problem.

Root cause: Fast large-model training, spiky rollouts, environment fidelity, VM orchestration, and tool execution all required systems work.

Resolution: Cursor co-designed the IDE, cloud-agent infrastructure, inference server, training stack, and custom kernels with the model work.

“We have these three machine learning challenges and all of the solutions coincidentally are actually infrastructure problems”transcript, stated
“it was interesting to see how much of the ML work and the training process was actually also an infrastructure problem”transcript, stated

Evaluation

Cursor evaluated Composer with internal benchmarks based on its own repos and workflows, checkpoint usefulness for daily product development, rollout scoring during RL, benchmark comparisons to open-source/frontier coding models, user feedback from early releases, and behavioral observations such as parallel tool use and reduced unnecessary edits.

Metrics: internal benchmark performance on Cursor repositories · developer daily-use threshold for model checkpoints · token generation efficiency versus similar-intelligence models · rollout scores and advantages · performance against open-source and frontier coding models · parallel tool-use effectiveness · frequency of unnecessary edits

4 supporting quotes
“we really worked on making this internal benchmark that represented our usage on our own repos and how we actually built software”transcript, stated
“we score the output, we decide which one is better and then we update the parameters of our model based on that change”transcript, stated
“we kind of knew that RL was working when we were able to continuously improve the model and start to see more and more improvements after more and more rollouts”transcript, stated
“people actually really liked it. Uh they really like the speed, but the feedback we got was it's not really smart enough yet”transcript, stated

Outcomes

The training setup involved a large mixture-of-experts model parallelized across thousands of GPUs, rollouts with hundreds of thousands to millions of tokens and hundreds of tool calls, custom kernels with about a 3.5x MoE speedup on Blackwell, and many clusters with hundreds of thousands of VMs.

4 supporting quotes
“we released composer last month in comp uh cursor 2.0 and so far seems like people seem to like it”transcript, stated
“It's better than the best open source models. It's like up against recent Frontier models but kind of slightly below the latest frontier”transcript, stated
“the performance continued to increase and to a point today where we're close to the frontier in terms of kind of the best coding agents”transcript, stated
“our entire team uses cursor to help them write code and debug code more efficiently”transcript, stated