continuedev/continue · error · Error
AI SDK provider does not support reranking.
Error message
AI SDK provider does not support reranking.
What it means
The AiSdk adapter implements rerank as a throwing stub because the Vercel AI SDK has no reranking primitive. Any rerank request routed to an AI SDK provider fails immediately. Use an adapter backed by a rerank-capable service (Cohere, Jina, Mistral).
Source
Thrown at packages/openai-adapters/src/apis/AiSdk.ts:309
}
const result = await embedMany({
model,
values: stringInputs,
});
return embedding({
data: result.embeddings,
model: modelId,
usage: {
prompt_tokens: result.usage?.tokens ?? 0,
total_tokens: result.usage?.tokens ?? 0,
},
});
}
async rerank(_body: RerankCreateParams): Promise<CreateRerankResponse> {
throw new Error("AI SDK provider does not support reranking.");
}
async list(): Promise<Model[]> {
return [];
}
}
View on GitHub (pinned to 5522c6f44c)
Solutions
- Use a rerank-capable adapter (CohereRerankAdapter, Jina, Mistral) for the rerank step
- Skip reranking when the adapter doesn't support it, falling back to pure embedding similarity
- Check adapter capabilities before building the retrieval pipeline
Example fix
// before
const res = await api.rerank({ query, documents, model: 'rerank-v1' });
// after
const res = await cohereApi.rerank({ query, documents, model: 'rerank-v3.5' }); Defensive patterns
Strategy: fallback
Validate before calling
if (api instanceof AiSdk) { return rankByEmbedding(query, docs); } Type guard
function supportsRerank(api: BaseApi): boolean { return !(api instanceof AiSdk); } Try / catch
try { return await api.rerank(body); }
catch (e) { if (/does not support reranking/.test(String(e))) return fallbackEmbeddingRerank(body); throw e; } Prevention
- Pair rerank steps with a dedicated rerank provider
- Fall back to embedding similarity when rerank is unsupported
When it happens
Trigger: Calling rerank(body) on an AiSdk adapter instance, typically from retrieval/RAG pipelines that rerank documents.
Common situations: Building RAG with an AI SDK provider (e.g. an AI SDK-hosted model) and assuming rerank works uniformly across all adapters because the interface exposes it.
Related errors
- AI SDK provider does not support fill-in-the-middle (FIM) co
- AskSage does not support reranking
- Failed to fetch channels: ${response.statusText}
- AWS Bedrock rerank error (${(error as any).code}): ${error.m
- Error in BedrockReranker.rerank: ${error.message}
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/0debd9e8634fbbd8.
Report an issue: GitHub.