This is a course about AI SDK, but without a connection to an LLM (to a model) you cannot go much far.
Let’s be honest, you cannot go anywhere 😅
Besides the setup of the project, that you can help yourself by cloning and following the instruction in this repo , once you have AI SDK in your system it’s time to select a model.
The selection can be something fundamental, but with AI SDK its easier than you think because to use a specific model, all you have to do is to install the right package. AI SDK has tens of providers to choose from, Matt suggest to use the Gemini API because are cheap and have a generous free plan 😉
So once you have completed the setup and installed the right package for your provider, it’s time to make it to work.
import { google } from "@ai-sdk/google";
With this single import, and the appropriate API KEY stored in your .env and you’re ready to go!
If you’re wondering about “How AI SDK knows which name I gave to my API KEY? you have not to worry about. If you follow the documentation for the selected provider you’ll find the exact name to use. With
GOOGLE_GENERATIVE_AI_API_KEY