[GH-ISSUE #2077] Summaries on DeepSeek will use JSON, not plain text #1295

Open
opened 2026-03-02 11:56:20 +03:00 by kerem · 3 comments
Owner

Originally created by @aanno on GitHub (Oct 29, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2077

Describe the Bug

I use karakeep v0.27.1 with DeepSeek. This is my relevant configuration:

OPENAI_BASE_URL=https://api.deepseek.com/
OPENAI_NAME=deepseek-chat
# defaults to 2048
INFERENCE_CONTEXT_LENGTH=32768
# defaults to 60
INFERENCE_JOB_TIMEOUT_SEC=120
INFERENCE_TEXT_MODEL=deepseek-chat
INFERENCE_IMAGE_MODEL=deepseek-chat
# defaults to true
INFERENCE_ENABLE_AUTO_TAGGING=true
# defaults to false
INFERENCE_ENABLE_AUTO_SUMMARIZATION=true
# defaults to structured
INFERENCE_OUTPUT_SCHEMA=json

deepseek output:

  • does not support 'structured'
  • needs prompt customisation for json work (add 'Output must be in JSON!')
    (If I don't do that, I get an error saying that in order to get JSON output, this must also be mentioned in the (system) prompt.)
  • but summary needs plain text (add 'Output should be in plain text!')
Image

Steps to Reproduce

  1. Add a new links as new Item
  2. Wait for for AI processing
  3. Summaries on new item (click on the enlarge icon of the new entry) is in JSON
Image

Expected Behaviour

  • The summaries field should contain only text (no JSON)
  • Maybe automatic recognition of JSON would be helpful here
  • I think the bug is not limited to DeepSeek, however it is most relevant here as DeepSeek does not support 'structured' output, and needs additional tweaking for JSON (see above)

Screenshots or Additional Context

No response

Device Details

not relevant, i.e. all browsers

Exact Karakeep Version

0.27.1

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem
Originally created by @aanno on GitHub (Oct 29, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2077 ### Describe the Bug I use karakeep v0.27.1 with DeepSeek. This is my relevant configuration: ```properties OPENAI_BASE_URL=https://api.deepseek.com/ OPENAI_NAME=deepseek-chat # defaults to 2048 INFERENCE_CONTEXT_LENGTH=32768 # defaults to 60 INFERENCE_JOB_TIMEOUT_SEC=120 INFERENCE_TEXT_MODEL=deepseek-chat INFERENCE_IMAGE_MODEL=deepseek-chat # defaults to true INFERENCE_ENABLE_AUTO_TAGGING=true # defaults to false INFERENCE_ENABLE_AUTO_SUMMARIZATION=true # defaults to structured INFERENCE_OUTPUT_SCHEMA=json ``` deepseek output: * does not support 'structured' * needs prompt customisation for json work (add 'Output must be in JSON!') (If I don't do that, I get an error saying that in order to get JSON output, this must also be mentioned in the (system) prompt.) * but summary needs plain text (add 'Output should be in plain text!') <img width="1360" height="626" alt="Image" src="https://github.com/user-attachments/assets/00897ab9-524d-42ca-bed6-cfbfe2754ba2" /> ### Steps to Reproduce 1. Add a new links as new Item 2. Wait for for AI processing 3. Summaries on new item (click on the enlarge icon of the new entry) is in JSON <img width="777" height="1596" alt="Image" src="https://github.com/user-attachments/assets/7d0c7c66-2931-4e9c-a4e1-6a446f2c474e" /> ### Expected Behaviour - The summaries field should contain only text (no JSON) - Maybe automatic recognition of JSON would be helpful here - I think the bug is not limited to DeepSeek, however it is most relevant here as DeepSeek does not support 'structured' output, and needs additional tweaking for JSON (see above) ### Screenshots or Additional Context _No response_ ### Device Details not relevant, i.e. all browsers ### Exact Karakeep Version 0.27.1 ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
Author
Owner

@MohamedBassem commented on GitHub (Nov 1, 2025):

Can you share the entire prompt for summaries? I don't think the prompt for summarization mentions json at all.

<!-- gh-comment-id:3476278503 --> @MohamedBassem commented on GitHub (Nov 1, 2025): Can you share the entire prompt for summaries? I don't think the prompt for summarization mentions json at all.
Author
Owner

@aanno commented on GitHub (Nov 9, 2025):

Dear @MohamedBassem ,

I'm not aware that I have changed anything else in the configuration. Hence I probably use the default configuration for the summary. If you provide me with an idea how to retrieve the missing information, I will post it here...

<!-- gh-comment-id:3507794382 --> @aanno commented on GitHub (Nov 9, 2025): Dear @MohamedBassem , I'm not aware that I have changed anything else in the configuration. Hence I probably use the default configuration for the summary. If you provide me with an idea how to retrieve the missing information, I will post it here...
Author
Owner

@aanno commented on GitHub (Dec 30, 2025):

Dear @Mishir0 ,

while I believe that your solution is a valid configuration and a possible work-around, I also think that you're on a different track. You fight the problem with not using structured output from DeepSeek.

<!-- gh-comment-id:3698965076 --> @aanno commented on GitHub (Dec 30, 2025): Dear @Mishir0 , while I believe that your solution is a valid configuration and a possible work-around, I also think that you're on a different track. You fight the problem with _not using structured output_ from DeepSeek.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1295
No description provided.