Describe the Bug
I was following the configuration to set up Cloudflare with Worker AI as the provider.
No matter if I used the suggested URL or through a gateway, I was not getting bookmarks to be tagged, even though there is traffic (and inference) being made on the Cloudflare side. I can see in the logs the token in/out count, the correct prompt, and the returned inference.
However, the tags are not being added.
Steps to Reproduce
- Configure the .env for Cloudflare as per the instructions
`OPENAI_BASE_URL=https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway-name}/compat
OPENAI_API_KEY=Cloudflare API Key
INFERENCE_TEXT_MODEL=workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct
INFERENCE_IMAGE_MODEL=workers-ai/@cf/meta/llama-3.2-11b-vision-instruct
EMBEDDING_TEXT_MODEL=workers-ai/@cf/google/embeddinggemma-300m
INFERENCE_OUTPUT_SCHEMA=json`
-
Add a new bookmark or run tag all failed bookmarks (I tested both)
-
In the logs, I see:
`2026-04-13T03:04:05.948Z info: [inference][4082] Starting an inference job for bookmark with id "{bookmark-id}"
2026-04-13T03:04:05.985Z error: [inference][4082] inference job failed: TypeError: response.response.substring is not a function
TypeError: response.response.substring is not a function
at inferTags (file:///app/apps/workers/dist/index.js:65305:43)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async runTagging (file:///app/apps/workers/dist/index.js:65391:15)
at async runOpenAI (file:///app/apps/workers/dist/index.js:65462:4)
at async file:///app/apps/workers/dist/shared-server-Cp5ajkIj.js:28380:19
at async Object.run (file:///app/apps/workers/dist/index.js:163:10)
at async Object.wrappedRun [as run] (file:///app/apps/workers/dist/queue-liteque-CziQmi6R.js:57:12)`
Expected Behaviour
Karakeep should be able to process the response from the Cloudflare Worker AI.
Screenshots or Additional Context
I tested both with and without the INFERENCE_OUTPUT_SCHEMA=json and both the gateway URL and the https://api.cloudflare.com/client/v4/accounts/{your-account-id}/ai/v1.
Device Details
No response
Exact Karakeep Version
v0.31.0
Environment Details
Docker
Debug Logs
No response
Have you checked the troubleshooting guide?
Describe the Bug
I was following the configuration to set up Cloudflare with Worker AI as the provider.
No matter if I used the suggested URL or through a gateway, I was not getting bookmarks to be tagged, even though there is traffic (and inference) being made on the Cloudflare side. I can see in the logs the token in/out count, the correct prompt, and the returned inference.
However, the tags are not being added.
Steps to Reproduce
`OPENAI_BASE_URL=https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway-name}/compat
OPENAI_API_KEY=Cloudflare API Key
INFERENCE_TEXT_MODEL=workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct
INFERENCE_IMAGE_MODEL=workers-ai/@cf/meta/llama-3.2-11b-vision-instruct
EMBEDDING_TEXT_MODEL=workers-ai/@cf/google/embeddinggemma-300m
INFERENCE_OUTPUT_SCHEMA=json`
Add a new bookmark or run tag all failed bookmarks (I tested both)
In the logs, I see:
`2026-04-13T03:04:05.948Z info: [inference][4082] Starting an inference job for bookmark with id "{bookmark-id}"
2026-04-13T03:04:05.985Z error: [inference][4082] inference job failed: TypeError: response.response.substring is not a function
TypeError: response.response.substring is not a function
Expected Behaviour
Karakeep should be able to process the response from the Cloudflare Worker AI.
Screenshots or Additional Context
I tested both with and without the INFERENCE_OUTPUT_SCHEMA=json and both the gateway URL and the https://api.cloudflare.com/client/v4/accounts/{your-account-id}/ai/v1.
Device Details
No response
Exact Karakeep Version
v0.31.0
Environment Details
Docker
Debug Logs
No response
Have you checked the troubleshooting guide?