# Common pitfalls when building generative AI applications

DevFeed: [Common pitfalls when building generative AI applications](<https://devfeed.tech/articles/common-pitfalls-when-building-generative-ai-applications-31802.md>)

Original publisher: [Read original article](<https://huyenchip.com//2025/01/16/ai-engineering-pitfalls.html>)

Author: Chip Huyen

Published: 2025-01-16T00:00:00Z

Content type: opinion

Language: en

Sources: [Chip Huyen](<https://devfeed.tech/sources/chip-huyen.md>)

Topics: [Generative AI](<https://devfeed.tech/topics/generative-ai.md>), [foundation-models](<https://devfeed.tech/topics/foundation-models.md>), [AI Development](<https://devfeed.tech/topics/ai-development.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [foundation-models](<https://devfeed.tech/tags/foundation-models.md>), [generative-ai](<https://devfeed.tech/tags/generative-ai.md>), [llm](<https://devfeed.tech/tags/llm.md>), [mistakes](<https://devfeed.tech/tags/mistakes.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [pitfalls](<https://devfeed.tech/tags/pitfalls.md>)

## AI overview

This article discusses common pitfalls in building applications with foundation models. It cautions against using generative AI where simpler optimization methods may be cheaper and more reliable, and distinguishes solving a problem from merely testing whether generative AI can be applied.

## Source excerpt

As we're still in the early days of building applications with foundation models, it's normal to make mistakes. This is a quick note with examples of some of the most common pitfalls that I've seen, both from public case studies and from my personal experience. Because these pitfalls are common, if you've worked on any AI product, you've probably seen them before. 1. Use generative AI when you don't need generative AI Every time there's a new technology, I can hear the collective sigh of senior engineers everywhere: "Not everything is a nail." Generative AI isn't an exception -- its seemingly limitless capabilities only exacerbate the tendency to use generative AI for everything. A team pitched me the idea of using generative AI to optimize energy consumption. They fed a household's list of energy-intensive activities and hourly electricity prices into an LLM, then asked it to create a schedule to minimize energy costs. Their experiments showed that this could help reduce a household's electricity bill by 30%. Free money. Why wouldn't anyone want to use their app? I asked: "How does it compare to simply scheduling the most energy-intensive activities when electricity is cheapest? Say, doing your laundry and charging your car after 10pm?" They said they would try it later and let me know. They never followed up, but they abandoned this app soon after. I suspect that this greedy scheduling can be quite effective. Even if it's not, there are other much cheaper and more reliable optimization solutions than generative AI, like linear programming. I've seen this scenario over and over again. A big company wants to use generative AI to detect anomalies in network traffic. Another wants to predict upcoming customer call volume. A hospital wants to detect whether a patient is malnourished (really not recommended). It can often be beneficial to explore a new approach to get a sense of what's possible, as long as you're aware that your goal isn't to solve a problem but to test