Pinecone Local, the in-memory emulator, reached end of life on October 7, 2026. If you used it for testing, the mock in this guide covers request and error-handling tests. It doesn’t cover tests that write data and read it back, or tests that need real search results.
Before you begin
Ensure you have the following:- Docker with Docker Compose
- Git
- The Pinecone Python SDK v10 or later, or the Pinecone Node.js SDK v9 or later
Run the mock
1
Get the API specs
Clone the repository that holds Pinecone’s OpenAPI specs. Each API version has its own directory, such as
2026-07.Terminal
2
Define the mock services
The Pinecone API is split across three specs, so you run one Prism container for each. In the directory that contains This guide uses the
pinecone-api, create a docker-compose.yaml file with the following content:docker-compose.yaml
2026-07 specs, the API version that the Pinecone Python SDK v10 and Pinecone Node.js SDK v9 send.Prism publishes images only for Intel and AMD processors (linux/amd64), with no ARM build. On a Mac with Apple silicon, Docker runs them under emulation. The platform setting makes that explicit and silences Docker’s platform warning.Pin the Prism image to a version that starts. Every 5.15 image, including the
5 and latest tags, exits on startup with TypeError: Cannot read properties of undefined (reading 'isPrimary') on both Intel and Apple silicon. 5.14.3 is the newest version that works.3
Start the mock
Start the three containers in the background:Prism takes several seconds to load each spec. When all three are ready,
Terminal
docker compose logs shows a line like this for each port:Output
4
Point the SDK at the mock
Set the client’s host to the control-plane mock, and target the index by host with the data-plane mock. Any API key works, but the SDK requires one. In Python, use the HTTP client, not the gRPC client, because the mock doesn’t serve gRPC.Don’t target the index by name. The SDK would describe the index to look up its host, and the mock returns the spec’s example host on All three calls succeed, and all three return the spec’s examples instead of results based on your request. The index you described is named The Vectors API methods, such as
pinecone.io, not the mock.my-index, the upsert reports two documents even though you sent one, and the top match is doc-1:Output
upsert, query, and fetch, work against the mock the same way.Mock inference calls
The Pinecone Inference endpoints, such asembed and rerank, are in a separate spec, so they’re served from a separate port. Create a second client with the inference mock as its host:
Output
Test error handling
To test how your code handles API errors, ask Prism for a specific status code with thePrefer header. Prism returns that code for every request from a client that sets the header. Data-plane endpoints return any 4xx or 5xx code. Control-plane and inference endpoints return only the codes their spec lists. For any other code, Prism responds with a 404 that says the requested status code isn’t defined. For more on handling errors, see Error handling.
Example
Return503 Service Unavailable from a document search to test your retry handling:
503 three times before they raise an error, so this test takes a few seconds. The Python SDK raises ServiceError, and the Node.js SDK raises PineconeMaxRetriesExceededError.
Run the mock in CI
In a GitHub Actions workflow, start the mock with Docker Compose as a step before your tests run. GitHub’sservices containers can’t pass Prism its mock command or mount the specs, so you can’t use them here.
The following workflow assumes your repository has the docker-compose.yaml file from this guide at its root and your tests in a tests directory. It clones the specs, starts the mock, waits until all three ports respond, and runs the tests:
.github/workflows/test.yaml
Limitations
Some calls fail against the mock even though they work against Pinecone:- Upserting records into a legacy integrated index: The legacy Records API methods,
upsert_recordsandupsertRecords, send newline-delimited JSON, which Prism can’t parse, so the mock rejects them with a422. Searching a legacy integrated index works, and so does upserting into a document index. - Embedding with the Node.js SDK: The mock’s embed response doesn’t include a valid
vector_typefor each embedding, soinference.embed()throwsNo variant of Embedding exists with 'vectorType=undefined'. Embedding works with the Python SDK, and reranking works with both.
Stop the mock
Stop and remove the containers:Terminal