Cannot connect to weaviate in v4 using only url

Hi Everyone. I really need your guys help here!
I am given a weaviate URL which has been deployed as a web app. I am given the url to it - say its https://sample-weaviate.myorg.com (hiding the url for the sake of security). I am not given any ports or any grcp related data.

I had a version 3 code that could connect to it in the following manner

from weaviate import Client as wClient
self.weaviate = wClient(WEAVIATE_ENDPOINT)

Now for version 4, which offers the following ways to connect to it, I am failing miserably, trying to connect to the weaviate instance using just the URL, which I code easily do in v3

  • Weaviate Cloud (not the case for me as its not hosted on weaviate cloud)
  • Local instances (this seems to pre and post append the port to it, so couldn’t get it to work)
  • Custom connections again requires http port, grpc host & port, which I am not provided.
  • Embedded Weaviate (not the case for me)

Can anyone please help me by providing the python code to connect to a weaviate instance, provided only the URL? I’m using weaviate client v4.10.2

Your help will be much appreciated. Thanks folks!

hi @AnnTade !!

Welcome to our community :hugs: !!

The python client v4 introduces the GRPC connection. So in order to use it, you need to make sure you server is a recent version (1.25+ should be fine) and has the GRPC port exposed.

Now, if your cluster is under a SSL/TLS endpoint, you need to make sure that both grpc and http endpoints are secure in the client.

Here you can customize your connection. So let’s say you expose http and grpc on different ports, or different domains, etc:

Let me know if that helps!

1 Like

By the way, to find out the version your server is running, you can hit this endpoint:

https://sample-weaviate.myorg.com/v1/meta

that was really helpful. Thank you! and is there a way to check is gRPC ports are being exposed? Also to use custom connections function to connect
my http_host would be the url of the weaviate and the port would be something like 8080. Is that correct?