# Use google embeddings for local setup

**URL:** <https://forum.weaviate.io/t/use-google-embeddings-for-local-setup/21942>\
**Category:** General\
**Created:** [September 4, 2025, 12:50pm UTC](https://forum.weaviate.io/t/use-google-embeddings-for-local-setup/21942 "2025-09-04T12:50:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Joshi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/abhishek_joshi/32/559_2.png) [@Abhishek\_Joshi](https://forum.weaviate.io/u/Abhishek_Joshi)\
**Post date:** [September 4, 2025, 12:50pm UTC](https://forum.weaviate.io/t/use-google-embeddings-for-local-setup/21942/1 "2025-09-04T12:50:51Z")

</div>

```auto
I am using weaviate running through docker with following docker-compose setupservices:

```

```auto
  weaviate:

```

```auto
    command:

```

```auto
    - --host

```

```auto
    - 0.0.0.0

```

```auto
    - --port

```

```auto
    - '8080'

```

```auto
    - --scheme

```

```auto
    - http

```

```auto
    image: cr.weaviate.io/semitechnologies/weaviate:1.30.0

```

```auto
    ports:

```

```auto
    - 8080:8080

```

```auto
    - 50051:50051

```

```auto
    volumes:

```

```auto
    - weaviate_data:/var/lib/weaviate

```

```auto
    restart: on-failure:0

```

```auto
    environment:

```

```auto
      QUERY_DEFAULTS_LIMIT: 1000

```

```auto
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'

```

```auto
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'

```

```auto
      DEFAULT_VECTORIZER_MODULE: 'text2vec-google'

```

```auto
      ENABLE_MODULES: 'text2vec-google'

```

```auto
      CLUSTER_HOSTNAME: 'node1'

```

```auto
      # Google PaLM/Vertex AI configuration

```

```auto
      PALM_APIKEY: 'AIzaSyDP5WGBgFNEYiF-------------'

```

```auto
volumes:

```

```auto
  weaviate_data:

```

```auto
following is code snippet where i am trying to connect to local and creating vector configclient = weaviate.connect_to_local(

```

```auto
    host="127.0.0.1",

```

```auto
    port=8080,

```

```auto
    grpc_port=50051,

```

```auto
    headers={

```

```auto
            "X-Goog-Studio-Api-Key": "AIzaSyDP5WGBgFNEYiF————-"

```

```auto
    }

```

```auto
)  

```

```auto

```

```auto
vector_config=[

```

```auto
        Configure.Vectors.text2vec_google(

```

```auto
            name="content_vector",

```

```auto
            source_properties=["content"],

```

```auto
            # Optional: specify the model

```

```auto
            # model="text-embedding-004", # or "textembedding-gecko@001" for Vertex AI

```

```auto
            model="gemini-embedding-001", # or "textembedding-gecko@001" for Vertex AI

```

```auto
            # Optional: specify project ID if using Vertex AI

```

```auto
            project_id="my-project-name"

```

```auto
            )

```

```auto
        ],

```

i get error as  
{‘message’: ‘Failed to send all objects in a batch of 61’, ‘error’: “WeaviateInsertManyAllFailedError(‘Every object failed during insertion. Here is the set of all errors: connection to Google failed with status: 401 error: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See [https://developers.google.com/identity/sign-in/web/devconsole-project.’](https://developers.google.com/identity/sign-in/web/devconsole-project.%E2%80%99))”}

i tried playaround with code, by commenting project\_id and other, but after commenting project\_id, i get as it as required parameter, what is the solution on this

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [September 5, 2025, 8:33pm UTC](https://forum.weaviate.io/t/use-google-embeddings-for-local-setup/21942/2 "2025-09-05T20:33:43Z")

</div>

Hi! It seems that this API key is not working.

This message:

```auto
Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.’

```

comes from Google when Weaviate tries to vectorize something using that service.

LEt me know if that helps.

Thanks!
