Google Gemini is the name of a new AI model developed by Google DeepMind. It is built from the ground up for multimodality, meaning it can reason seamlessly across text, images, video, audio, and code. Gemini is the first model to outperform human experts on Massive Multitask Language Understanding (MMLU), one of the most popular methods to test the knowledge and problem-solving abilities of AI models. It also surpasses state-of-the-art performance on a range of benchmarks including text and coding. Comprising Gemini Ultra, Gemini Pro, and Gemini Nano, it was announced on December 6, 2023, positioned as a contender to OpenAI’s GPT-4.

To use Google Gemini, you will have to go to Google DeepMind site’s technologies page: https://deepmind.google/technologies/gemini/#introduction
Or directly start it from https://ai.google.dev/ to get your own API key. 

Unfortunately, Google made it only available for certain countries. (https://ai.google.dev/available_regions)

You still can use it throguh Google Cloud Vertex AI via the Gemini API, but if your country is not in the list, you even wont be able to get your own API. 
In this blog post, I am gonna share a way to create your own Google Gemini Chat app and you wont be limited anymore with this way. 

Price Model

https://ai.google.dev/pricing
As on Jan 2024, free plan allows 60 QPM (Queries per minutes)

GeminiProChat Project in Github

https://github.com/babaohuang/GeminiProChat?tab=readme-ov-file

1 Method 1

Deploy With Vercel(Recommended)

Deploy with Vercel

Just click the button above and follow the instructions to deploy your own copy of the app.

2 Deploy with Netlify

Deploy With Netlify

Deploy to Netlify

  1. Go to this palm-netlify-proxy repo and click “Deploy With Netlify”.
  2. Once the deployment is complete, you will receive a domain name assigned by Netlify (e.g., https://xxx.netlify.app).
  3. In your Gemini Pro Chat project, set an environment variable named API_BASE_URL with the value being the domain you got from deploying the palm proxy (https://xxx.netlify.app).
  4. Redeploy your Gemini Pro Chat project to finalize the configuration. This should resolve the issue.

3 Deploy on Zeabur

Deploy on Zeabur

Deploy on Zeabur

4 Deploy with Docker


docker run --name geminiprochat \
--restart always \
-p 3000:3000 \
-itd \
-e GEMINI_API_KEY=your_api_key_here \
babaohuang/geminiprochat:latest
Replace your_api_key_here with your own GEMINI API key.

Get Your GEMINI API Key

From https://ai.google.dev page, click Get API key in Google AI studio. You might need to find a machine with US Public IP address to do this.

https://makersuite.google.com/app/apikey

Test with your curl command using api key
curl \
  -H 'Content-Type: application/json' \
  -d '{"contents":[{"parts":[{"text":"Write a story about a magic backpack"}]}]}' \
  -X POST https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=AIzaSyBRJXDms8I4IrHr82024Dv8f9x01riDZhye1c

Deploy with vercel

 Deploy With Vercel(Recommended)

Deploy with Vercel

Deployment information:

Domain settings in Vercel

Cloudflare settings

Demo: https://ai.51sec.org

Videos

References

  • https://ai.google.dev/

By netsec

Leave a Reply