WeaviateClient V4 connection details

Hi Team, we are trying to use client v4. in the connection string
client = weaviate.WeaviateClient(
Do i have to use grpc / http host always while connecting ?

How can i connect only to GRPC or HTTP alone ?

Note in V3 client i was connecting as “weaviate.client (url=“http://testing-weaviate:8080”,auth_client_secret=weaviate.auth.Auth.api_key(api_key=”******")) "
What’s the exact connection string can i use in V4 similarly ?


hi @adithya.ch !

Weaviate has introduced the GRPC connection in 1.23.7:

This means that all new Weaviate clients will also connect to Weaviate server using GRPC, and progressively implementing it instead of REST calls.

If you want to keep using only HTTP/REST, you will need to keep using the python v3 version for now.

But note that you will eventually need/want to also use GRPC as it added a lot of improvements, specially on ingestion and retrieval.

The connection parameters will vary depending on how you have deployed Weaviate.

By default, and if using the docker compose, http port will be exposed in 8080 and the grpc port will be exposed at 50051, both with XXX_secure=False.

If you need to access your cluster from the Internet, you will need to expose those ports, and if using a SSL/TLS encryption, deploy it accordingly and set the http_secure and grpc_secure to True.

If you are just running locally, using the default docker compose, for example, you can use:

client = weaviate.connect_to_local()

and it will assume those default values.

Let me know if this helps.