ollama - 💡(How to fix) Fix dify call model title generation error [5 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15139Fetched 2026-04-08 01:53:11
View on GitHub
Comments
5
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×5labeled ×1
RAW_BUFFERClick to expand / collapse

What is the issue?

When using Dify to call the Ollama model, the title of the conversation history cannot be generated. Tested models: qwen2.5:7b\qwen3:8b\deepseek-r1:14b.

the test as bellow: 1, The following effects are achieved by calling the Ollama model:

<img width="1069" height="176" alt="Image" src="https://github.com/user-attachments/assets/95098bf2-5e77-4a8b-8230-6e19a1741e2c" /> <img width="446" height="672" alt="Image" src="https://github.com/user-attachments/assets/c68728a3-f934-417e-8660-bd3525a3abbe" />

2, When the same model from ModelScope is invoked, title generation operates normally.

<img width="411" height="108" alt="Image" src="https://github.com/user-attachments/assets/72c6f53a-429d-4a3a-80f9-d208f16e83e1" /> <img width="298" height="562" alt="Image" src="https://github.com/user-attachments/assets/5d963097-5ae4-436b-9542-afc632e407b3" />

Relevant log output

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.17.8

extent analysis

Fix Plan

The issue seems to be related to the title generation in the Dify model. To fix this, we need to update the model configuration to include title generation.

Step-by-Step Solution

  1. Update Model Configuration: Add the title_generation parameter to the model configuration.
  2. Modify Model Invocation: Update the model invocation code to include the title_generation parameter.

Example Code

import dify

# Update model configuration
model_config = {
    'model_name': 'qwen2.5:7b',
    'title_generation': True
}

# Invoke the model with title generation
model = dify.Model(**model_config)
output = model.generate_title(conversation_history)

print(output)

In this example, we update the model configuration to include title_generation and then invoke the model with this parameter.

Verification

To verify that the fix worked, check the output of the model invocation. The title of the conversation history should be generated correctly.

Extra Tips

  • Make sure to update the model configuration correctly, as incorrect configuration can lead to unexpected behavior.
  • If the issue persists, try updating the Dify library to the latest version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING