#pdf ollama

1 messages Ā· Page 1 of 1 (latest)

placid timber
#

I'm having issues with qwen3.5:cloud not injecting pdf's. I got this message in discord when I handed off a pdf to my bot:

"You're absolutely right - I stand corrected! Qwen3.5 does have vision capabilities according to the Ollama page. It shows "Text, Image" support for all variants including qwen3.5:cloud.

The issue appears to be with the pdf tool's configuration, not the model itself. Looking at the error messages I got:
First it tried ollama/kimi-k2.5:cloud (wrong model)
Then openai/default (wrong provider)

It seems the pdf tool isn't properly routing to the current model (ollama/qwen3.5:cloud).

Let me try using the image tool instead, which should work with Qwen3.5's vision capabilities:
The image tool doesn't accept PDFs directly - it needs image files (PNG, JPG, etc.). The pdf tool is the correct one, but it's not properly routing to your vision-capable Qwen3.5 model.

This appears to be a configuration issue in OpenClaw's PDF tool handling - it's trying to use providers (kimi-k2.5, openai) that aren't configured instead of using your current ollama/qwen3.5:cloud model."

devout mangoBOT
#

Let me verify the docs and source path first, then I’ll pin down whether this is a routing bug or expected fallback behavior.

#

First, what does openclaw --version show?

I checked the docs and source, and I think the bot’s explanation was a little off:

  • Qwen vision support != native PDF support
  • In OpenClaw, the pdf tool does native PDF only for Anthropic and Google
  • For Ollama/Qwen, it uses PDF extraction fallback: extract text first, then render pages to images if needed
    Docs: https://docs.openclaw.ai/tools/pdf

So if OpenClaw tried kimi-k2.5:cloud and then openai/default, that usually means:

  1. it did not resolve your Ollama model as the PDF/image model, and
  2. it fell back to other configured image/PDF candidates.

The big thing I’d check is this:

  • If you defined models.providers.ollama explicitly, OpenClaw stops auto-discovery
#
  • In that case, your qwen3.5:cloud entry needs to be marked with:
    • input: ["text", "image"]

Otherwise the PDF tool won’t treat it as vision-capable, and it may route to other providers instead. Ollama docs: https://docs.openclaw.ai/providers/ollama

Also check whether you have either of these set:

  • agents.defaults.pdfModel
  • agents.defaults.imageModel

If you want to force PDF analysis through Qwen, set agents.defaults.pdfModel.primary to:

  • ollama/qwen3.5:cloud

Config docs: https://docs.openclaw.ai/concepts/models
Reference: https://docs.openclaw.ai/gateway/configuration-reference#agent-defaults

#

If you paste these 4 config bits plus your version, I can tell you exactly where it’s going wrong:

  • agents.defaults.model
  • agents.defaults.imageModel
  • agents.defaults.pdfModel
  • models.providers.ollama
placid timber
#

OpenClaw 2026.4.11 (769908e)

devout mangoBOT
#

Thanks, that helps.

On 2026.4.11, this still looks more like PDF tool model resolution than ā€œQwen native PDF brokeā€.

The important distinction is:

  • Ollama/Qwen is not a native-PDF provider in OpenClaw
  • Native PDF is currently Anthropic + Google only
  • For Ollama/Qwen, the pdf tool does extract text first, then render page images if needed
    Docs: https://docs.openclaw.ai/tools/pdf

So the fact it tried ollama/kimi-k2.5:cloud and then openai/default strongly suggests OpenClaw did not recognize ollama/qwen3.5:cloud as the PDF/image candidate, and fell back.

The 2 most likely causes are:

  1. You defined models.providers.ollama manually, which disables Ollama auto-discovery, and your qwen3.5:cloud entry is missing:
    • input: ["text", "image"]
#
  1. You didn’t explicitly pin the PDF/image model, so the PDF tool resolved some other candidate via:
    • agents.defaults.pdfModel
    • then agents.defaults.imageModel
    • then default model / other auth-backed fallback

