
In this video, I show you how you can quickly get up and running with the new Google Gemini models that were just released today. I touch on Gemini Pro, Gemini Pro Vision as well as give a quick overview on how to set up a google cloud account, vertex ai, model garden as well as a simple javascript example with node.js. Links coming soon! Connect and Support I'm the developer behind Developers Digest. If you find my work helpful or enjoy what I do, consider supporting me. Here are a few ways you can do that: Patreon: Support me on Patreon at patreon.com/DevelopersDigest Buy Me A Coffee: You can buy me a coffee at buymeacoffee.com/developersdigest Website: Check out my website at developersdigest.tech Github: Follow me on GitHub at github.com/developersdigest Twitter: Follow me on Twitter at twitter.com/dev__digest
--- type: transcript date: 2023-12-14 youtube_id: oJDBCA7ftjw --- # Transcript: Google's Gemini Pro Model API in 8 Minutes in this video I'm going to be showing you how you can get up and running with the new Gemini Pro Models from Google so the Gemini Pro Models were just released today and I'm going to show you how you can get set up with a Google Cloud account if you don't already have one I'll show you the vertex AI platform their model Garden as well as both the Gemini Pro and the Gemini Pro Vision model so the first thing that you're going to have to do is if you don't have an account already just go over to cloud.google.com make an account now the nice thing making an account is if you haven't made one already you're likely going to get a considerable amount of free credits right off the bat so you will need a credit card to sign up but don't worry about being build you won't be build until you actually activate your account so so long as you're below the threshold and within the days remaining you will be able to use all these credits for whether it's AI services or whatever else is within Google Cloud so once you're all authenticated and set up you can go ahead and within the search bar just search for vertex AI so if you come to this page for the first time you'll likely see a button that says enable all recommended apis just go ahead and click that because you'll need that in the subsequent steps here so next if we take a look at the model Garden so you'll see there's a ton of different models here so there's all the tasks there's all the modalities and right at the top here when you land on the page there's going to be their Flagship model so their Gemini pro model and then the Gemini Pro Vision model so the Gemini Ultra models those aren't coming until next year but you'll be able to find them right in this spot for when they're available so if we take a look at Gemini Pro just for a moment if you go within the model the first thing that you can do is if you want to play around with it you actually have a playground within the Google Cloud platform so similar to something like open AI where there's a playground where you can toggle around with all these different parameters right within a nice little gooey and actually query it to see what the responses you get back you can do the same thing here here so if I just say hello world you'll see it just streams all the responses back here so the one thing I noticed is the way that it streams back responses is it's not word by word or token by token it seems like the blocks of text come in in much larger chunks than what I'm typically used to with working with something like say GPT 3.5 turbo or GPT 4 and their API so that's just to give you a general sense now the thing to note with this is there is the get code button here in the right hand side here so in setting up this video I have noticed that this actually has changed and is changing uh actually in the time in the past hour or so I've seen a couple different uh deployments so this is the day of release so there's a lot of uh whe whether it's fixes or updates to their documentation that are being sort of pushed in real time so I sort of took a snapshot of an example that that I got working so if you go ahead and look at get code here and on my screen if yours looks different than mine I'll show you a working example at the end here to get you started so the other thing that I just wanted to quickly point out with Gemini provision and I'm likely going to do a video specifically on this where I focus on trying this out a little bit more in depth the thing that I thought was very neat and I didn't realize what is going to be the case with the initial release with the API is that this API actually supports video so there are some limitations but the fact that we have a multimodal model where you can you can put in images or you can put in uh videos it's pretty amazing so if you play around with this please put some comments in uh below of the video here let everyone know like how much it cost how well it worked what were some of the drawbacks or is it just uh the bees knes and the most amazing thing like good good bad whatever the results that you have uh let us know if you play around with the video portion of this I'd be really curious to hear and similar thing if you want to get the code here there's the python code the node.js code Java or the curl you can just go ahead and select which one you'd like so I'm going to be showing you the uh node.js implementation for a quick example here um before I close of the video here but you can just go ahead and play around with this and actually reach for it um hopefully there's a stable version that everyone can reach to in this example here shortly so I'm just going to show you a quick example with the Gemini pro model so I just have a very simple uh structure here now the one thing to note is for when you actually set this up you will have to install this SDK the vertex AI uh dependency here so just go ahead run that and then to actually authenticate it here here so in this example you you don't actually need to use an API key or anything like that you will need g-cloud installed so if you run this command here and you get an error just look up how to install g-cloud now when you run this for the first time you'll have the authentication window popup in Chrome and it's going to pop up as if it's like a third party app you'll just have to accept it and it's very sort of natural authentication flow so the first thing that we're going to do is we're just going to import our dependencies like we had there and then just within the example here so you see your project ID so there's different projects that you can set up within Google Cloud so as you toggle around the different projects these might look different So within your example these are going to be different so here you can specify your model then this is just going to be a sort of a basic instantiation of the uh specifications that we're going to pass to the model so first what we're going to do is we're just going to set up an asynchronous function now within the request it's similar to something like open AI so you're going to specify the role so in this case we're going to specify that it's the user and we're just going to pass in the text of hello world so the actual schema of how you pass in a request is a little bit different uh I don't know if this is going to be subject to necessarily change but this is how it's structured right now so it's a little bit different than what I've worked with with open Ai and what I'm sure a lot of you have worked with as well but uh nevertheless it will just take a little bit of time to get used to so here is where we're going to actually perform the content generation and then here is going to be where we iterate through all the responses that come back and we're just going to log them to the screen here so here again it's not the typical open AI schema there's a ton of different things that are within this object that gets returned there's uh like safety variables and all sorts of stuff within their implementation of their AI apis so it is very different so you're going to have item candidates the first item in the array content Parts Etc and then from there I'm just going to save this out and I'm just going to show you a really quick example here of what it looks like I'll also put a link link um to just a GitHub link if you're looking just to pull this down and have a working example hopefully like I said there's a good example on the examples tab there when you're actually within the platform but that's pretty much it so this is how you can get started with using their SDK and their Gemini models I'm excited to see what people build with this it's really nice to see that there's a ton of different models coming out with just a short uh sort of time frame here we have the mistral's new model coming out we have this coming out and all of these models are really high performing so I look forward to seeing what everyone builds with these things but if you found this video useful please like comment share and subscribe and otherwise until the next one
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.