How To Generate Meal Plans With ChatGPT
It's surprisingly good if you do the up-front work yourself and write a good prompt
I see a lot of people these days freaking out over the possibility that AI programs will automate them right out of a job. Mostly writers and artists (I live in Hollywood), but fitness pros are no exception.
People pay me three hundred dollars a month to write workouts and meal plans for them. Can an AI really do what I do?
It turns out that yes, it sort of can. As with all usage of AI, it still takes some actual domain knowledge– you need to know what criteria to give it– so you probably couldn’t get as good of a meal plan out of it as I could write for you.
Unless I helped you of course. Which I’m going to do. Here’s how to get a $20 computer program to do something people pay me hundreds of dollars for: write you a good meal plan.
The Exact Prompt I Used And The Output I Got
I’m going to start by showing you the prompt I used and what my meal plan looked like. Then I’ll walk you through exactly how to customize this prompt for yourself to get the meal plan you need, and how to overcome a couple of technical issues that may seem like a big deal but are actually really easy to solve.
This was my prompt:
And this is the first page of the output it gave me:
Pretty cool huh? There were a couple of catches though: it only gave me about three days worth of the meal plan, and most of the links were broken.
I know. We’ll get to that in a bit– it’s actually super easy to solve. But first, the process:
Step 1: Calculate Your Nutritional Requirements
You could just tell ChatGPT how much you weigh and maybe a body fat estimate and your age, height and sex, and let it figure out your nutritional needs, but I recommend calculating your nutritional requirements yourself for two reasons.
First, ChatGPT is shockingly bad at math, the one thing you’d expect a computer to always do better than you. It does the math right for this prompt, but you still want to minimize the amount of math it has to do– especially when you’re not in a position to check its work.
Second, to the extent that ChatGPT has to think for itself, it tends to default to giving some sort of mash-up of the most common advice, rather than the best advice.
Anyway, you’ll need to weigh yourself, and ideally get your body fat percentage measured. I recommend getting a DEXA scan, which costs about $50-100. Look up DEXA scans in your area; sometimes you can find a Groupon.
If you don’t want to shell out for that, you’ll need to get the sort of tape measure that tailors use, and plug some body circumference measurements into this calculator. Full instructions on how to take the measurements can be found in this article.
Now go to this body fat calculator, click Settings and select the Katch-McArdle formula. Enter your body fat percentage and everything else the calculator asks for. Estimate your activity level as conservatively as possible.
It’ll give you calorie estimates for maintaining your weight, and various rates of weight loss. It doesn’t give you calories for bulking, but you can do that by adding 10% to the maintenance calories. Maybe 20% if you’re both very skinny and very new to weight training.
Your minimum protein requirements are .8 grams of protein per pound of bodyweight if you want to maximize muscle, and .6 grams of protein per pound of bodyweight if you’re less concerned with building or maintaining muscle. Bump the number up by 20% if you’re a vegan to compensate for the lower quality (mostly bioavailability) of vegetable proteins. If you want to know where those numbers came from, read this article by Menno Henselmans.
Now you may want to reduce these a bit to account for any additional snacks or beverages you anticipate consuming. Yes, the meal plan will include snacks, but say you want to dip those carrot sticks in ranch, add some milk to your coffee, have a post-workout cookie– you can reduce calories by up to 20% to make room for that, but don’t do more than that, because at that point you’re just defeating the point of a meal plan.
Personally, I cut a few hundred calories and 30 grams of protein to account for a daily protein shake, milk in my coffee, and a tiny bit of leeway for other stuff that might come up. If eating that much protein is hard for you, I’d do the daily protein shake between meals. Pick a case of protein shakes on Amazon and order them as “Subscribe & Save” to be delivered every 2 weeks (they usually come in cases of 12, which is close enough).
Minimum fat intake should be 20% of total calories. Fat has 9 calories per gram, so divide your calorie intake by 45 to get your minimum grams of fat per day. I put mine lower because I know I’ll snack on nuts, put whole milk in my coffee, add ranch to my carrots and celery, etc.
Carb requirements are optional; I only put them in my prompt to ensure I wouldn’t be given any kind of extreme low-carb diet. 100 grams a day is good if you want to make sure you don’t enter ketosis.
Step 2: Write Your Prompt
I’m going to walk you through each paragraph of my prompt and explain how to customize it for yourself.
I want you to act as a nutritionist. You will design a meal plan for me according to the following criteria:
Use this as-is. This “I want you to act as a (profession) phrasing followed by a brief description of the task is a standard best practice for prompting.
I need to eat approximately 2200 calories a day, give or take a hundred calories. I also need to eat at least 110 grams of protein, 100 grams of carbohydrates and 40 grams of fat every day. Each meal must contain at least 30 grams of protein.
This is where you put in your nutritional requirements from step 1. Additionally, you want to spread protein intake somewhat evenly throughout the day and not have any low-protein meals. With 3 meals a day, you want at least 25% of your daily protein intake in each meal. With 4 meals a day, you want at least 20% of your daily protein intake with each meal.
Note that I want to eat roughly the same number of calories every day, hence the “give or take 100 calories” part. If you want to have high- and low-calorie days, you should say something like the following:
“I need to eat 2200 calories on an average day, but I have high-calorie and low-calorie days. My high-calorie days are Monday, Wednesday and Friday, and the other days are low-calorie days. Increase my calorie and protein intake by 10-20% on high-calorie days, and reduce it by 5-15% on low calorie days. Over the course of the week, my daily intake should still average out to (calorie and macronutrient intakes you previously determined).”
The meal plan should include three meals a day: breakfast, lunch and dinner. Of the three, breakfast should have the fewest calories and carbohydrates, but should still have at least 30 grams of protein. Dinner should be the most high-carb meal of the three.
Start by telling it how many meals a day you want, then add any preferences for how macronutrients are spread throughout the day. I’m not usually very hungry in the mornings, plus I usually work out between breakfast and lunch, so lunch and dinner are muscle-building meals for me and breakfast isn’t so much.
The thing about dinner having the most carbs is because high-carb meals can make you sleepy, as carbs cause the brain to produce serotonin, which is the precursor to melatonin. Most people also prefer dinner to be their most “fun” meal, which is perfectly fine.
My nutritional requirements are roughly the same every day.
I didn’t need to say this, but I did for the sake of this section of the article. I work out every day, or at least try to, so I don’t calorie cycle from day to day, but I already addressed how to do that. My calorie cycling is that I have a smaller breakfast and bigger lunches and dinners.
I want to eat at least 5 servings of vegetables and 3 servings of fruit per day, and at least two meals a day should contain animal protein.
I probably didn’t need to say this, honestly. This part is just insurance against ChatGPT making any weird decisions that leave out important food groups.
I have no specific food allergies. However, I do wish to limit my intake of gluten and FODMAPs.
List any food allergies here, or more general nutritional requirements. If you get too nitpicky, ChatGPT can have trouble finding good recipes, so don’t go overboard. The FODMAP thing did give it some trouble in some of the variations on this I tried, because that’s a less-used term. You can also soften your language a bit by saying things like “somewhat limit” or “limit my intake of X in most meals” to let it know it has some leeway.
I eat a wide variety of foods, however I don’t like food that is very spicy– I do enjoy mildly spicy food though. I also want my meals to use affordable ingredients. I wish to only cook one item per meal, but each meal may include side dishes that don’t require much preparation, such as apple slices or carrot sticks.
This is all personal preferences. If you want to avoid or explore certain cuisines, or hate seafood or whatever, put it here. Note that the mention of snacks and side dishes is why I had snacks listed in the output I got.
Speaking of which it doesn’t include quantities for those– I assume large fruits like apples and bananas means eat one per day, and small items like nuts or berries means out a handful per day. Carrots and celery have almost no calories so you don’t need to count them, but you do need to count anything you put on them like ranch or almond butter– the fat from those adds up fast!
Please provide me with a one-week meal plan consisting of three meals per day. For each meal, give me the name of every dish included along with a link to the recipe, estimated prep time, and calorie and macronutrient counts for the entire meal.
After giving it all your requirements, you need to be clear on exactly what you want the output to look like. Use this part exactly as I worded it, and you’ll get about two or three days of your seven-day meal plan, with broken links.
So About Those Technical Issues….
Like I said, this is easy to fix.
First off, there’s a limit to how long a ChatGPT output can get, and a seven-day meal plan is well over that limit. It tends to end mid-sentence or mid-paragraph when it hits the limit.
When it does this, all you have to do it type “Continue.” as the next prompt and it will continue on with the rest of the output.
In this case it also did something I haven’t seen before: it said “For the sake of space, I'll skip days 3-6 and go straight to day 7.” All I had to do was write “Please provide me with the meal plans for days 3-6 as well.” Not a problem.
So about the fact that most of the links were broken.
I did this with GPT-4, without the optional web search, meaning it was looking at an archived version of the entire internet circa 2021. Either a lot of recipes from back then have been moved or deleted, or something about how it archives pages ruins a lot of the links.
I tried GPT 3.5, since that’s free, and it had the same broken link problem. Worse, it couldn’t do the calorie math and gave me meals that added up to 1300-1500 calories a day.
GPT-4 with Bing web search gave me links that worked, but it was waaaay slower, kept getting hung up on the gluten and FODMAP stuff, added a whole bunch of unnecessary exposition instead of the nice, simple format you see in the screenshots, and only gave me two recipes per output.
You should use GPT 4 without web search. Most of the links will probably be broken, but remember that GPT has an archived version of every web page it’s referencing. All you have to do is this:
Just do this for each recipe. GPT-4 uses a lot of computing resources, so they limit you to 25 queries with it per 3 hours. That means you’ll need to split this up into two sessions.
Anyway, copy and paste the meal plan and individual recipes into a word processor file and you’ve got your one-week meal plan.
If you want another week of meals, just ask it to give you another week of meals according to the same criteria. Or you can modify it, like say “Include more ethnic dishes this week,” or “Only give me meals with prep times under 45 minutes.” You can also say “You can re-use (meals you liked the most) but otherwise give me new ones.”
And that’s all there is to it. You can also use GPT to write workouts for you— like this, it requires you to figure out some requirements up front. I’ll explain how to do that in another article.
I am currently creating the same type of mega prompt. I will edit based on what I learned from this post. Thanks!
Very useful, thank you.