langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.97k stars 7.55k forks source link

add self deploy llm model, add error. #5980

Closed 19920716 closed 4 months ago

19920716 commented 4 months ago

Self Checks

Dify version

github main branch

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

add self deploy llm model, add error

✔️ Expected Behavior

image

❌ Actual Behavior

image

dosubot[bot] commented 4 months ago

To resolve the "Credentials validation failed with status code 404" error when adding a self-deployed LLM model in a self-hosted instance of the Dify application, ensure the following:

  1. Frontend and Backend Versions: Verify that both the frontend and backend versions are up-to-date and consistent with each other.

  2. Model Deployment: Ensure that the model has been successfully deployed and that the credentials are correctly configured.

  3. Credentials Configuration: Make sure the credentials include the correct endpoint_url or server_url and that they are properly formatted. Validate the credentials by pinging the model endpoint to ensure compatibility with OpenAI's API standard.

  4. Ollama Service Accessibility: If using Ollama, ensure the service is accessible from the Dify application. If deploying via Docker, use the local network IP address or the Docker host machine IP address instead of localhost. For example, use http://192.168.1.100:11434 or http://172.17.0.1:11434 instead of http://localhost:11434.

  5. LocalAI Integration:

    • Clone the LocalAI repository and navigate to the specified directory:
      $ git clone https://github.com/go-skynet/LocalAI
      $ cd LocalAI/examples/langchain-chroma
    • Download example LLM and Embedding models:
      $ wget https://huggingface.co/skeskinen/ggml/resolve/main/all-MiniLM-L6-v2/ggml-model-q4_0.bin -O models/bert
      $ wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
    • Configure the .env file:
      $ mv .env.example .env
    • Start LocalAI:
      $ docker-compose up -d --build
      $ docker logs -f langchain-chroma-api-1
    • Integrate the models into Dify:
      • Go to Settings > Model Providers > LocalAI and fill in the details for the models.
      • For ggml-gpt4all-j (Text Generation):
      • Model Name: gpt-3.5-turbo
      • Server URL: http://127.0.0.1:8080 (or the host IP if using Docker)
      • For all-MiniLM-L6-v2 (Embeddings):
      • Model Name: text-embedding-ada-002
      • Server URL: http://127.0.0.1:8080 (or the host IP if using Docker)

For more detailed instructions, refer to the LocalAI integration guide [1][2][3][4][5].

To continue talking to Dosu, mention @dosu.