Skip to content
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

Vertex AI init commit #616

Merged
merged 12 commits into from
Apr 8, 2024
Merged

Vertex AI init commit #616

merged 12 commits into from
Apr 8, 2024

Conversation

Demontego
Copy link
Contributor

This is the first phase of implementing google vertex ai in dspy. Please take a look. Write where and how best to correct, what else should be added.

@Demontego Demontego mentioned this pull request Mar 9, 2024
@Demontego Demontego changed the title init commit Vetrex AI init commit Mar 9, 2024
@skucherlapati
Copy link
Contributor

Would it be cleaner to merge this change with existing dsp.modules.google?

@Demontego
Copy link
Contributor Author

Google GenAI and Google Vertex AI are two different frameworks. I think we should keep them in different modules. The issue #463 asked to make a separate file googlevertexai.

@insop
Copy link
Contributor

insop commented Mar 9, 2024

@Demontego
Please also consider adding documentation.

@Demontego
Copy link
Contributor Author

Can you merge this PR?

@arnavsinghvi11
Copy link
Collaborator

arnavsinghvi11 commented Mar 18, 2024

Thanks @Demontego !

@okhat will this need an update to dspy-ai before merging? Also, curious if this library installation can be handled outside of setup.py and mentioning the instructions in the documentation @Demontego ?

from vertexai.language_models import CodeGenerationModel, TextGenerationModel
from vertexai.preview.generative_models import GenerativeModel
except ImportError:
print("Not loading VertexAI because it is not installed.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove the print statement here to avoid printing every time someone imports dspy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do it

@marshmellow77
Copy link

marshmellow77 commented Mar 20, 2024

For what its worth: I have been testing and using this integration already for some projects and it works fine for me.

@Demontego , the title has a typo, which is why I wasn't able to find it when searching for it - could you fix that so others don't duplicate this integration?

@Demontego
Copy link
Contributor Author

up

@arnavsinghvi11
Copy link
Collaborator

arnavsinghvi11 commented Mar 24, 2024

Hi @Demontego I missed this before, but could you move the existing docs to the documentation folder as with the other LMs. Will be good to merge after that!

Comment on lines 31 to 44
"""Wrapper around GoogleVertexAI's API.

Currently supported models include `gemini-pro-1.0`.
"""

def __init__(
self, model_name: str = "text-bison@002", **kwargs,
):
"""
Parameters
----------
model : str
Which pre-trained model from Google to use?
Choices are [`text-bison@002`]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clarify what the supported models are? Additionally, model is not a parameter. model_name is. This was confusing when I was using this code for a small demo project.

Comment on lines +92 to +96
**self.kwargs,
"temperature": 0.7,
"max_output_tokens": 1024,
"top_p": 1.0,
"top_k": 1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these kwargs available for non-gemini models if they are set to defaults for non-gemini models?

@jderry-lucem
Copy link

I was using this PR for a small project, so I just wanted to give feedback. Thanks for writing this!

@RajeshThallam
Copy link

@Demontego Can you please fix the typo on the title of this PR from Vetrex AI to Vertex AI?

@Demontego Demontego changed the title Vetrex AI init commit Vertex AI init commit Mar 31, 2024
Copy link

@Josephrp Josephrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will open up possibilities for image RAG in dspy , in fact evals on image RAG in DSPy.

i'm currently initializing vertex outside DSPy for this reason.

deploying and finetuning using vertex is a large field to open up to optimizations using DSPY.

@arnavsinghvi11
Copy link
Collaborator

Hi @Demontego I missed this before, but could you move the existing docs to the documentation folder as with the other LMs. Will be good to merge after that!

Hi @Demontego , just following up on this. PR is good to merge following this!

@arnavsinghvi11 arnavsinghvi11 merged commit 890ff91 into stanfordnlp:main Apr 8, 2024
4 checks passed
@arnavsinghvi11
Copy link
Collaborator

Thanks @Demontego !

@smwitkowski
Copy link
Contributor

Thank you @Demontego! This is a great help for me :) your contribution is much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants