Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Dec 29, 2025

Remove Deprecated Rerank Models

Problem

Support for two rerank models (cohere-rerank-3.5 and pinecone-rerank-v0) is being removed from the Pinecone Inference API. These models are no longer available and should be removed from the SDK to prevent confusion and ensure users only see supported models.

Solution

Removed the deprecated rerank models from the SDK by:

  1. Removing Cohere_Rerank_3_5 and Pinecone_Rerank_V0 enum values from the RerankModel enum
  2. Updating all code examples in docstrings to use the remaining supported model (bge-reranker-v2-m3)
  3. Updating documentation examples to reflect the change

Changes

pinecone/inference/inference_request_builder.py

  • Removed Cohere_Rerank_3_5 = "cohere-rerank-3.5" from RerankModel enum
  • Removed Pinecone_Rerank_V0 = "pinecone-rerank-v0" from RerankModel enum

pinecone/inference/inference.py

  • Updated rerank() docstring example to use "bge-reranker-v2-m3" instead of "pinecone-rerank-v0"
  • Updated rerank() enum example to use RerankModel.Bge_Reranker_V2_M3 instead of RerankModel.PINECONE_RERANK_V0
  • Updated get_model() docstring example to use "bge-reranker-v2-m3" instead of "pinecone-rerank-v0"

pinecone/inference/inference_asyncio.py

  • Updated rerank() docstring example to use "bge-reranker-v2-m3" instead of "pinecone-rerank-v0"
  • Updated rerank() enum example to use RerankModel.Bge_Reranker_V2_M3 instead of RerankModel.PINECONE_RERANK_V0

docs/upgrading.md

  • Updated example to use "bge-reranker-v2-m3" instead of "pinecone-rerank-v0"

pyproject.toml

  • Fixed ruff configuration: changed target-version = "8.0.0" to target-version = "py310"
  • Removed duplicate [tool.black] section (ruff handles formatting)

Impact

User-Facing Impact

BREAKING CHANGE: Code that uses RerankModel.Cohere_Rerank_3_5 or RerankModel.PINECONE_RERANK_V0 will fail with an AttributeError. Users must migrate to RerankModel.Bge_Reranker_V2_M3 or pass the model name as a string.

Migration Path:

  • Replace RerankModel.Cohere_Rerank_3_5 with RerankModel.Bge_Reranker_V2_M3 or "bge-reranker-v2-m3"
  • Replace RerankModel.PINECONE_RERANK_V0 with RerankModel.Bge_Reranker_V2_M3 or "bge-reranker-v2-m3"
  • String-based model names ("cohere-rerank-3.5" and "pinecone-rerank-v0") will still work if passed directly, but these models are deprecated and may not be available on the API

Example Usage

Before (will break):

from pinecone import Pinecone, RerankModel

pc = Pinecone()
result = pc.inference.rerank(
    model=RerankModel.PINECONE_RERANK_V0,  # AttributeError: no such attribute
    query="Your query",
    documents=["doc1", "doc2"]
)

After (correct):

from pinecone import Pinecone, RerankModel

pc = Pinecone()
result = pc.inference.rerank(
    model=RerankModel.Bge_Reranker_V2_M3,  # ✅ Works
    query="Your query",
    documents=["doc1", "doc2"]
)

Breaking Changes

YES - This is a breaking change. The following enum values have been removed:

  • RerankModel.Cohere_Rerank_3_5
  • RerankModel.PINECONE_RERANK_V0

Code using these enum values will raise AttributeError at runtime. Users must update their code to use RerankModel.Bge_Reranker_V2_M3 or pass model names as strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants