An interactive React application that suggests recipes based on a list of ingredients you provide.
It uses Hugging Face's Mistral AI model to generate creative, markdown-formatted recipes.
- Add Ingredients: Input any ingredients you have on hand.
- AI Recipe Suggestion: Uses Hugging Face Inference API to suggest recipes using some or all provided ingredients.
- Interactive UI: React components update dynamically when new ingredients are added.
- Markdown Recipe Output: AI returns responses in markdown format (ready for styling).
- React (Vite) for the front-end
- TailwindCSS for styling
- Hugging Face Inference API (
@huggingface/inference
) for AI-powered recipe generation - JavaScript (ES6) with modern async/await syntax
- Clone the repository
git clone https://github.com/Molo-M/chef-claude-project.git
cd chef-claude-project
- Install dependencies
npm install
- Set up environment variables
Create a
.env
file in the root directory and add:
VITE_HF_ACCESS_TOKEN=your_huggingface_api_key_here
You can get an API key from Hugging Face.
- Run the development server
npm run dev
- Open the app in your browser.
- Enter an ingredient in the text box and click + Add Ingredient.
- Repeat for all ingredients you have.
- Click "Get a recipe" to fetch a suggestion from the AI.
- The recipe will be displayed below the ingredient list.
-
When you click "Get a recipe", the app:
- Joins the list of ingredients into a single string.
- Sends the string to Hugging Face’s Mistral-7B-Instruct model with a system prompt.
- Waits for the AI's markdown-formatted recipe.
- Formats the markdown-formatted recipe into html elements using React-Markdown.
- Displays the AI response in the
ClaudeRecipe
component.
This project is licensed under the MIT License.