Reputation: 33
I have come across multiple different libraries for accessing Google LLMs. I am listing the ones I came across; but there may be more.
The libraries that I have seen so far:
# 1
from langchain_google_genai import ChatGoogleGenerativeAI, GoogleGenerativeAI
# 2
from langchain.chat_models import ChatVertexAI
#3
from langchain_google_vertexai import ChatVertexAI, VertexAI, VertexAIEmbeddings
#4
import vertexai
from vertexai.generative_models import GenerativeModel
from vertexai.language_models import TextGenerationModel
# 5
from google.generativeai import GenerativeModel
My questions:
I have looked into Google Cloud Documentation, but did not come across any conclusive guide.
I have tried checking the Google Cloud Documentation, but did not come accross a conclusive guide.
Upvotes: 1
Views: 382
Reputation: 6812
Google has 2 sets of APIs that support Gemini LLMs: "Google AI" (not part of Google Cloud) and "Google Cloud Vertex AI" (part of Google Cloud). The APIs are pretty much identical, although there are some features in "Google Cloud Vertex AI" that do not exist in "Google AI".
The official namespace of the Python SDK for Gemini in "Google AI" is google.generativeai.generative_models
.
The official namespace of the Python SDK for Gemini in "Google Cloud Vertex AI" is vertexai.generative_models
.
The LangChain libraries are wrappers of those Google libraries and APIs.
Upvotes: 3