Skip to main content
Planned for deprecation. The Rerank model will be removed in a future release. For code search, use WarpGrep instead. WarpGrep is a search agent that handles retrieval, ranking, and file reading in one call, replacing the need to manage embeddings, vector databases, and reranking pipelines yourself.

Overview

The Rerank API improves search quality by reordering candidate results based on their relevance to a query. Our latest morph-rerank-v3 model achieves state-of-the-art performance across all coding benchmarks for accuracy:speed ratio - no rerank model comes close. It’s designed specifically for code-related content and goes beyond traditional keyword matching to understand semantic intent.

Custom API Endpoint

Unlike our Apply and Embedding models that use OpenAI-compatible APIs, the Rerank model uses a custom endpoint designed specifically for reranking tasks. It is Cohere client compatible.

Endpoint Reference

Parameters

* Either documents or embedding_ids must be provided.

Using Embedding IDs

When you have previously generated embeddings with Morph’s embedding model, you can use the embedding IDs for reranking:

Remote Content Storage

To use embedding IDs for reranking, you must enable remote content storage in your account settings. This allows Morph to retrieve the content associated with each embedding ID for reranking purposes. Benefits of using embedding IDs:
  • Reduced payload size: Avoid sending large document content in each request
  • Better integration: Seamlessly works with content that was previously embedded
  • Security: Content is securely stored within your account’s storage
  • Convenience: No need to maintain document content separately from embeddings

Response Format

Features

morph-rerank-v3 (Latest)

  • State-of-the-Art Performance: Achieves SoTA results across all coding benchmarks for accuracy:speed ratio - no rerank model comes close
  • Unmatched Speed: Fastest reranking inference in the market while delivering superior accuracy
  • Enhanced Context Understanding: Improved semantic understanding of code relationships and intent

Core Features (All Models)

  • Code-Aware: Specifically optimized for ranking code-related content
  • Context Understanding: Considers the full context of both query and documents
  • Relevance Scoring: Provides numerical scores indicating relevance
  • Efficient Processing: Optimized for quick reranking of large result sets
  • Language Agnostic: Works with all major programming languages
  • Embedding ID Support: Integrates with previously generated embeddings
  • Remote Content Storage: Option to use securely stored content with embedding IDs

Integration with Search Systems

The Rerank model is typically used as a second-pass ranking system after an initial retrieval step:
  1. Initial Retrieval: Use embeddings or keyword search to retrieve an initial set of candidates
  2. Reranking: Apply the Rerank model to sort the candidates by relevance to the query
  3. Presentation: Display the reranked results to the user
This two-stage approach combines the efficiency of initial retrieval methods with the accuracy of deep neural reranking models.
For best code search performance, we recommend using WarpGrep — our intelligent code search tool that combines fast retrieval with automatic reranking. WarpGrep handles the entire search pipeline for you, delivering 20x faster results than stock grepping.