> For the complete documentation index, see [llms.txt](https://bigdeckit.gitbook.io/myfitnessplan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bigdeckit.gitbook.io/myfitnessplan/user-guide/ai-plan-builder.md).

# AI Plan Builder

Optional: let an AI model draft a plan from your own videos.

*Optional.* Describe the plan you want and an AI model drafts it **from your own videos**: the right number of workout days, the equipment you have, the albums you choose. You can save the draft as it is, or open it in the [plan builder](/myfitnessplan/user-guide/plans-and-the-plan-builder.md) to fine-tune it.

It's off until you set it up, and MyFitnessPlan works fully without it.

## Setting it up

Go to **Settings → AI**.

![Settings – AI](https://2578926258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNMxAGZl4qp2DlaZfSUyP%2Fuploads%2FcqIGm6IQaTlAXmjaee5Y%2Fsettings_ai.png?alt=media)

1. Choose a provider:
   * **Claude (Anthropic)**, or
   * **OpenAI-compatible:** pick **OpenAI** or **OpenRouter**, run a model on your own computer with **Ollama** or **LM Studio**, or type the address of any other OpenAI-compatible service.
2. Paste your **API key** (not needed for a model running on your own computer). It's stored only on this computer and never shown again.
3. Click **Save key and load models**, then pick a **Model** from the list your provider offers.
4. **Test connection** to check it works.

AI settings belong to each [profile](/myfitnessplan/user-guide/profiles.md), and start switched off for new profiles. Your key is never included in backups.

{% hint style="info" %}
Using a cloud provider sends your plan request and your videos' titles and tags to that provider, and may cost money on your account with them. A local model (Ollama, LM Studio) keeps everything on your computer.
{% endhint %}

## Building a plan with AI

On **Plans**, click **Build with AI** (it appears once AI is set up). Then answer the questions:

* **What do you want from this plan?** In your own words, for example *"I want to tone my legs. I live upstairs, so nothing with jumping."*
* **Focus areas.**
* **How many workout days?** That's exactly how many sessions you get. Rest days come from the rhythm.
* **Workout rhythm:** your default or one for this plan. See [Workout Rhythm](/myfitnessplan/user-guide/workout-rhythm.md).
* **Equipment** you have *(optional)*.
* **Albums / folders** to use *(optional)*: click once to use only that one, again to leave it out. You can also include or skip subfolders.

The draft appears as a preview of its days, with a description of the structure the model chose. **Save** it straight away, or **Open in plan builder** to fine-tune it first. If your library can't fill every day you asked for, it tells you how many it managed.

In **Settings → AI** you can also choose whether the questions appear **all on one page** or **one step at a time**.

**Related:** [Plans and the Plan Builder](/myfitnessplan/user-guide/plans-and-the-plan-builder.md) · [Video Library → Tags](/myfitnessplan/user-guide/video-library.md#tags)
