Reputation: 17118
I am trying to use the vertex API Text embedding using Langchain4J, in Micronaut application
@Singleton
public record VertexAiEmbedding(GoogleCloudConfiguration googleCloudConfiguration, VertexAiConfig vertexAiConfig) implements IVertexAiEmbedding {
private static Embedding embedding;
@Override
public float[] embedVector(String text) {
EmbeddingModel embeddingModel = VertexAiEmbeddingModel.builder()
.endpoint(vertexAiConfig.endPoint())
.project(googleCloudConfiguration.getProjectId())
.location(vertexAiConfig.location())
.publisher(vertexAiConfig.publisher())
.modelName(vertexAiConfig.modelName())
.build();
Response<Embedding> response = embeddingModel.embed(text);
embedding = response.content();
return embedding.vector();
}
Exception: Caused by: com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: Quota exceeded for quota metric 'LLM utility requests' and limit 'LLM utility requests per minute per region' of service 'aiplatform.googleapis.com' for consumer 'project_number:974067563912'.
I am using the free trial period in GCP.
Updated
Credit
Upvotes: 1
Views: 304
Reputation: 1
The issue with quota is related to your billing account and if you are using free account then this will restrict you. Another thing you can try is fetching less data ( less number of records may be try testing on a limited records) using vertex AI.
Upvotes: 0