There are two versions of the Python client:

  • pinecone-client[gRPC]: Relies on gRPC for data operations and is more performant than pinecone-client.
  • pinecone-client: Has a minimal set of dependencies and interacts with Pinecone via HTTP requests.

See the Pinecone Python client documentation for full installation instructions, usage examples, and reference information.

Install

To install the newest version of the Python client, run the following command:

If you already have the Python client, upgrade the client as follows:

To check your client version, run the following command:

pip show pinecone-client

Python client version 5.0.0 and later includes the required pinecone-plugin-inference package for the Inference API.

Install the Pinecone Assistant Python plugin

To use the chat completion endpoint for the Pinecone Assistant with the Python client, upgrade the client and install the pinecone-plugin-assistant package as follows:

Initialize

Once installed, you can import the library and then use an API key to initialize a client instance:

When creating an index, import the ServerlessSpec or PodSpec class as well:

Proxy configuration

If your network setup requires you to interact with Pinecone through a proxy, you will need to pass additional configuration using optional keyword parameters:

  • proxy_url: The location of your proxy. This could be an HTTP or HTTPS URL depending on your proxy setup.
  • proxy_headers: Accepts a python dictionary which can be used to pass any custom headers required by your proxy. If your proxy is protected by authentication, use this parameter to pass basic authentication headers with a digest of your username and password. The make_headers utility from urllib3 can be used to help construct the dictionary.
  • ssl_ca_certs: By default, the client will perform SSL certificate verification using the CA bundle maintained by Mozilla in the certifi package. If your proxy is using self-signed certicates, use this parameter to specify the path to the certificate (PEM format).
  • ssl_verify: SSL verification is enabled by default, but it is disabled when set to False. It is not recommened to go into production with SSL verification disabled.