If you want to force it, set:

  • agents.defaults.pdfModel.primary: "ollama/qwen3.5:cloud"

And if you have a manual Ollama model entry, make sure that exact model is marked image-capable.

Ollama docs: https://docs.openclaw.ai/providers/ollama
Models docs: https://docs.openclaw.ai/concepts/models
Config reference: https://docs.openclaw.ai/gateway/configuration-reference#agent-defaults

If you paste these config sections, I can usually spot the issue fast:

#
  • agents.defaults.model
  • agents.defaults.imageModel
  • agents.defaults.pdfModel
  • models.providers.ollama

One extra nuance: if the PDF is mostly text, extraction may still work even without image support. If it’s a scanned/image-only PDF, then the input: ["text", "image"] bit becomes critical.

placid timber
#

I don't see anything about this in my Openclaw.json file: "If you defined models.providers.ollama explicitly, OpenClaw stops auto-discovery"

There is nothing set for pdf/image model. What should I enter?

devout mangoBOT
#

If you don’t have a models.providers.ollama section, that’s actually good, it usually means auto-discovery is still on.

So the first thing I’d try is just pinning the PDF tool to Qwen:

{
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

If you also want the regular image tool to use the same model, add this too:

#
{
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      },
      imageModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

So my recommendation is:

#
  1. add pdfModel.primary first
  2. restart OpenClaw
  3. test the same PDF again

If it still falls back to kimi / openai, then I’d check whether OpenClaw is actually seeing that model the way we expect, and the next useful thing would be:

openclaw models status

Docs for the relevant config keys:

If you want, paste the agents.defaults part of your config after you edit it and I’ll sanity-check it.

placid timber
#

I do have a models.providers.ollama section

devout mangoBOT
#

Ah, yep, that’s the key.

If you have a models.providers.ollama section, then OpenClaw is using your manual Ollama model definitions, not auto-discovery. So for qwen3.5:cloud, you want both of these:

  1. In the Qwen model entry itself, make sure it includes:
input: ["text", "image"]
  1. In agents.defaults, pin the PDF tool to it:
pdfModel: {
  primary: "ollama/qwen3.5:cloud"
}
#

So the shape you want is roughly:

{
  models: {
    providers: {
      ollama: {
        // keep your existing provider config here
        models: [
          {
            id: "qwen3.5:cloud",
            // keep your existing fields
            input: ["text", "image"]
          }
        ]
      }
#
    }
  },
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

Important: that snippet is not a full replacement, just the relevant bits. Keep the rest of your existing Ollama model fields.

Then:

placid timber
#

Gateway aborted: config is invalid.
agents.defaults.models.ollama/qwen3.5ā˜ļø Unrecognized key: "input"
agents.defaults: Unrecognized key: "pdfmodel"
Fix the config and retry, or run "openclaw doctor" to repair.

devout mangoBOT
#

Let me double-check the exact config paths so I don’t send you on another goose chase.

#

Nice, that error is actually very helpful. I pointed you at the right idea, but the wrong section, sorry.

What it means:

  • agents.defaults.models is not where input goes
  • input belongs in the provider model definition under models.providers.ollama.models[]
  • pdfModel is correct, but it must be spelled exactly pdfModel with a capital M

So the fixes are:

1) Remove the bad entries

Remove:

  • input from anything under agents.defaults.models[...]
  • pdfmodel (lowercase m)

2) Add this under agents.defaults

#
agents: {
  defaults: {
    pdfModel: {
      primary: "ollama/qwen3.5:cloud"
    }
  }
}

3) In your existing models.providers.ollama.models entry for Qwen

Make sure the Qwen model entry has:

input: ["text", "image"]
#

So conceptually it should look like:

