Skip to content

[Bug]: Can't create custom rerank providers because of llmdb schema #620

@sezaru

Description

@sezaru

Provider (if applicable)

No response

Model (if applicable)

No response

Bug Description

I want to create a custom provider for JinaV3 reranker. the issue is that currently, llm_db do not have the rerank option in their capabilities Zoi schema https://github.com/agentjido/llm_db/blob/4d52afe524c866d2ab8043051afadd1343c88c44/lib/llm_db/model.ex#L176

So, even if I implement the provider and add rerank: true as a capability of it, it will still fail because the Zoi schema will remove it from the map after parsing it.

Consequently, that will make the check in

defp rerank_enabled?(capabilities) when is_map(capabilities) do
fail.

Reproduction Code

schema = LLMDB.Model.schema()

input = %{
  id: "jina-reranker-v3",
  provider: :jina,
  capabilities: %{rerank: true}
}

{:ok, model} = LLMDB.Model.new(input)


Model capabilities will not have rerank in it.

Expected Behavior

You should be able to pass rerank: true as a capability of the model.

Actual Behavior

the rerank: true capabilities is being removed from the model because the Zoi schema doesn't has it inside.

Environment

ReqLLM 1.10
Elixir 1.19.5
Erlang 28

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions