This release adds support for creating and configuring index read_capacity for BYOC indexes:
import pinecone
from pinecone import ByocSpec
pc = pinecone.Pinecone(api_key="YOUR_API_KEY")
# Create a BYOC index with OnDemand read capacity
pc.create_index(
name="my-byoc-index",
dimension=1536,
spec=ByocSpec(
environment="my-byoc-env",
read_capacity={"mode": "OnDemand"},
)
)
# Create a BYOC index with Dedicated read capacity
pc.create_index(
name="my-byoc-index",
dimension=1536,
spec=ByocSpec(
environment="my-byoc-env",
read_capacity={
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": {"replicas": 2},
},
},
)
)The following user-facing types have been added or updated to support this:
ByocSpec— now accepts optionalread_capacityandschemafieldsReadCapacityDict— union alias for the two read capacity modes belowReadCapacityOnDemandDict—{"mode": "OnDemand"}ReadCapacityDedicatedDict—{"mode": "Dedicated", "dedicated": ReadCapacityDedicatedConfigDict}ReadCapacityDedicatedConfigDict—{"node_type": str, "scaling": str, "manual": ScalingConfigManualDict}ScalingConfigManualDict—{"shards": int, "replicas": int}MetadataSchemaFieldConfig—{"filterable": bool}, used with the schema field onByocSpec
All of the above are exported from the top-level pinecone module.
Support for scan_factor and max_candidates has been added to Index.query() and Index.query_namespaces():
# scan_factor widens the IVF scan to trade latency for higher recall
# max_candidates controls how many candidates are reranked with exact distances
results = index.query(
vector=[...],
top_k=10,
scan_factor=2.0,
max_candidates=500,
)Both parameters are optional and only take effect on dedicated read node (DRN) dense indexes. scan_factor adjusts how much of the IVF index is scanned when gathering vector candidates, and max_candidates caps the number of candidates that undergo exact-distance reranking to improve recall.
What's Changed
- Regenerate code from
2025-10, implementschema/read_capacityinBYOCSpecby @austin-denoble in #614 - Implement
scan_factorandmax_candidatesforqueryby @austin-denoble in #617
Full Changelog: v8.0.1...v8.1.0