Tafy, A Meal Planner and Recipe Generator for Busy Devs!
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-15 06:23:11

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*


## What I Built

Tafy is an intuitive meal planner that takes all of the pain out of planning your meals for the week by generating recipes.

## Demo

You can demo the application here --> [https://tafy.recipes](https://tafy.recipes)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tyzkeyap6tsmnjczealf.gif)

## My Code

You can peruse at your leisure here: [tafy-demo](https://github.com/tafy-io/tafy-demo)

## Journey

This project has been something that I've been stewing on for years (pun intended)!  I decided to pursue it as a business, then shortly after ChatGPT came out and I thought I was done for ... but then I realized that it would just make it that much better!

I decided to do this as soon as I heard about the challenge (about 5 days ago!) so I got to work, and decided to beg my family for forgiveness later - sorry, honey!

In my work, I've been doing freelance with LLMs and generative AI and so I've been following the space heavily, and learned recently about `CopilotKit` in an article on dev.to.  So I had to try it!

With that, I had to hack it a bit to get the tooling to work with Cloudflare since a lot of text generation models don't support calling tools.  Luckily, `@hf/nousresearch/hermes-2-pro-mistral-7b` hosted in Cloudflare Workers AI was able to rescue me, but the model did break my search integration.

I also decided to go with the `@cf/bytedance/stable-diffusion-xl` model for generating images, and so far I've been really impressed!

Finally, I'm using OpenAI's text-to-speech model for verbal descriptions of the meal plans. Though I was hoping to turn this into a means of getting a recipe read off to you while you make it, I actually like the smooth-jazz DJ AI voice-over while I'm looking at the sweet pics of the food that it comes up with!

I'm proud of what I've been able to accomplish what I did in such a short time, but I couldn't have done it without the help of folks in chat - thank you!!!

Check out my README on GitHub for a list of things that I'll be working on next, and maybe someday, if everything works out, I'll make (this website)[https://tafy.io] live!

<!-- Tell us about your process, the task types and models you used, what you learned, anything you are particularly proud of, what you hope to do next, etc. -->

**Multiple Models and/or Triple Task Types**

I used multiple models and tasks:

**Models**

1. `@hf/nousresearch/hermes-2-pro-mistral-7b`
2. `@cf/bytedance/stable-diffusion-xl`
3. OpenAI text-to-speech

**Tasks**

I'm not sure what constitutes as a task, so I'll take a shot here...

[x] The LLM calls tools which equate to "research," each a text generation task in its own right: search, curate, write, critique, revise.
[x] The recipe's summary is sent to OpenAI's text-to-speech API.
[x] Cloudflare Worker - text to image conversion.
[x] Web search (partial, this works with GPT-4, but not Hermes because I can't get it to output JSON).

Things I didn't get to, but may be partially setup:

[] Vectorize store with recipes deposited and used to supplement.
[] Preferences stored on disk, in a DB, or in object storage.

<!-- Let us know if your project utilized multiple models per task and/or if your project used three or more task types. If so, you may qualify for our additional prize categories! If not, please remove this section. -->

<!-- Don't forget to add a cover image or an additional tag to this post (if you want). -->

<!-- Thanks for participating! -->