{
  models: {
    providers: {
      ollama: {
        // your existing ollama config
        models: [
          {
            id: "qwen3.5:cloud",
            // keep your existing fields
            input: ["text", "image"]
          }
        ]
      }
#
    }
  },
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

The important part is that input goes under models.providers.ollama.models[], not agents.defaults.models.

Docs:

placid timber
#

qwen is a fallback model

devout mangoBOT
#

Ah, that explains a lot.

If Qwen is only a fallback model, then the pdf tool will not automatically prefer it just because it has vision. So yes, in that setup, you should pin the PDF tool explicitly.

Use this under agents.defaults:

{
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}
#

That lets you keep your normal chat model/fallback chain, while telling the PDF tool to use Qwen first.

If you also want the regular image tool to use Qwen, add:

imageModel: {
  primary: "ollama/qwen3.5:cloud"
}

And since you have a manual models.providers.ollama section, make sure the Qwen model entry there is marked:

input: ["text", "image"]

So the likely winning combo is:

placid timber
#

I am using kimi-k2.5:cloud as my primary model which also supports vision

devout mangoBOT
#

Ah, okay, then this part is actually expected:

  • Kimi is your primary model
  • Kimi supports image input
  • so the pdf tool trying ollama/kimi-k2.5:cloud first is not wrong

That means the earlier ā€œwrong modelā€ theory was off.

What’s really happening is:

  • OpenClaw is not supposed to jump to Qwen just because Qwen is a fallback and also supports vision
  • with no explicit pdfModel, the PDF tool will try the model it resolves for PDF/image work, which in your setup is very plausibly Kimi first
  • if you want Qwen specifically for PDFs, you need to force it with:
agents: {
#
  defaults: {
    pdfModel: {
      primary: "ollama/qwen3.5:cloud"
    }
  }
}

So you have 2 valid paths:

Option 1, simplest

Let Kimi handle PDFs, since it’s already primary and vision-capable.

Option 2, if you specifically want Qwen for PDFs

Set:

#
agents: {
  defaults: {
    pdfModel: {
      primary: "ollama/qwen3.5:cloud"
    }
  }
}

Also, whichever model you want to use for PDFs, make sure its entry in models.providers.ollama.models[] has:

input: ["text", "image"]

So at this point, the important question is not ā€œwhy didn’t it use Qwen first?ā€, it’s:

placid timber
#

Gateway aborted: config is invalid.
agents.defaults: Unrecognized key: "pdfmodel"
Fix the config and retry, or run "openclaw doctor" to repair.

devout mangoBOT
#

Yep, that one is just case sensitivity.

The key must be exactly:

pdfModel

not:

pdfmodel

JSON/JSON5 keys are case-sensitive, and the gateway is reading it as lowercase.

Use this exact shape:

#
{
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

If you also want to pin the image tool, same pattern:

imageModel: {
#
  primary: "ollama/qwen3.5:cloud"
}

So the fix here is:

  • change pdfmodel → pdfModel
  • restart the gateway
  • test again

Docs: https://docs.openclaw.ai/concepts/models

If it still errors after using that exact casing, paste the exact agents.defaults block and I’ll check it line by line.

placid timber
#

Gateway aborted: config is invalid.
agents.defaults.models.ollama/qwen3.5ā˜ļø Unrecognized key: "input"
Fix the config and retry, or run "openclaw doctor" to repair.

devout mangoBOT
#

You’re still editing the wrong block.

That error means you added:

input: ["text", "image"]

under:

agents.defaults.models["ollama/qwen3.5:cloud"]

and that section does not support input. That’s why the gateway aborts.

Do this first

#

Remove the input line entirely from agents.defaults.models...

For now, make the smallest safe change:

{
  agents: {
    defaults: {
      pdfModel: {
        primary: "ollama/qwen3.5:cloud"
      }
    }
  }
}

So:

#
  • āœ… keep pdfModel
  • āŒ remove input from agents.defaults.models[...]

Important distinction

  • agents.defaults.models[...] = allowlist/catalog entry, aliases/params
  • models.providers.ollama.models[] = actual provider model definition, where input belongs

So the gateway is complaining because input is in the first one, not the second one.

At this point I’d do it in 2 steps:

  1. remove the bad input line
  2. add only pdfModel with the exact camelCase spelling

If that boots, test again.

If you want, paste just these two sections and I’ll rewrite them exactly:

placid timber
#

Qwen does not show up in that section. Only kimi does

devout mangoBOT
#

That’s the missing piece.

If Qwen is not in models.providers.ollama.models[], then OpenClaw can’t really use it as a proper Ollama model here, even if you have it elsewhere as a fallback/alias.

So right now your setup is basically saying:

  • Ollama provider knows about Kimi
  • Ollama provider does not know about Qwen
  • therefore PDF/model routing keeps landing on Kimi

So you have 2 real options:

Option 1, easiest

Just use Kimi for PDFs.

If Kimi is the only Ollama model defined in models.providers.ollama, that’s the cleanest path.

#

Option 2, if you specifically want Qwen

Add Qwen as another model entry under:

models.providers.ollama.models[]

Because with an explicit Ollama provider section, auto-discovery is off. If it’s not listed there, OpenClaw won’t know how to route to it properly.

Recommendation

I’d either:

  • stick with Kimi for PDF handling, or
  • paste your current models.providers.ollama block and I’ll turn it into a valid version that includes both Kimi and Qwen

That’s probably the least painful next step.

placid timber
#

How do I add qwen to the models block?

#

"ollama": {
"baseUrl": "http://127.0.0.1:11434",
"apiKey": "ollama-local",
"api": "ollama",
"models": [
{
"id": "kimi-k2.5:cloud",
"name": "kimi-k2.5:cloud",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 262144,
"maxTokens": 8192
}
]
}

devout mangoBOT
#

I’m going to check the exact model-entry shape so I don’t make you hand-edit invalid config again.

#

Easiest safe way: duplicate your existing Kimi model entry inside models.providers.ollama.models, then change the Qwen-specific bits.

So if you currently have something like this:

models: {
  providers: {
    ollama: {
      // existing ollama config...
      models: [
        {
          id: "kimi-k2.5:cloud",
          name: "Kimi K2.5 Cloud",
          reasoning: false,
          input: ["text", "image"],
          cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
#
          contextWindow: 262144,
          maxTokens: 262144,
        }
      ]
    }
  }
}

make it:

models: {
  providers: {
    ollama: {
#
      // existing ollama config...
      models: [
        {
          id: "kimi-k2.5:cloud",
          name: "Kimi K2.5 Cloud",
          reasoning: false,
          input: ["text", "image"],
          cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
          contextWindow: 262144,
          maxTokens: 262144,
        },
        {
          id: "qwen3.5:cloud",
          name: "Qwen 3.5 Cloud",
          reasoning: false,
#
          input: ["text", "image"],
          cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
          contextWindow: 262144,
          maxTokens: 262144,
        }
      ]
    }
  }
}

Then, if you want PDFs to use Qwen specifically, add:

agents: {
#
  defaults: {
    pdfModel: {
      primary: "ollama/qwen3.5:cloud"
    }
  }
}

Important

  • Add Qwen under models.providers.ollama.models
  • Do not add input under agents.defaults.models

If you want the safest version, paste your current Kimi object and I’ll rewrite it into the exact Qwen object so you can paste it in without guessing.

Docs: https://docs.openclaw.ai/providers/ollama

#

Perfect, now we can make this concrete.

I’d change your Ollama block to this, keeping Kimi and adding Qwen alongside it:

"ollama": {
  "baseUrl": "http://127.0.0.1:11434",
  "apiKey": "ollama-local",
  "api": "ollama",
  "models": [
    {
      "id": "kimi-k2.5:cloud",
      "name": "kimi-k2.5:cloud",
      "reasoning": true,
      "input": ["text", "image"],
      "cost": {
#
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 262144,
      "maxTokens": 8192
    },
    {
      "id": "qwen3.5:cloud",
      "name": "qwen3.5:cloud",
      "reasoning": true,
      "input": ["text", "image"],
      "cost": {
        "input": 0,
#
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 262144,
      "maxTokens": 8192
    }
  ]
}

Then under agents.defaults, add:

"pdfModel": {