-
Notifications
You must be signed in to change notification settings - Fork 819
Vertex Model garden models #960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you have a reference to which models are you referring to? |
LIke mistral and anthropic models through vertex |
Ok @Kludex, basically you can use the already existing models, but with the vertex counterpart clients of the mistral and anthropic packages. Feels really silly that there is no docs for this. if "mistral" in model.identity.id:
import sys
from mistralai_gcp.models.usermessage import UserMessage as MistralUserMessage
sys.modules['pydantic_ai.models.mistral'].MistralUserMessage = MistralUserMessage
from mistralai_gcp import MistralGoogleCloud
self._pydantic_model = MistralModel(
model.extra['pydantic_ai_alias'],
client=MistralGoogleCloud(
project_id=provider.project_id,
region=provider.locations[0]
),
)
elif "claude" in model.identity.id:
from anthropic import AsyncAnthropicVertex
self._pydantic_model = AnthropicModel(
model.extra["pydantic_ai_alias"],
anthropic_client=AsyncAnthropicVertex(
project_id=provider.project_id,
region=provider.locations[0]
)
) |
Hey I came looking for this one - is this something one can contribute to? Would be thrilled to help out if wanted/needed/possible :) |
Hey, I had some ideas and couldn't help starting drafting: #1392 🙈 |
@ehaca The point here is that we need to use the |
You can use Anthropic's models via Anthropic itself or via GCP/AWS. For the this, the SDK offers dedicated clients that handle auth etc. currently you can plug those clients into anthropic_client and it works, but yields typing errors. I tried just extending the existing Anthropic Provider, but since Anthropic's SDK has dedicated extras for the different clients it was kind of an import mess (?). |
This comment saved me a lot of time, thanks 🙏🏻 |
Is it possible to use other models in the vertex model garden, or is it just gemini models through vertex?
The text was updated successfully, but these errors were encountered: