After calling any tool, the moonshot model will suddenly stop outputting text halfway through #4512

Closed
opened 2026-02-21 18:06:49 -05:00 by yindo · 3 comments
Owner

Originally created by @ahasasjeb on GitHub (Jul 9, 2024).

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.13

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Model calling tools, such as scrape
屏幕截图 2024-07-09 172232

✔️ Expected Behavior

Full output

Actual Behavior

Output interrupt

Originally created by @ahasasjeb on GitHub (Jul 9, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.13 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Model calling tools, such as scrape ![屏幕截图 2024-07-09 172232](https://github.com/langgenius/dify/assets/174164463/13634a4d-24ef-4142-b0d8-7275c3c32679) ### ✔️ Expected Behavior Full output ### ❌ Actual Behavior Output interrupt
yindo added the 🐞 bug label 2026-02-21 18:06:49 -05:00
yindo closed this issue 2026-02-21 18:06:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 9, 2024):

Hello, @ahasasjeb! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash some bugs together! 🤖

To resolve the issue where the moonshort model in Dify version 0.6.13, self-hosted using Docker, stops outputting text halfway through when calling any tool like scrape, ensure that the Ollama service is properly accessible from the Docker container. Follow these steps:

  1. Expose the Ollama Service to the Network:
    Ensure that the Ollama service is not bound to 127.0.0.1 but to 0.0.0.0 to make it accessible from other containers or the host machine.

    For macOS:

    launchctl setenv OLLAMA_HOST "0.0.0.0"
    

    For Linux:

    [Service]
    Environment="OLLAMA_HOST=0.0.0.0"
    

    For Windows:
    Set the OLLAMA_HOST environment variable to 0.0.0.0.

  2. Use the Correct Host Address:
    If you are using Docker, replace localhost with host.docker.internal to ensure the Docker container can access the host machine's services.

    Update the Base URL in Dify settings:

    http://host.docker.internal:11434
    
  3. Verify Docker Setup:
    Ensure that your Docker setup meets the prerequisites and that all necessary services are running correctly. Follow these steps to verify:

    • Clone Dify:

      git clone https://github.com/langgenius/dify.git
      
    • Start Dify:
      Navigate to the docker directory in the Dify source code and execute the following commands:

      cd dify/docker
      cp .env.example .env
      docker compose up -d
      
    • Check Running Containers:
      Verify that all containers are running successfully:

      docker compose ps
      
  4. Configure Dify to Connect to Ollama:
    In Dify, go to Settings > Model Providers > Ollama and enter the following details:

    • Model Name: llava (or the name of the model you are using)
    • Base URL: http://<your-ollama-endpoint-domain>:11434 (use the accessible address of the Ollama service, such as http://192.168.1.100:11434 or http://172.17.0.1:11434 if using Docker)
    • Model Type: Conversation
    • Model Context Length: 4096
    • Max Token Limit: 4096
    • Vision Enabled: Yes (if the model supports image understanding)

By following these steps, you should be able to resolve the issue of the moonshort model stopping output halfway through when calling tools like scrape [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 9, 2024): <!-- Greeting --> Hello, @ahasasjeb! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash some bugs together! 🤖 <!-- Answer --> To resolve the issue where the moonshort model in Dify version 0.6.13, self-hosted using Docker, stops outputting text halfway through when calling any tool like scrape, ensure that the Ollama service is properly accessible from the Docker container. Follow these steps: 1. **Expose the Ollama Service to the Network:** Ensure that the Ollama service is not bound to `127.0.0.1` but to `0.0.0.0` to make it accessible from other containers or the host machine. For macOS: ```bash launchctl setenv OLLAMA_HOST "0.0.0.0" ``` For Linux: ```ini [Service] Environment="OLLAMA_HOST=0.0.0.0" ``` For Windows: Set the `OLLAMA_HOST` environment variable to `0.0.0.0`. 2. **Use the Correct Host Address:** If you are using Docker, replace `localhost` with `host.docker.internal` to ensure the Docker container can access the host machine's services. Update the Base URL in Dify settings: ```bash http://host.docker.internal:11434 ``` 3. **Verify Docker Setup:** Ensure that your Docker setup meets the prerequisites and that all necessary services are running correctly. Follow these steps to verify: - **Clone Dify:** ```bash git clone https://github.com/langgenius/dify.git ``` - **Start Dify:** Navigate to the docker directory in the Dify source code and execute the following commands: ```bash cd dify/docker cp .env.example .env docker compose up -d ``` - **Check Running Containers:** Verify that all containers are running successfully: ```bash docker compose ps ``` 4. **Configure Dify to Connect to Ollama:** In Dify, go to `Settings > Model Providers > Ollama` and enter the following details: - **Model Name:** `llava` (or the name of the model you are using) - **Base URL:** `http://<your-ollama-endpoint-domain>:11434` (use the accessible address of the Ollama service, such as `http://192.168.1.100:11434` or `http://172.17.0.1:11434` if using Docker) - **Model Type:** `Conversation` - **Model Context Length:** `4096` - **Max Token Limit:** `4096` - **Vision Enabled:** `Yes` (if the model supports image understanding) By following these steps, you should be able to resolve the issue of the moonshort model stopping output halfway through when calling tools like scrape <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/model-configuration/ollama.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/docker-compose.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/model-configuration/ollama.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 9, 2024):

Can you provide the model settings?
The data returned by the tools will be injected into the prompt, in this case, it will be added to the total output tokens.
The default setting of moonshot is limited to 1k, so if you would like to have the complete answer, you can change that value to a bigger one.

@crazywoola commented on GitHub (Jul 9, 2024): Can you provide the model settings? The data returned by the tools will be injected into the prompt, in this case, it will be added to the total output tokens. The default setting of moonshot is limited to 1k, so if you would like to have the complete answer, you can change that value to a bigger one.
Author
Owner

@ahasasjeb commented on GitHub (Jul 9, 2024):

Can you provide the model settings? The data returned by the tools will be injected into the prompt, in this case, it will be added to the total output tokens. The default setting of moonshot is limited to 1k, so if you would like to have the complete answer, you can change that value to a bigger one.

image

@ahasasjeb commented on GitHub (Jul 9, 2024): > Can you provide the model settings? The data returned by the tools will be injected into the prompt, in this case, it will be added to the total output tokens. The default setting of moonshot is limited to 1k, so if you would like to have the complete answer, you can change that value to a bigger one. ![image](https://github.com/langgenius/dify/assets/174164463/a9a50808-12ff-451b-8798-37d49e723107)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4512