aider icon indicating copy to clipboard operation
aider copied to clipboard

How to set-up vertex?

Open adriangalilea opened this issue 1 year ago • 3 comments

Issue

I had installed all it asked me to, and set the variables it requested, still complains about needing to install:

BadRequestError: litellm.BadRequestError: VertexAIException BadRequestError - vertexai import failed 
please run pip install -U google-cloud-aiplatform "anthropic[vertex]"

Version and model info

No response

adriangalilea avatar Aug 02 '24 20:08 adriangalilea

Thanks for trying aider and filing this issue.

Did you do the pip install that the error specified?

paul-gauthier avatar Aug 02 '24 20:08 paul-gauthier

Thanks for trying aider and filing this issue.

Did you do the pip install that the error specified?

Yup, and installed the google cloud cli in order to authenticate and so on, and nothing, no idea.

adriangalilea avatar Aug 03 '24 00:08 adriangalilea

Did you install aider with pip or pipx? You'd need to install the google packages differently if you installed aider with pipx.

paul-gauthier avatar Aug 05 '24 14:08 paul-gauthier

Did you install aider with pip or pipx? You'd need to install the google packages differently if you installed aider with pipx.

I did install with pipx how shall I do it?

adriangalilea avatar Aug 05 '24 18:08 adriangalilea

@adriangalilea , I am using vertex AI and this is all I have to do

pip install google-cloud-aiplatform "anthropic[vertex]"

but additionally - you have to make sure you are logged in with gcloud auth login and is connected to the right project which has Vertex AI by checking gcloud config get-value project and if you need to change it gcloud config set project your-project-name

sholub89 avatar Aug 05 '24 18:08 sholub89

@adriangalilea , also after doing the above it is sometimes required to close the current terminal window and open a new one so the changes will apply. Try that and I hope this will work for you

sholub89 avatar Aug 05 '24 18:08 sholub89

@adriangalilea , also after doing the above it is sometimes required to close the current terminal window and open a new one so the changes will apply. Try that and I hope this will work for you

Will test out in a couple weeks, thanks.

adriangalilea avatar Aug 05 '24 19:08 adriangalilea

For posterity, if your aider install is installed with uv (you can check with cat $(which aider)) you need to use uv's additional tool dependency system using --with:

uv tool install --force --python python3.12 --with google-cloud-aiplatform --with "anthropic[vertex]" aider-chat@latest

blainehansen avatar Feb 10 '25 20:02 blainehansen