Allow vertex embeddings model to be selected
What does this MR do and why?
Part 1 of 4 of Vertex text embedding model discontinuation on ... (#521836 - closed):
- Allow model to be specified
👈 this MR - Add
text-embedding-005
model to Vertex supported models on AI Gateway: MR - Add
embedding_1
field to work items index: MR - Use
embedding_1
field and new model during indexing, backfillembedding_1
and switch queries to useembedding_1
and new model: MR
References
Vertex text embedding model discontinuation on ... (#521836 - closed)
How to set up and validate locally
- Checkout gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!2302 (merged) on AI Gateway
- Make sure AI Gateway is running
- Tail the AI Gateway logs:
gdk tail gitlab-ai-gateway
- Generate embeddings without a model and note the URL used is
POST /v1/proxy/vertex-ai/v1/projects/PROJECT/locations/LOCATION/publishers/google/models/textembedding-gecko%40003%3Apredict
Gitlab::Llm::VertexAi::Embeddings::Text.new("something", user: nil, tracking_context: {}, unit_primitive: 'semantic_search_issue').execute
- Generate embeddings with another model passed in and note the URL used is now
POST /v1/proxy/vertex-ai/v1/projects/PROJECT/locations/LOCATION/publishers/google/models/text-embedding-005%3Apredict
Gitlab::Llm::VertexAi::Embeddings::Text.new("something", user: nil, tracking_context: {}, unit_primitive: 'semantic_search_issue', model: 'text-embedding-005').execute
- Generate embeddings with a non-existing model passed in and note that you get an error
StandardError: Could not generate embedding: '{"detail":"Unsupported model"}'
Gitlab::Llm::VertexAi::Embeddings::Text.new("something", user: nil, tracking_context: {}, unit_primitive: 'semantic_search_issue', model: 'non-existing').execute
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #521836 (closed)
Edited by Madelein van Niekerk