Create a serverless index
This page shows you how to create a serverless index. For guidance on pod-based indexes, see Using pods.
You can create an index using the Pinecone console.
Create a serverless index
You can create an index that either accepts vectors created with an external embedding model or accepts text and converts it to vectors automatically using an embedding model hosted by Pinecone.
External embedding
To create a serverless indexes for vectors created with an external embedding model, use the create_index
operation as follows:
- Provide a
name
for the index. - Specify the
dimension
andmetric
of the vectors you’ll store in the index. This should match the dimension and metric supported by your embedding model. - Set
spec.cloud
andspec.region
to the cloud and region where the index should be deployed. For Python, you also need to import theServerlessSpec
class.
Other parameters are optional. See the API reference for details.
Integrated embedding
To create an index that accepts source text and converts it to vectors automatically using an embedding model hosted by Pinecone, use the create_for_model
operation as follows:
- Provide a
name
for the index. - Set
embed.model
to one of Pinecone’s hosted embedding models. - Set
spec.cloud
andspec.region
to the cloud and region where the index should be deployed. - Set
embed.field_map
to the name of the field in your source document that contains the data for embedding.
Other parameters are optional. See the API reference for details.
The response will look like this:
Create a serverless index from a backup
You can create a serverless index from a backup. For more details, see Restore an index.
Migrate a pod-based index to serverless
You can migrate a pod-based index to serverless by creating a new serverless index from a collection. For more information, see Migrate a pod-based index to serverless.
Was this page helpful?