spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/index.html
Apache License 2.0
3.33k stars 855 forks source link

dislodge google vertex embedding model from chat model #1579

Open joshlong opened 1 month ago

joshlong commented 1 month ago

i want to use gemini. gemini doesn't appear to have an embedding model. vertex does tho. so i add that starter, it brings in the vertex chat model, which conflicts with gemini's chat model. so i can't use either.

perhaps we could disintegrate the vertex embedding model from the vertex chat model, so that i could send the signal to spring ai that i want the vertex embedding model but not the chat model and i want the gemini chat model?

my hope is that two starters become three, but failign that perhaps we could at least take the vertex auto configuration and split it up into two - one for the chat model and another for the embedding model - so that a user could exclude the chat model?

ddobrin commented 1 month ago

Would this work, by adding the config, without starter though

        <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-vertex-ai-embedding</artifactId>
        </dependency>

and separately you have one for the chat model

        <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-vertex-ai-gemini</artifactId>
        </dependency>
tzolov commented 1 month ago

@joshlong what boot starter deps did you use? spring-ai-vertex-ai-embedding-spring-boot-starter and spring-ai-vertex-ai-gemini-spring-boot-starter ?

tzolov commented 1 month ago

And mind that the PaM2 is decommissioned by Google: https://docs.spring.io/spring-ai/reference/api/chat/vertexai-palm2-chat.html

joshlong commented 1 month ago

Hi if I go to start.Spring.io and add Gemini and pgvector I get errors about embedding. No embedding model. I'm AFK so can't verify atm.

I think, ok, I'll add vertex ai palm on start.spring.io. That has an embedding model. I can use that embedding model and Gemini w/ pgvector. Doesn't work. Because palm 2 ALSO contribute a ChatModel. The ChatModel is conflicting with Gemini ChatModel.