# What endpoints are required for a custom reranker?

**URL:** https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944
**Category:** Support
**Tags:** integration
**Created:** [November 12, 2023, 7:34pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944 "2023-11-12T19:34:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mjsteele](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@mjsteele](https://forum.weaviate.io/u/mjsteele)
#### Post date: [November 12, 2023, 7:34pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/1 "2023-11-12T19:34:41Z")

</div>

Hi,

I have a custom reranker model that I am self hosting. I’d like to enable this in weaviate by replacing parts of the reranker-transformers module. I see the example in the docs of required endpoints for customizing text2vec-transformers, but I can’t seem to find the same for reranker-transformers. Can someone please help me identify what I need to implement/what the incoming requests will look like for rerankers?

Thanks!!

EDIT:  
I ended up just pulling the semitechnologies/reranker-transformers container and searching around inside. I found the following input class:

class CrossEncoderInput(BaseModel):  
query: str  
property: Optional[str]  
documents: Optional[list[str]]

which looks like what I need! Also- it looks like the same endpoints as the text2vec-transformers except instead of /vectors we have /rerank:  
GET /.well-known/live  
GET /.well-known/ready  
GET /meta  
POST /rerank

bonus for those of you who care- I’m running both text2vec-transformers custom model and the custom reranker-transformers at the same url, so all I had to do was add /rerank and update the weaviate config!

---

<div class="post-metadata">

### Author: ![bobvanluijt](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/bobvanluijt/32/23_2.png) [@bobvanluijt](https://forum.weaviate.io/u/bobvanluijt)
#### Post date: [November 12, 2023, 8:16pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/2 "2023-11-12T20:16:35Z")

</div>

Not an answer to your question, but I’m very interested in this. Probably more people might want this. Let me know when you’ve figured it out 🙂

---

<div class="post-metadata">

### Author: ![mjsteele](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@mjsteele](https://forum.weaviate.io/u/mjsteele)
#### Post date: [November 12, 2023, 10:57pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/3 "2023-11-12T22:57:09Z")

</div>

I can confirm that what I put in my edit works!

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [November 13, 2023, 12:42pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/4 "2023-11-13T12:42:13Z")

</div>

hi @mjsteele ! Thanks for sharing 🤗

Glad you were able to figure this out!

For instance, here are some links for future reference:

> **[Custom modules | Weaviate - vector database](https://weaviate.io/developers/weaviate/modules/other-modules/custom-modules#a-replace-parts-of-an-existing-module)**
>
> Introduction

So considering you want to change **reranker-transformers** inferece api, this is where you can get the endpoints the original container module provides:

> <https://github.com/weaviate/reranker-transformers/blob/6eba61611435ce9e65506759dfe9971314a83c53/app.py#L41>

A nice place to also understand those API calls is here:

> <https://github.com/weaviate/reranker-transformers/blob/main/smoke_tests.py>

Thanks!

---

<div class="post-metadata">

### Author: ![bobvanluijt](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/bobvanluijt/32/23_2.png) [@bobvanluijt](https://forum.weaviate.io/u/bobvanluijt)
#### Post date: [November 13, 2023, 9:49pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/5 "2023-11-13T21:49:26Z")

</div>

That’s awesome! Are you able to share it as a repo? If not, no worries, just curious. thanks!

---

<div class="post-metadata">

### Author: ![mjsteele](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@mjsteele](https://forum.weaviate.io/u/mjsteele)
#### Post date: [November 14, 2023, 2:12pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/6 "2023-11-14T14:12:25Z")

</div>

I copied what @DudaNogueira posted in app.py, the only change is the model instantiation and predict method. Very easy to implement! 🙂

---

<div class="post-metadata">

### Author: ![bobvanluijt](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/bobvanluijt/32/23_2.png) [@bobvanluijt](https://forum.weaviate.io/u/bobvanluijt)
#### Post date: [November 14, 2023, 2:23pm UTC](https://forum.weaviate.io/t/what-endpoints-are-required-for-a-custom-reranker/944/7 "2023-11-14T14:23:28Z")

</div>

Thanks, that’s awesome
