Local development with Pinecone Local
Pinecone Local is an in-memory Pinecone Database emulator available as a Docker image.
This page shows you how to use Pinecone Local to develop your applications locally without connecting to your Pinecone account or incurring usage or storage fees.
Pinecone Local is not suitable for production. See Limitations for details.
This feature is in public preview.
Limitations
Pinecone Local has the following limitations:
- Pinecone Local is available only as a Docker image.
- Pinecone Local is an in-memory emulator and is not suitable for production. Records loaded into Pinecone Local do not persist after it is stopped.
- Pinecone Local does not authenticate client requests. API keys are ignored.
- Max number of records per index: 100,000.
Pinecone Local does not currently support the following features:
1. Start Pinecone Local
You can configure Pinecone Local to start with or without indexes.
- Starting with indexes is recommended for getting started with Pinecone Database or quickly experimenting with reading and writing data. This approach use the
pinecone-index
Docker image. - Starting without indexes is recommended for testing your production app or creating and managing indexes. This approach uses the
pinecone-local
Docker image.
Start with indexes
Make sure Docker is installed and running on your local machine.
Create a docker-compose.yaml
file that defines a service for each index that you want Pinecone Local to create on startup, including the pinecone-index
Docker image, the host and port that the index with run on, the type of index, and the dimension and distance metric of the index:
For each index, update the environment variables as needed:
PORT
: Specify the port number for the index to listen on.INDEX_TYPE
: Specify the type of Pinecone index to create. Accepted values:serverless
orpod
.DIMENSION
: Specify the dimension of vectors you will store in the index.METRIC
: Specify the distance metric for calculating the similarity between vectors in the index. Accepted values:cosine
,euclidean
, ordot-product
.
To start Pinecone Local, run the following command:
You’ll see a message with details about each index, including the port it listens on:
Start without indexes
Make sure Docker is installed and running on your local machine.
Create a docker-compose.yaml
file that defines a service for Pinecone local, including the pinecone-local
Docker image, the host and port that Pinecone Local will run on and the range of ports that will be available for indexes:
To start Pinecone Local, run the following command:
You’ll see a message with details about the Pinecone Local instance:
2. Develop your app
Running code against Pinecone Local is just like running code against your Pinecone account, with the following differences:
-
Pinecone Local does not authenticate client requests. API keys are ignored.
-
Pinecone Local requires Python SDK
v4.1.2
or later, Node.js SDKv3.0.x
or later, Java SDK v3.1.0 or later, Go SDKv1.1.1
or later, and .NET SDK v2.1.0 or later.
Be sure to review the limitations of Pinecone Local before using it for development or testing.
Example
The following example assumes that you have started Pinecone Local without indexes:
3. Stop Pinecone Local
Pinecone Local is an in-memory emulator. Records loaded into Pinecone Local do not persist after Pinecone Local is stopped.
To stop and remove the resources for Pinecone Local, run the following command:
Moving from Pinecone Local to your Pinecone account
When you’re ready to run your application against your Pinecone account, be sure to do the following:
- Update your application to use your Pinecone API key.
- Update your application to target your Pinecone indexes.
- Use Pinecone’s import feature to efficiently load large amounts of data into your indexes and then use batch upserts for ongoing writes.
- Follow Pinecone’s production best practices.
Was this page helpful?