




















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.
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:
Pinecone Local is available via Docker through an image called pinecone-local. This image provides the full vector database emulator, which enables you to add/delete indexes using our API to build out your environment and run your full suite of tests.
If you’d rather just spin up a single local Pinecone index without starting the full emulator, see our documentation on the pinecone-index Docker image.
Installation is easy. You pull down the image and configure your index through Docker Compose or the Docker CLI.
To start, you will pull the pinecone-local image from Docker:
docker pull ghcr.io/pinecone-io/pinecone-local:latestand 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:latestOnce you’ve started the Pinecone Local image, 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 create new indexes using the API 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",
)
)Now, you can develop your application as normal, including upserting and querying data. 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.
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.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。