# WeaviateClient V4 connection details

**URL:** <https://forum.weaviate.io/t/weaviateclient-v4-connection-details/2675>\
**Category:** General\
**Created:** [June 10, 2024, 9:42pm UTC](https://forum.weaviate.io/t/weaviateclient-v4-connection-details/2675 "2024-06-10T21:42:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adithya.ch](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/adithya.ch/32/615_2.png) [@adithya.ch](https://forum.weaviate.io/u/adithya.ch)\
**Post date:** [June 10, 2024, 9:42pm UTC](https://forum.weaviate.io/t/weaviateclient-v4-connection-details/2675/1 "2024-06-10T21:42:52Z")

</div>

Hi Team, we are trying to use client v4. in the connection string  
client = weaviate.WeaviateClient(  
connection\_params=ConnectionParams.from\_params(  
http\_host=“testing-weaviate”,  
http\_port=8080,  
http\_secure=True,  
grpc\_host=“testing-weaviate-grpc”,  
grpc\_port=8081,  
grpc\_secure=True  
),  
auth\_client\_secret=weaviate.auth.AuthApiKey(“\*\*\*\*”)  
)  
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](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 ?

Regards,  
Adithya

---

<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:** [June 10, 2024, 10:01pm UTC](https://forum.weaviate.io/t/weaviateclient-v4-connection-details/2675/2 "2024-06-10T22:01:49Z")

</div>

hi @adithya.ch !

Weaviate has introduced the GRPC connection in 1.23.7:

> **[gRPC | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/api/grpc)**
>
> Overview

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:

```auto
client = weaviate.connect_to_local()

```

and it will assume those default values.

Let me know if this helps.

Thanks!
