Launch Week🚀 Day 3: Introducing Pinecone Reranking Model!Learn more
Preview Mode ()

Pinecone Local, a self-hosted, in-memory emulator of the vector database, is now available in public preview for all users. This means you can prototype, test, and develop AI applications locally while seamlessly integrating workflow testing into CI/CD pipelines.

Test, prototype, and develop on your local machine

To build robust, production-grade AI applications, you must properly test your vector database across various edge cases in different environments and ensure it fits seamlessly into the rest of your application architecture. However, constantly scaling a suite of infrastructure up and down to run integration tests is not sustainable, as it can incur extra usage and cost and drain resources. Pinecone Local allows you to run all your integration or unit tests — including the ones within your CI pipeline — on your local machine, avoiding resource-intensive serverless operations.

With Pinecone Local, you can:

  • Spin up and tear down Pinecone indexes in-memory, perfect for quickly testing and prototyping
  • Use any of our supported SDKs to make requests to the Pinecone API across the control plane and data plane endpoints, with no API key needed
  • Run large-scale tests on your own data without incurring any usage cost, enabling you to accurately and reliably experience how your production vector database will function
  • Develop your Pinecone app locally with no internet connection, providing more flexibility for you and your team

Choose the path that works for you

Pinecone Local is available via Docker, with two images to choose from:

  1. The first image— pinecone-local —provides the full vector database emulator, which allows you to add/delete indexes using our API to build out your environment.
  2. The second image — pinecone-index — directly spins up a single, local Pinecone index, on which you can call any of our API endpoints.

If your test suite or CI pipeline includes index creation and deletion, it’s usually easier to perform those operations via API in Pinecone Local, using the pinecone-local image. If you’re looking to quickly get started and experiment with a couple of indexes, we recommend spinning them up manually with the pinecone-index image.

Regardless of the image you choose, installation is easy. Simply pull down the image and configure your index through Docker Compose or the Docker CLI.

Set up full vector database emulator

If you’re using the pinecone-local image to spin up the vector database emulator, you’ll be using the API to create and manage indexes.

To start, you will pull the pinecone-local image from Docker:

docker pull ghcr.io/pinecone-io/pinecone-local:latest

and then start Pinecone Local:

docker run -d \
--name pinecone-local \
-e PORT=5081 \
-e PINECONE_HOST=localhost
-p 5081-6000:5081-6000 \
--platform linux/amd64 \
ghcr.io/pinecone-io/pinecone-local:latest

Manually configure Pinecone Local indexes

If you’re using the pinecone-index image, it will spin up a single local Pinecone index when ran.

To start, pull the pinecone-index image from Docker:

docker pull ghcr.io/pinecone-io/pinecone-index:latest

and then configure the index via environment variables:

docker run -d \
--name index1 \
-e PORT=5081 \
-e INDEX_TYPE=serverless \
-e DIMENSION=2 \
-e METRIC=cosine \
-p 5081:5081 \
--platform linux/amd64 \
ghcr.io/pinecone-io/pinecone-index:latest

Initialize your client and locally develop your app

Once you’ve started either of the Pinecone Local images, you can begin developing your app. First, initialize your Pinecone client, targeting the port specified in your Docker compose file. The below example uses the Python client.

pc = PineconeGRPC(api_key="pclocal", host="http://localhost:5081")

Once the client has been initialized, you can either:

  • Create new indexes using the API (only if you’re using the pinecone-local image), the same way you’d normally do it in Pinecone:
if not pc.has_index(index_name):  
    pc.create_index(
        name="index1",
        dimension=2,
        metric="cosine",
        spec=ServerlessSpec(
            cloud="aws",
            region="us-east-1",
        )
    )
  • Access the indexes you’ve created manually via Docker (only if you used the pinecone-index image) by targeting the specified port as the host:
index1 = pc.Index(host="localhost:5081", grpc_config=GRPCClientConfig(secure=False))

Now, you can develop your application as you would normally. Also note that an API key is not needed to use Pinecone Local, so when initializing your Pinecone client, you can pass any string to the API key parameter.

Start building today

Pinecone Local is not suitable for use in production applications, due to its nature as an in-memory emulator. It serves as a tool for testing and prototyping, so does not provide the scalability or durability needed for robust production applications.

With that said, Pinecone Local represents an exciting step forward for the Pinecone developer experience — we encourage you to try it out. Visit our documentation for detailed instructions, and make sure to leave us your feedback, ask questions, and share your experience on our Community Forum.

Share:

What will you build?

Upgrade your search or chatbots applications with just a few lines of code.