Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rerank model success for LocalAI, but no show in system #4377

Closed
4 tasks done
edisonzf2020 opened this issue May 14, 2024 · 4 comments
Closed
4 tasks done

add rerank model success for LocalAI, but no show in system #4377

edisonzf2020 opened this issue May 14, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@edisonzf2020
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. add rerank model mxbai-rerank-large-v1 success.
  2. can not display in system .

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Copy link

dosubot bot commented May 14, 2024

To address the issue with the "mxbai-rerank-large-v1" model not showing up in the Dify system after adding it to your self-hosted LocalAI, please ensure the following steps have been correctly executed:

  1. Model and Configuration: Confirm that the model is saved in the models directory and a correct YAML configuration file is created for it within the same directory.
  2. Restart LocalAI: Make sure LocalAI has been restarted to load the new model configuration.
  3. Dify Integration: In Dify, navigate to Settings > Model Providers > LocalAI and add the new model with its details to ensure it's integrated properly.

Check for these potential issues:

  • Model Compatibility: The model should be compatible with the ggml format and supported by Dify.
  • Network Configuration: Verify that the Dify container can access the LocalAI endpoint. Use the host IP address or a LAN IP address instead of localhost.

If the model still doesn't appear, review the integration process in Dify, especially the updateModelList function, to ensure the model list is refreshed correctly. Also, look out for any error messages during the process, as they can provide specific clues to the problem.

For a detailed guide on adding models to LocalAI and troubleshooting, refer to the LocalAI model configuration documentation.

If after these checks the issue persists, please share more details about the steps you've taken and any error messages encountered for further assistance.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 14, 2024
@gakugaku
Copy link

After configuring LocalAI ReRank, running SELECT * FROM provider_models on the Dify DB returns the following result, indicating that it is configured correctly.

... | ...  | localai       | <<model_name>> | reranking       | {"server_url": "http://xxx.xxx.xxx.xxx/v1"} | t        | 2024-05-17 17:10:23 | 2024-05-23 07:26:34.66699

However, it does not show up in the model provider settings and cannot be used as a model.

It seems like the API endpoint console/api/workspaces/current/models/model-types/rerank is not functioning with the registered LocalAI Reranker.

Request: http://xxx/console/api/workspaces/current/models/model-types/rerank
Response:

{data: [{provider: "nvidia", label: {zh_Hans: "API Catalog", en_US: "API Catalog"},…},…]}
0: {provider: "nvidia", label: {zh_Hans: "API Catalog", en_US: "API Catalog"},…}
1: {provider: "cohere", label: {zh_Hans: "Cohere", en_US: "Cohere"},…}
2: {provider: "jina", label: {zh_Hans: "Jina", en_US: "Jina"},…}

Environment:

  • Dify version: 0.6.8
  • LocalAI version: 2.15.0

@Sarmingsteiner
Copy link

Sarmingsteiner commented Jun 6, 2024

@edisonzf2020 : Could you please point me out how you managed to install the reranking model mxbai-rerank-large-v1 in LocalAI?

@gakugaku : Which reranking model did you install in LocalAI and how did you manage it? Thank you in advance.

@gakugaku
Copy link

gakugaku commented Jun 6, 2024

@Sarmingsteiner
This issue has been resolved in #4652, and it should work correctly in the latest version.

Here is how I managed to install a reranking model in LocalAI. Example for Docker and Japanese Reranker model.

LocalAI Configuration

compose.yaml

services:
  local-ai:
    image: localai/localai:v2.16.0
    environment:
      MODELS_PATH: /models
    volumes:
      - ./data/LocalAI/models:/models:cached

./data/LocalAI/models/reranker.yaml
You can find more details in the 📈 Reranker | LocalAI documentation.

name: japanese-reranker
backend: rerankers
parameters:
  model: hotchpotch/japanese-reranker-cross-encoder-small-v1

When you start and run this configuration, the model will be downloaded automatically.

Dify Configuration

Select the LocalAI provider and configure it as follows:

  • Model Type: Rerank
  • Model Name: In the example above, it would be japanese-reranker
  • Server URL: http://<your-server>/v1 (make sure to include /v1)

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 7, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants