Cutting our inference bill by 68% by being obsessive about optimization
Cloudflare cut its AI code review costs by 68% through optimization after prices rose without architectural changes.
Overview
Cloudflare reported that the cost of their AI code reviews rose from $1.19 in April to $2.46 by August. This increase happened because engineers created larger and more complex changes that required more intensive reviews. The company also switched to Anthropic models, which improved performance but raised the price per job. In mid-September, the team focused on reducing the number of tokensA short-lived digital pass that a server gives a logged-in user or app used by the system. They achieved a 68% cost reduction, bringing the average review price down to $0.77. The median review time also dropped from 4m 09s to 1m 32s.
Terms in this story
- token
- A short-lived digital pass that a server gives a logged-in user or app. After you sign in once, your browser or app presents a token on each request, and if malware steals that token the attacker can act as you without knowing your password. Security+ objective 4.6 lists the term
- inference
- Running a trained artificial intelligence model on new input to generate an answer or prediction. Training builds the AI model once, while inference happens every time a user sends a prompt to a chatbot, which is where prompt injection and data leaks occur.
- prompt
- The text instruction or question a user or program sends to an artificial intelligence model. In AI security news, a prompt includes both the visible question typed by a user and the hidden instructions that an attacker might embed in a web page.
- workload
- An application, service, or computing task running on a server, virtual machine, or cloud cluster. Cloud security platforms protect each workload by assigning it a dedicated identity and watching which network connections and files that specific task touches.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Cloudflare website. Cite the article, not this page.
Read the full article on Cloudflare (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Research and reports
"Our main goal was to cut costs, but as part of this work we also managed to optimize the reviewer..." Found by reading the article; these exact words are in it - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"When our AI code reviewer's cost per run doubled, we..." Found in the opening sentences - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Develop cost estimates for new or modified system(s).
"Our main goal was to cut costs, but as part of this work we also managed to optimize the reviewer..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role