Remote vision APIs¶
docling-serve can describe each figure in a paper and put the description in the Markdown. By default it uses a model that runs inside docling-serve. This option makes it send each figure to a vision model behind an OpenAI-compatible API instead: a paid service or a local server such as Ollama. It is off by default.
docling-serve makes the call, not Zotero
The plugin tells docling-serve which API to use, and docling-serve sends the figures to it from its own machine. So the API URL must work from the docling-serve machine, and docling-serve has to be started with remote services allowed (see Server setup).
Turn it on¶
The settings are in Conversion options → Vision-Language Model. The pane only shows that section when Pipeline is set to VLM (vision-language model).
- Tick Describe pictures with a remote vision API instead of a local model. The local Picture-description preset is greyed out, since it isn't sent while this is on.
- Pick a Provider. That fills in API URL:
| Provider | API URL filled in | API key |
|---|---|---|
| OpenAI | https://api.openai.com/v1/chat/completions |
required |
| Anthropic | https://api.anthropic.com/v1/chat/completions |
required |
| OpenRouter | https://openrouter.ai/api/v1/chat/completions |
required |
| Ollama | http://localhost:11434/v1/chat/completions |
optional |
| LM Studio | http://localhost:1234/v1/chat/completions |
optional |
| vLLM | http://localhost:8000/v1/chat/completions |
optional |
| Custom | whatever you enter | optional |
- Enter the Model. It is required and has no default; use a model that accepts images.
- Enter the API key if the provider needs one. An optional key is only sent if you enter one.
- Optionally change Prompt (empty means "Describe this image in a few sentences.") and Timeout (seconds per image, default 120, up to 3600).
- Click Test Remote API.
Picking a provider always resets API URL to that provider's address. To use a different address, pick Custom or edit the URL after choosing.
Shown only for the VLM pipeline, used with any pipeline
Once the remote API is ticked, the plugin uses it for every conversion, including the Standard pipeline, even though the section is hidden then. Untick it (with Pipeline set to VLM so you can see it) to stop.
API keys¶
Keys are stored in Zotero's login manager, not in prefs, and one per provider: switching provider shows that provider's key, so one provider's key is never sent to another. Reset to defaults deletes them.
For Anthropic, the plugin sends the key as both Authorization: Bearer and
x-api-key, with anthropic-version: 2023-06-01. Other providers get
Authorization: Bearer <key>.
The key is sent to docling-serve with every conversion that uses the remote API, and docling-serve forwards it to the provider. Use HTTPS if docling-serve isn't on your own machine, and prefer a key limited to what you need, with a spending limit where the provider offers one.
Test Remote API¶
The test runs from this computer, not from docling-serve. It calls the
provider's model list, GET …/models (the API URL with /chat/completions
replaced), which costs nothing. No PDF or image is sent.
- For OpenAI, Anthropic and OpenRouter it asks for confirmation first.
- The API URL must end in
/chat/completions. - Results:
✓ Connected; model "…" found., or connected but the model isn't in the list (check the name), or an error such asHTTP 401: the API key was rejected. - It does not prove that docling-serve can reach the provider. That is the most common failure when docling-serve runs on another machine or in Docker.
Server setup¶
docling-serve refuses remote calls unless you allow them. Start it with:
DOCLING_SERVE_ENABLE_REMOTE_SERVICES=true \
DOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIG=true \
docling-serve run
docling-serve has two request fields for this, and the plugin picks one by
asking the server's GET /v1/capabilities (cached for 5 minutes per server
URL):
| Server reports | Field the plugin sends | Needs |
|---|---|---|
| custom picture-description config | picture_description_custom_config |
both variables above |
| anything else, or the check fails | picture_description_api |
only DOCLING_SERVE_ENABLE_REMOTE_SERVICES=true (older field, deprecated upstream) |
The newer field relies on a model_spec that docling-serve doesn't document,
so it may change in a later docling-serve.
Docker and localhost¶
localhost in the API URL means the docling-serve machine. If docling-serve
runs in Docker and the provider (for example Ollama) runs on the host, use
http://host.docker.internal:11434/v1/chat/completions.
When a conversion fails¶
docling-serve hides the cause of a failed conversion by default (set
DOCLING_SERVE_DEBUG_ERROR_DETAILS=true to see it). When the remote API is on
and the error is one of docling-serve's generic ones, the plugin adds a list of
likely causes:
- docling-serve wasn't started with
DOCLING_SERVE_ENABLE_REMOTE_SERVICES=true; - docling-serve can't reach the API URL from its own machine;
- the model isn't a vision model, or its name is wrong;
- the remote API settings are incomplete.
If the API URL points at localhost, it also suggests host.docker.internal.
Before sending anything, the plugin checks the settings and fails the PDF with
a clear message if the API URL isn't http(s), the model is empty, or a paid
provider has no key. If Advanced JSON sets picture_description_api or
picture_description_custom_config itself, that value is used and these
checks are skipped.
If conversions fail only with the remote API on, please open an issue.